diff --git a/addon/v1alpha1/0000_03_addon.open-cluster-management.io_addontemplates.crd.yaml b/addon/v1alpha1/0000_03_addon.open-cluster-management.io_addontemplates.crd.yaml index 6a063e773..898dadbab 100644 --- a/addon/v1alpha1/0000_03_addon.open-cluster-management.io_addontemplates.crd.yaml +++ b/addon/v1alpha1/0000_03_addon.open-cluster-management.io_addontemplates.crd.yaml @@ -271,11 +271,14 @@ spec: server side apply with work-controller as the field manager. If there is conflict, the related Applied condition of manifest will be in the status of False - with the reason of ApplyConflict. + with the reason of ApplyConflict. ReadOnly type means + the agent will only check the existence of the resource + based on its metadata. enum: - Update - CreateOnly - ServerSideApply + - ReadOnly type: string required: - type diff --git a/work/v1/0000_00_work.open-cluster-management.io_manifestworks.crd.yaml b/work/v1/0000_00_work.open-cluster-management.io_manifestworks.crd.yaml index c3b0133ec..f9152ba4d 100644 --- a/work/v1/0000_00_work.open-cluster-management.io_manifestworks.crd.yaml +++ b/work/v1/0000_00_work.open-cluster-management.io_manifestworks.crd.yaml @@ -253,11 +253,14 @@ spec: means to update resource using server side apply with work-controller as the field manager. If there is conflict, the related Applied condition of manifest will be in the - status of False with the reason of ApplyConflict. + status of False with the reason of ApplyConflict. ReadOnly + type means the agent will only check the existence of + the resource based on its metadata. enum: - Update - CreateOnly - ServerSideApply + - ReadOnly type: string required: - type diff --git a/work/v1/types.go b/work/v1/types.go index 39b8ec2b2..7ab0865a5 100644 --- a/work/v1/types.go +++ b/work/v1/types.go @@ -162,8 +162,9 @@ type UpdateStrategy struct { // ServerSideApply type means to update resource using server side apply with work-controller as the field manager. // If there is conflict, the related Applied condition of manifest will be in the status of False with the // reason of ApplyConflict. + // ReadOnly type means the agent will only check the existence of the resource based on its metadata. // +kubebuilder:default=Update - // +kubebuilder:validation:Enum=Update;CreateOnly;ServerSideApply + // +kubebuilder:validation:Enum=Update;CreateOnly;ServerSideApply;ReadOnly // +kubebuilder:validation:Required // +required Type UpdateStrategyType `json:"type,omitempty"` @@ -177,18 +178,23 @@ type UpdateStrategy struct { type UpdateStrategyType string const ( - // Update type means to update resource by an update call. + // UpdateStrategyTypeUpdate means to update resource by an update call. UpdateStrategyTypeUpdate UpdateStrategyType = "Update" - // CreateOnly type means do not update resource based on current manifest. This should be used only when + // UpdateStrategyTypeCreateOnly means do not update resource based on current manifest. This should be used only when // ServerSideApply type is not support on the spoke, and the user on hub would like some other controller // on the spoke to own the control of the resource. UpdateStrategyTypeCreateOnly UpdateStrategyType = "CreateOnly" - // ServerSideApply type means to update resource using server side apply with work-controller as the field manager. + // UpdateStrategyTypeServerSideApply means to update resource using server side apply with work-controller as the field manager. // If there is conflict, the related Applied condition of manifest will be in the status of False with the // reason of ApplyConflict. This type allows another controller on the spoke to control certain field of the resource. UpdateStrategyTypeServerSideApply UpdateStrategyType = "ServerSideApply" + + // UpdateStrategyTypeReadOnly type means only check the existence of the resource based on the resource's metadata. + // If the statusFeedBackRules are set, the feedbackResult will also be returned. + // The resource will not be removed when the type is ReadOnly, and only resource metadata is required. + UpdateStrategyTypeReadOnly UpdateStrategyType = "ReadOnly" ) type ServerSideApplyConfig struct { diff --git a/work/v1/zz_generated.swagger_doc_generated.go b/work/v1/zz_generated.swagger_doc_generated.go index 8689d32f8..000dc7f22 100644 --- a/work/v1/zz_generated.swagger_doc_generated.go +++ b/work/v1/zz_generated.swagger_doc_generated.go @@ -287,7 +287,7 @@ func (StatusFeedbackResult) SwaggerDoc() map[string]string { var map_UpdateStrategy = map[string]string{ "": "UpdateStrategy defines the strategy to update this manifest", - "type": "type defines the strategy to update this manifest, default value is Update. Update type means to update resource by an update call. CreateOnly type means do not update resource based on current manifest. ServerSideApply type means to update resource using server side apply with work-controller as the field manager. If there is conflict, the related Applied condition of manifest will be in the status of False with the reason of ApplyConflict.", + "type": "type defines the strategy to update this manifest, default value is Update. Update type means to update resource by an update call. CreateOnly type means do not update resource based on current manifest. ServerSideApply type means to update resource using server side apply with work-controller as the field manager. If there is conflict, the related Applied condition of manifest will be in the status of False with the reason of ApplyConflict. ReadOnly type means the agent will only check the existence of the resource based on its metadata.", "serverSideApply": "serverSideApply defines the configuration for server side apply. It is honored only when type of updateStrategy is ServerSideApply", } diff --git a/work/v1alpha1/0000_00_work.open-cluster-management.io_manifestworkreplicasets.crd.yaml b/work/v1alpha1/0000_00_work.open-cluster-management.io_manifestworkreplicasets.crd.yaml index f0d86d922..2e4f54966 100644 --- a/work/v1alpha1/0000_00_work.open-cluster-management.io_manifestworkreplicasets.crd.yaml +++ b/work/v1alpha1/0000_00_work.open-cluster-management.io_manifestworkreplicasets.crd.yaml @@ -284,11 +284,14 @@ spec: server side apply with work-controller as the field manager. If there is conflict, the related Applied condition of manifest will be in the status of False - with the reason of ApplyConflict. + with the reason of ApplyConflict. ReadOnly type means + the agent will only check the existence of the resource + based on its metadata. enum: - Update - CreateOnly - ServerSideApply + - ReadOnly type: string required: - type