Skip to content

Commit

Permalink
Merge pull request #209 from tssurya/update-conditions-kubebuilder-ma…
Browse files Browse the repository at this point in the history
…rker

Add kubebuilder syntax for status.conditions
  • Loading branch information
k8s-ci-robot authored Mar 17, 2024
2 parents d48faee + d6cc8ad commit e1ce2d7
Show file tree
Hide file tree
Showing 32 changed files with 1,904 additions and 2 deletions.
6 changes: 5 additions & 1 deletion apis/v1alpha1/adminnetworkpolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ type AdminNetworkPolicy struct {

// AdminNetworkPolicyStatus defines the observed state of AdminNetworkPolicy.
type AdminNetworkPolicyStatus struct {
Conditions []metav1.Condition `json:"conditions"`
// +patchMergeKey=type
// +patchStrategy=merge
// +listType=map
// +listMapKey=type
Conditions []metav1.Condition `json:"conditions" patchStrategy:"merge" patchMergeKey:"type"`
}

// AdminNetworkPolicySpec defines the desired state of AdminNetworkPolicy.
Expand Down
6 changes: 5 additions & 1 deletion apis/v1alpha1/baselineadminnetworkpolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ type BaselineAdminNetworkPolicy struct {
// BaselineAdminNetworkPolicyStatus defines the observed state of
// BaselineAdminNetworkPolicy.
type BaselineAdminNetworkPolicyStatus struct {
Conditions []metav1.Condition `json:"conditions"`
// +patchMergeKey=type
// +patchStrategy=merge
// +listType=map
// +listMapKey=type
Conditions []metav1.Condition `json:"conditions" patchStrategy:"merge" patchMergeKey:"type"`
}

// BaselineAdminNetworkPolicySpec defines the desired state of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1242,6 +1242,9 @@ spec:
- type
type: object
type: array
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
required:
- conditions
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1215,6 +1215,9 @@ spec:
- type
type: object
type: array
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
required:
- conditions
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,9 @@ spec:
- type
type: object
type: array
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
required:
- conditions
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,9 @@ spec:
- type
type: object
type: array
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
required:
- conditions
type: object
Expand Down
8 changes: 8 additions & 0 deletions hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,26 @@ readonly APIS_PKG=sigs.k8s.io/network-policy-api
readonly API_DIR=${APIS_PKG}/apis/v1alpha1
readonly CLIENTSET_NAME=versioned
readonly CLIENTSET_PKG_NAME=clientset
readonly APPLYCONFIG_PKG_NAME=applyconfiguration

readonly COMMON_FLAGS="${VERIFY_FLAG:-} --go-header-file ${SCRIPT_ROOT}/hack/boilerplate.generatego.txt"

echo "Generating CRDs"
go run ./pkg/generator

echo "Generating applyconfig at ${OUTPUT_PKG}/${APPLYCONFIG_PKG_NAME}"
go run k8s.io/code-generator/cmd/applyconfiguration-gen \
--input-dirs "${API_DIR}" \
--output-package "${OUTPUT_PKG}/${APPLYCONFIG_PKG_NAME}" \
${COMMON_FLAGS}

echo "Generating clientset at ${OUTPUT_PKG}/${CLIENTSET_PKG_NAME}"
go run k8s.io/code-generator/cmd/client-gen \
--clientset-name "${CLIENTSET_NAME}" \
--input-base "" \
--input "${API_DIR}" \
--output-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME}" \
--apply-configuration-package "${OUTPUT_PKG}/${APPLYCONFIG_PKG_NAME}" \
${COMMON_FLAGS}

echo "Generating listers at ${OUTPUT_PKG}/listers"
Expand Down
218 changes: 218 additions & 0 deletions pkg/client/applyconfiguration/apis/v1alpha1/adminnetworkpolicy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e1ce2d7

Please sign in to comment.