From dfee3d633713e38d51f7cdfca76e404df1d03a4c Mon Sep 17 00:00:00 2001 From: Mario Manno Date: Tue, 24 Sep 2024 14:08:43 +0200 Subject: [PATCH] Remove empty fields from gitrepo/bd resources > Null values for fields that either don't specify the nullable flag, or give it a false value, will be pruned before defaulting happens. If a default is present, it will be applied. When nullable is true, null values will be conserved and won't be defaulted. ``` // +nullable marks this field as allowing the "null" value. // +optional specifies that this field is optional. ``` --- charts/fleet-crd/templates/crds.yaml | 7 ------- .../fleet.cattle.io/v1alpha1/bundledeployment_types.go | 3 ++- pkg/apis/fleet.cattle.io/v1alpha1/gitrepo_types.go | 3 --- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/charts/fleet-crd/templates/crds.yaml b/charts/fleet-crd/templates/crds.yaml index 043354c021..f7585f56c3 100644 --- a/charts/fleet-crd/templates/crds.yaml +++ b/charts/fleet-crd/templates/crds.yaml @@ -275,7 +275,6 @@ spec: helm: description: Helm options for the deployment, like the chart name, repo and values. - nullable: true properties: atomic: description: Atomic sets the --atomic flag when Helm is @@ -622,7 +621,6 @@ spec: helm: description: Helm options for the deployment, like the chart name, repo and values. - nullable: true properties: atomic: description: Atomic sets the --atomic flag when Helm is @@ -1456,7 +1454,6 @@ spec: helm: description: Helm options for the deployment, like the chart name, repo and values. - nullable: true properties: atomic: description: Atomic sets the --atomic flag when Helm is performing @@ -2301,7 +2298,6 @@ spec: helm: description: Helm options for the deployment, like the chart name, repo and values. - nullable: true properties: atomic: description: Atomic sets the --atomic flag when Helm is @@ -6237,12 +6233,10 @@ spec: authorEmail: description: AuthorEmail gives the email to provide when making a commit - nullable: true type: string authorName: description: AuthorName gives the name to provide when making a commit - nullable: true type: string messageTemplate: description: 'MessageTemplate provides a template for the commit @@ -6250,7 +6244,6 @@ spec: into which will be interpolated the details of the change made.' - nullable: true type: string type: object imageScanInterval: diff --git a/pkg/apis/fleet.cattle.io/v1alpha1/bundledeployment_types.go b/pkg/apis/fleet.cattle.io/v1alpha1/bundledeployment_types.go index fce5d7f5e6..749c7d36a4 100644 --- a/pkg/apis/fleet.cattle.io/v1alpha1/bundledeployment_types.go +++ b/pkg/apis/fleet.cattle.io/v1alpha1/bundledeployment_types.go @@ -72,7 +72,7 @@ type BundleDeploymentOptions struct { Kustomize *KustomizeOptions `json:"kustomize,omitempty"` // Helm options for the deployment, like the chart name, repo and values. - // +nullable + // +optional Helm *HelmOptions `json:"helm,omitempty"` // ServiceAccount which will be used to perform this deployment. @@ -98,6 +98,7 @@ type BundleDeploymentOptions struct { DeleteNamespace bool `json:"deleteNamespace,omitempty"` //IgnoreOptions can be used to ignore fields when monitoring the bundle. + // +optional IgnoreOptions `json:"ignore,omitempty"` // CorrectDrift specifies how drift correction should work. diff --git a/pkg/apis/fleet.cattle.io/v1alpha1/gitrepo_types.go b/pkg/apis/fleet.cattle.io/v1alpha1/gitrepo_types.go index 4d3ad43856..56fd433df7 100644 --- a/pkg/apis/fleet.cattle.io/v1alpha1/gitrepo_types.go +++ b/pkg/apis/fleet.cattle.io/v1alpha1/gitrepo_types.go @@ -306,16 +306,13 @@ type ResourcePerClusterState struct { type CommitSpec struct { // AuthorName gives the name to provide when making a commit // +optional - // +nullable AuthorName string `json:"authorName"` // AuthorEmail gives the email to provide when making a commit // +optional - // +nullable AuthorEmail string `json:"authorEmail"` // MessageTemplate provides a template for the commit message, // into which will be interpolated the details of the change made. // +optional - // +nullable MessageTemplate string `json:"messageTemplate,omitempty"` }