From 6d5ca02c8fed2d74ae5ddf3fb6c7307f759d46c1 Mon Sep 17 00:00:00 2001 From: michaelawyu Date: Thu, 24 Oct 2024 04:06:57 +0800 Subject: [PATCH] Fixes inconsistent JSON tags (#934) --- apis/cluster/v1beta1/zz_generated.deepcopy.go | 2 +- .../v1beta1/clusterresourceplacement_types.go | 4 +- .../v1beta1/zz_generated.deepcopy.go | 2 +- apis/v1alpha1/zz_generated.deepcopy.go | 2 +- ...etes-fleet.io_clusterresourcebindings.yaml | 116 +++++++++--------- ...es-fleet.io_clusterresourceplacements.yaml | 116 +++++++++--------- ...etes-fleet.io_clusterstagedupdateruns.yaml | 116 +++++++++--------- .../placement.kubernetes-fleet.io_works.yaml | 116 +++++++++--------- 8 files changed, 237 insertions(+), 237 deletions(-) diff --git a/apis/cluster/v1beta1/zz_generated.deepcopy.go b/apis/cluster/v1beta1/zz_generated.deepcopy.go index 6c25f0189..6d06cb15b 100644 --- a/apis/cluster/v1beta1/zz_generated.deepcopy.go +++ b/apis/cluster/v1beta1/zz_generated.deepcopy.go @@ -10,7 +10,7 @@ Licensed under the MIT license. package v1beta1 import ( - v1 "k8s.io/api/core/v1" + "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) diff --git a/apis/placement/v1beta1/clusterresourceplacement_types.go b/apis/placement/v1beta1/clusterresourceplacement_types.go index f327a96a2..afcd59641 100644 --- a/apis/placement/v1beta1/clusterresourceplacement_types.go +++ b/apis/placement/v1beta1/clusterresourceplacement_types.go @@ -461,7 +461,7 @@ type ApplyStrategy struct { // +kubebuilder:default=PartialComparison // +kubebuilder:validation:Enum=PartialComparison;FullComparison // +kubebuilder:validation:Optional - ComparisonOption ComparisonOptionType `json:"compareOption,omitempty"` + ComparisonOption ComparisonOptionType `json:"comparisonOption,omitempty"` // WhenToApply controls when Fleet would apply the manifests on the hub cluster to the member // clusters. @@ -600,7 +600,7 @@ type ApplyStrategy struct { // +kubebuilder:default=Always // +kubebuilder:validation:Enum=Always;IfNoDiff // +kubebuilder:validation:Optional - WhenToTakeOver WhenToTakeOverType `json:"actionType,omitempty"` + WhenToTakeOver WhenToTakeOverType `json:"whenToTakeOver,omitempty"` } // ComparisonOptionType describes the compare option that Fleet uses to detect drifts and/or diff --git a/apis/placement/v1beta1/zz_generated.deepcopy.go b/apis/placement/v1beta1/zz_generated.deepcopy.go index 754effe01..f20cf8be5 100644 --- a/apis/placement/v1beta1/zz_generated.deepcopy.go +++ b/apis/placement/v1beta1/zz_generated.deepcopy.go @@ -10,7 +10,7 @@ Licensed under the MIT license. package v1beta1 import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/intstr" ) diff --git a/apis/v1alpha1/zz_generated.deepcopy.go b/apis/v1alpha1/zz_generated.deepcopy.go index ac4844274..0d4061551 100644 --- a/apis/v1alpha1/zz_generated.deepcopy.go +++ b/apis/v1alpha1/zz_generated.deepcopy.go @@ -11,7 +11,7 @@ package v1alpha1 import ( corev1 "k8s.io/api/core/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) diff --git a/config/crd/bases/placement.kubernetes-fleet.io_clusterresourcebindings.yaml b/config/crd/bases/placement.kubernetes-fleet.io_clusterresourcebindings.yaml index 1cf1738ee..45c007b07 100644 --- a/config/crd/bases/placement.kubernetes-fleet.io_clusterresourcebindings.yaml +++ b/config/crd/bases/placement.kubernetes-fleet.io_clusterresourcebindings.yaml @@ -428,63 +428,6 @@ spec: ApplyStrategy describes how to resolve the conflict if the resource to be placed already exists in the target cluster and is owned by other appliers. properties: - actionType: - default: Always - description: |- - WhenToTakeOver determines the action to take when Fleet applies resources to a member - cluster for the first time and finds out that the resource already exists in the cluster. - - - This setting is most relevant in cases where you would like Fleet to manage pre-existing - resources on a member cluster. - - - Available options include: - - - * Always: with this action, Fleet will apply the hub cluster manifests to the member - clusters even if the affected resources already exist. This is the default action. - - - Note that this might lead to fields being overwritten on the member clusters, if they - are specified in the hub cluster manifests. - - - * IfNoDiff: with this action, Fleet will apply the hub cluster manifests to the member - clusters if (and only if) pre-existing resources look the same as the hub cluster manifests. - This is a safer option as pre-existing resources that are inconsistent with the hub cluster - manifests will not be overwritten; in fact, Fleet will ignore them until the inconsistencies - are resolved properly: any change you make to the hub cluster manifests would not be - applied, and if you delete the manifests or even the ClusterResourcePlacement itself - from the hub cluster, these pre-existing resources would not be taken away. - - - Fleet will check for inconsistencies in accordance with the ComparisonOption setting. See also - the comments on the ComparisonOption field for more information. - - - If a diff has been found in a field that is **managed** by Fleet (i.e., the field - **is specified ** in the hub cluster manifest), consider one of the following actions: - * set the field in the member cluster to be of the same value as that in the hub cluster - manifest. - * update the hub cluster manifest so that its field value matches with that in the member - cluster. - * switch to the Always action, which will allow Fleet to overwrite the field with the - value in the hub cluster manifest. - - - If a diff has been found in a field that is **not managed** by Fleet (i.e., the field - **is not specified** in the hub cluster manifest), consider one of the following actions: - * remove the field from the member cluster. - * update the hub cluster manifest so that the field is included in the hub cluster manifest. - - - If appropriate, you may also delete the object from the member cluster; Fleet will recreate - it using the hub cluster manifest. - enum: - - Always - - IfNoDiff - type: string allowCoOwnership: description: |- AllowCoOwnership defines whether to apply the resource if it already exists in the target cluster and is not @@ -492,7 +435,7 @@ spec: If true, apply the resource and add fleet as a co-owner. If false, leave the resource unchanged and fail the apply. type: boolean - compareOption: + comparisonOption: default: PartialComparison description: |- ComparisonOption controls how Fleet compares the desired state of a resource, as kept in @@ -651,6 +594,63 @@ spec: - Always - IfNotDrifted type: string + whenToTakeOver: + default: Always + description: |- + WhenToTakeOver determines the action to take when Fleet applies resources to a member + cluster for the first time and finds out that the resource already exists in the cluster. + + + This setting is most relevant in cases where you would like Fleet to manage pre-existing + resources on a member cluster. + + + Available options include: + + + * Always: with this action, Fleet will apply the hub cluster manifests to the member + clusters even if the affected resources already exist. This is the default action. + + + Note that this might lead to fields being overwritten on the member clusters, if they + are specified in the hub cluster manifests. + + + * IfNoDiff: with this action, Fleet will apply the hub cluster manifests to the member + clusters if (and only if) pre-existing resources look the same as the hub cluster manifests. + This is a safer option as pre-existing resources that are inconsistent with the hub cluster + manifests will not be overwritten; in fact, Fleet will ignore them until the inconsistencies + are resolved properly: any change you make to the hub cluster manifests would not be + applied, and if you delete the manifests or even the ClusterResourcePlacement itself + from the hub cluster, these pre-existing resources would not be taken away. + + + Fleet will check for inconsistencies in accordance with the ComparisonOption setting. See also + the comments on the ComparisonOption field for more information. + + + If a diff has been found in a field that is **managed** by Fleet (i.e., the field + **is specified ** in the hub cluster manifest), consider one of the following actions: + * set the field in the member cluster to be of the same value as that in the hub cluster + manifest. + * update the hub cluster manifest so that its field value matches with that in the member + cluster. + * switch to the Always action, which will allow Fleet to overwrite the field with the + value in the hub cluster manifest. + + + If a diff has been found in a field that is **not managed** by Fleet (i.e., the field + **is not specified** in the hub cluster manifest), consider one of the following actions: + * remove the field from the member cluster. + * update the hub cluster manifest so that the field is included in the hub cluster manifest. + + + If appropriate, you may also delete the object from the member cluster; Fleet will recreate + it using the hub cluster manifest. + enum: + - Always + - IfNoDiff + type: string type: object clusterDecision: description: ClusterDecision explains why the scheduler selected this diff --git a/config/crd/bases/placement.kubernetes-fleet.io_clusterresourceplacements.yaml b/config/crd/bases/placement.kubernetes-fleet.io_clusterresourceplacements.yaml index cb9b94160..57d323c99 100644 --- a/config/crd/bases/placement.kubernetes-fleet.io_clusterresourceplacements.yaml +++ b/config/crd/bases/placement.kubernetes-fleet.io_clusterresourceplacements.yaml @@ -1756,63 +1756,6 @@ spec: description: ApplyStrategy describes when and how to apply the selected resources to the target cluster. properties: - actionType: - default: Always - description: |- - WhenToTakeOver determines the action to take when Fleet applies resources to a member - cluster for the first time and finds out that the resource already exists in the cluster. - - - This setting is most relevant in cases where you would like Fleet to manage pre-existing - resources on a member cluster. - - - Available options include: - - - * Always: with this action, Fleet will apply the hub cluster manifests to the member - clusters even if the affected resources already exist. This is the default action. - - - Note that this might lead to fields being overwritten on the member clusters, if they - are specified in the hub cluster manifests. - - - * IfNoDiff: with this action, Fleet will apply the hub cluster manifests to the member - clusters if (and only if) pre-existing resources look the same as the hub cluster manifests. - This is a safer option as pre-existing resources that are inconsistent with the hub cluster - manifests will not be overwritten; in fact, Fleet will ignore them until the inconsistencies - are resolved properly: any change you make to the hub cluster manifests would not be - applied, and if you delete the manifests or even the ClusterResourcePlacement itself - from the hub cluster, these pre-existing resources would not be taken away. - - - Fleet will check for inconsistencies in accordance with the ComparisonOption setting. See also - the comments on the ComparisonOption field for more information. - - - If a diff has been found in a field that is **managed** by Fleet (i.e., the field - **is specified ** in the hub cluster manifest), consider one of the following actions: - * set the field in the member cluster to be of the same value as that in the hub cluster - manifest. - * update the hub cluster manifest so that its field value matches with that in the member - cluster. - * switch to the Always action, which will allow Fleet to overwrite the field with the - value in the hub cluster manifest. - - - If a diff has been found in a field that is **not managed** by Fleet (i.e., the field - **is not specified** in the hub cluster manifest), consider one of the following actions: - * remove the field from the member cluster. - * update the hub cluster manifest so that the field is included in the hub cluster manifest. - - - If appropriate, you may also delete the object from the member cluster; Fleet will recreate - it using the hub cluster manifest. - enum: - - Always - - IfNoDiff - type: string allowCoOwnership: description: |- AllowCoOwnership defines whether to apply the resource if it already exists in the target cluster and is not @@ -1820,7 +1763,7 @@ spec: If true, apply the resource and add fleet as a co-owner. If false, leave the resource unchanged and fail the apply. type: boolean - compareOption: + comparisonOption: default: PartialComparison description: |- ComparisonOption controls how Fleet compares the desired state of a resource, as kept in @@ -1979,6 +1922,63 @@ spec: - Always - IfNotDrifted type: string + whenToTakeOver: + default: Always + description: |- + WhenToTakeOver determines the action to take when Fleet applies resources to a member + cluster for the first time and finds out that the resource already exists in the cluster. + + + This setting is most relevant in cases where you would like Fleet to manage pre-existing + resources on a member cluster. + + + Available options include: + + + * Always: with this action, Fleet will apply the hub cluster manifests to the member + clusters even if the affected resources already exist. This is the default action. + + + Note that this might lead to fields being overwritten on the member clusters, if they + are specified in the hub cluster manifests. + + + * IfNoDiff: with this action, Fleet will apply the hub cluster manifests to the member + clusters if (and only if) pre-existing resources look the same as the hub cluster manifests. + This is a safer option as pre-existing resources that are inconsistent with the hub cluster + manifests will not be overwritten; in fact, Fleet will ignore them until the inconsistencies + are resolved properly: any change you make to the hub cluster manifests would not be + applied, and if you delete the manifests or even the ClusterResourcePlacement itself + from the hub cluster, these pre-existing resources would not be taken away. + + + Fleet will check for inconsistencies in accordance with the ComparisonOption setting. See also + the comments on the ComparisonOption field for more information. + + + If a diff has been found in a field that is **managed** by Fleet (i.e., the field + **is specified ** in the hub cluster manifest), consider one of the following actions: + * set the field in the member cluster to be of the same value as that in the hub cluster + manifest. + * update the hub cluster manifest so that its field value matches with that in the member + cluster. + * switch to the Always action, which will allow Fleet to overwrite the field with the + value in the hub cluster manifest. + + + If a diff has been found in a field that is **not managed** by Fleet (i.e., the field + **is not specified** in the hub cluster manifest), consider one of the following actions: + * remove the field from the member cluster. + * update the hub cluster manifest so that the field is included in the hub cluster manifest. + + + If appropriate, you may also delete the object from the member cluster; Fleet will recreate + it using the hub cluster manifest. + enum: + - Always + - IfNoDiff + type: string type: object rollingUpdate: description: Rolling update config params. Present only if RolloutStrategyType diff --git a/config/crd/bases/placement.kubernetes-fleet.io_clusterstagedupdateruns.yaml b/config/crd/bases/placement.kubernetes-fleet.io_clusterstagedupdateruns.yaml index f149b3e98..6eb3c730a 100644 --- a/config/crd/bases/placement.kubernetes-fleet.io_clusterstagedupdateruns.yaml +++ b/config/crd/bases/placement.kubernetes-fleet.io_clusterstagedupdateruns.yaml @@ -87,63 +87,6 @@ spec: It is the same as the apply strategy in the CRP when the staged update run starts. The apply strategy is not updated during the update run even if it changes in the CRP. properties: - actionType: - default: Always - description: |- - WhenToTakeOver determines the action to take when Fleet applies resources to a member - cluster for the first time and finds out that the resource already exists in the cluster. - - - This setting is most relevant in cases where you would like Fleet to manage pre-existing - resources on a member cluster. - - - Available options include: - - - * Always: with this action, Fleet will apply the hub cluster manifests to the member - clusters even if the affected resources already exist. This is the default action. - - - Note that this might lead to fields being overwritten on the member clusters, if they - are specified in the hub cluster manifests. - - - * IfNoDiff: with this action, Fleet will apply the hub cluster manifests to the member - clusters if (and only if) pre-existing resources look the same as the hub cluster manifests. - This is a safer option as pre-existing resources that are inconsistent with the hub cluster - manifests will not be overwritten; in fact, Fleet will ignore them until the inconsistencies - are resolved properly: any change you make to the hub cluster manifests would not be - applied, and if you delete the manifests or even the ClusterResourcePlacement itself - from the hub cluster, these pre-existing resources would not be taken away. - - - Fleet will check for inconsistencies in accordance with the ComparisonOption setting. See also - the comments on the ComparisonOption field for more information. - - - If a diff has been found in a field that is **managed** by Fleet (i.e., the field - **is specified ** in the hub cluster manifest), consider one of the following actions: - * set the field in the member cluster to be of the same value as that in the hub cluster - manifest. - * update the hub cluster manifest so that its field value matches with that in the member - cluster. - * switch to the Always action, which will allow Fleet to overwrite the field with the - value in the hub cluster manifest. - - - If a diff has been found in a field that is **not managed** by Fleet (i.e., the field - **is not specified** in the hub cluster manifest), consider one of the following actions: - * remove the field from the member cluster. - * update the hub cluster manifest so that the field is included in the hub cluster manifest. - - - If appropriate, you may also delete the object from the member cluster; Fleet will recreate - it using the hub cluster manifest. - enum: - - Always - - IfNoDiff - type: string allowCoOwnership: description: |- AllowCoOwnership defines whether to apply the resource if it already exists in the target cluster and is not @@ -151,7 +94,7 @@ spec: If true, apply the resource and add fleet as a co-owner. If false, leave the resource unchanged and fail the apply. type: boolean - compareOption: + comparisonOption: default: PartialComparison description: |- ComparisonOption controls how Fleet compares the desired state of a resource, as kept in @@ -310,6 +253,63 @@ spec: - Always - IfNotDrifted type: string + whenToTakeOver: + default: Always + description: |- + WhenToTakeOver determines the action to take when Fleet applies resources to a member + cluster for the first time and finds out that the resource already exists in the cluster. + + + This setting is most relevant in cases where you would like Fleet to manage pre-existing + resources on a member cluster. + + + Available options include: + + + * Always: with this action, Fleet will apply the hub cluster manifests to the member + clusters even if the affected resources already exist. This is the default action. + + + Note that this might lead to fields being overwritten on the member clusters, if they + are specified in the hub cluster manifests. + + + * IfNoDiff: with this action, Fleet will apply the hub cluster manifests to the member + clusters if (and only if) pre-existing resources look the same as the hub cluster manifests. + This is a safer option as pre-existing resources that are inconsistent with the hub cluster + manifests will not be overwritten; in fact, Fleet will ignore them until the inconsistencies + are resolved properly: any change you make to the hub cluster manifests would not be + applied, and if you delete the manifests or even the ClusterResourcePlacement itself + from the hub cluster, these pre-existing resources would not be taken away. + + + Fleet will check for inconsistencies in accordance with the ComparisonOption setting. See also + the comments on the ComparisonOption field for more information. + + + If a diff has been found in a field that is **managed** by Fleet (i.e., the field + **is specified ** in the hub cluster manifest), consider one of the following actions: + * set the field in the member cluster to be of the same value as that in the hub cluster + manifest. + * update the hub cluster manifest so that its field value matches with that in the member + cluster. + * switch to the Always action, which will allow Fleet to overwrite the field with the + value in the hub cluster manifest. + + + If a diff has been found in a field that is **not managed** by Fleet (i.e., the field + **is not specified** in the hub cluster manifest), consider one of the following actions: + * remove the field from the member cluster. + * update the hub cluster manifest so that the field is included in the hub cluster manifest. + + + If appropriate, you may also delete the object from the member cluster; Fleet will recreate + it using the hub cluster manifest. + enum: + - Always + - IfNoDiff + type: string type: object conditions: description: |- diff --git a/config/crd/bases/placement.kubernetes-fleet.io_works.yaml b/config/crd/bases/placement.kubernetes-fleet.io_works.yaml index 47188d3cf..b1faf9bc7 100644 --- a/config/crd/bases/placement.kubernetes-fleet.io_works.yaml +++ b/config/crd/bases/placement.kubernetes-fleet.io_works.yaml @@ -336,63 +336,6 @@ spec: ApplyStrategy describes how to resolve the conflict if the resource to be placed already exists in the target cluster and is owned by other appliers. properties: - actionType: - default: Always - description: |- - WhenToTakeOver determines the action to take when Fleet applies resources to a member - cluster for the first time and finds out that the resource already exists in the cluster. - - - This setting is most relevant in cases where you would like Fleet to manage pre-existing - resources on a member cluster. - - - Available options include: - - - * Always: with this action, Fleet will apply the hub cluster manifests to the member - clusters even if the affected resources already exist. This is the default action. - - - Note that this might lead to fields being overwritten on the member clusters, if they - are specified in the hub cluster manifests. - - - * IfNoDiff: with this action, Fleet will apply the hub cluster manifests to the member - clusters if (and only if) pre-existing resources look the same as the hub cluster manifests. - This is a safer option as pre-existing resources that are inconsistent with the hub cluster - manifests will not be overwritten; in fact, Fleet will ignore them until the inconsistencies - are resolved properly: any change you make to the hub cluster manifests would not be - applied, and if you delete the manifests or even the ClusterResourcePlacement itself - from the hub cluster, these pre-existing resources would not be taken away. - - - Fleet will check for inconsistencies in accordance with the ComparisonOption setting. See also - the comments on the ComparisonOption field for more information. - - - If a diff has been found in a field that is **managed** by Fleet (i.e., the field - **is specified ** in the hub cluster manifest), consider one of the following actions: - * set the field in the member cluster to be of the same value as that in the hub cluster - manifest. - * update the hub cluster manifest so that its field value matches with that in the member - cluster. - * switch to the Always action, which will allow Fleet to overwrite the field with the - value in the hub cluster manifest. - - - If a diff has been found in a field that is **not managed** by Fleet (i.e., the field - **is not specified** in the hub cluster manifest), consider one of the following actions: - * remove the field from the member cluster. - * update the hub cluster manifest so that the field is included in the hub cluster manifest. - - - If appropriate, you may also delete the object from the member cluster; Fleet will recreate - it using the hub cluster manifest. - enum: - - Always - - IfNoDiff - type: string allowCoOwnership: description: |- AllowCoOwnership defines whether to apply the resource if it already exists in the target cluster and is not @@ -400,7 +343,7 @@ spec: If true, apply the resource and add fleet as a co-owner. If false, leave the resource unchanged and fail the apply. type: boolean - compareOption: + comparisonOption: default: PartialComparison description: |- ComparisonOption controls how Fleet compares the desired state of a resource, as kept in @@ -559,6 +502,63 @@ spec: - Always - IfNotDrifted type: string + whenToTakeOver: + default: Always + description: |- + WhenToTakeOver determines the action to take when Fleet applies resources to a member + cluster for the first time and finds out that the resource already exists in the cluster. + + + This setting is most relevant in cases where you would like Fleet to manage pre-existing + resources on a member cluster. + + + Available options include: + + + * Always: with this action, Fleet will apply the hub cluster manifests to the member + clusters even if the affected resources already exist. This is the default action. + + + Note that this might lead to fields being overwritten on the member clusters, if they + are specified in the hub cluster manifests. + + + * IfNoDiff: with this action, Fleet will apply the hub cluster manifests to the member + clusters if (and only if) pre-existing resources look the same as the hub cluster manifests. + This is a safer option as pre-existing resources that are inconsistent with the hub cluster + manifests will not be overwritten; in fact, Fleet will ignore them until the inconsistencies + are resolved properly: any change you make to the hub cluster manifests would not be + applied, and if you delete the manifests or even the ClusterResourcePlacement itself + from the hub cluster, these pre-existing resources would not be taken away. + + + Fleet will check for inconsistencies in accordance with the ComparisonOption setting. See also + the comments on the ComparisonOption field for more information. + + + If a diff has been found in a field that is **managed** by Fleet (i.e., the field + **is specified ** in the hub cluster manifest), consider one of the following actions: + * set the field in the member cluster to be of the same value as that in the hub cluster + manifest. + * update the hub cluster manifest so that its field value matches with that in the member + cluster. + * switch to the Always action, which will allow Fleet to overwrite the field with the + value in the hub cluster manifest. + + + If a diff has been found in a field that is **not managed** by Fleet (i.e., the field + **is not specified** in the hub cluster manifest), consider one of the following actions: + * remove the field from the member cluster. + * update the hub cluster manifest so that the field is included in the hub cluster manifest. + + + If appropriate, you may also delete the object from the member cluster; Fleet will recreate + it using the hub cluster manifest. + enum: + - Always + - IfNoDiff + type: string type: object workload: description: Workload represents the manifest workload to be deployed