diff --git a/api/v1beta2/manifest_types.go b/api/v1beta2/manifest_types.go index ac52970a71..e8fd1e6e31 100644 --- a/api/v1beta2/manifest_types.go +++ b/api/v1beta2/manifest_types.go @@ -62,6 +62,11 @@ type ManifestSpec struct { // +nullable // Resource specifies a resource to be watched for state updates Resource *unstructured.Unstructured `json:"resource,omitempty"` + + // AssociatedResources specifies a list of resources which are not managed + // by Lifecycle Manager. The resources have the following format: //. + // +optional + AssociatedResources []string `json:"associatedResources,omitempty"` } // ImageSpec defines OCI Image specifications. diff --git a/api/v1beta2/zz_generated.deepcopy.go b/api/v1beta2/zz_generated.deepcopy.go index c7376ac24d..74f9f5ade7 100644 --- a/api/v1beta2/zz_generated.deepcopy.go +++ b/api/v1beta2/zz_generated.deepcopy.go @@ -289,6 +289,11 @@ func (in *ManifestSpec) DeepCopyInto(out *ManifestSpec) { in, out := &in.Resource, &out.Resource *out = (*in).DeepCopy() } + if in.AssociatedResources != nil { + in, out := &in.AssociatedResources, &out.AssociatedResources + *out = make([]string, len(*in)) + copy(*out, *in) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManifestSpec. diff --git a/config/crd/bases/operator.kyma-project.io_manifests.yaml b/config/crd/bases/operator.kyma-project.io_manifests.yaml index 35d03a9db8..146c8df820 100644 --- a/config/crd/bases/operator.kyma-project.io_manifests.yaml +++ b/config/crd/bases/operator.kyma-project.io_manifests.yaml @@ -49,6 +49,13 @@ spec: spec: description: ManifestSpec defines the desired state of Manifest. properties: + associatedResources: + description: |- + AssociatedResources specifies a list of resources which are not managed + by Lifecycle Manager. The resources have the following format: //. + items: + type: string + type: array config: description: Config specifies OCI image configuration for Manifest properties: @@ -319,6 +326,13 @@ spec: spec: description: ManifestSpec defines the desired state of Manifest. properties: + associatedResources: + description: |- + AssociatedResources specifies a list of resources which are not managed + by Lifecycle Manager. The resources have the following format: //. + items: + type: string + type: array config: description: Config specifies OCI image configuration for Manifest properties: diff --git a/docs/technical-reference/api/manifest-cr.md b/docs/technical-reference/api/manifest-cr.md index e6ee00ef8c..73a6c388a4 100644 --- a/docs/technical-reference/api/manifest-cr.md +++ b/docs/technical-reference/api/manifest-cr.md @@ -85,6 +85,17 @@ The [internal spec resolver](../../../internal/manifest/spec_resolver.go) uses t The resource is the default data that should be initialized for the module and is directly copied from **.spec.data** of the ModuleTemplate CR after normalizing it with the **namespace** for the synchronized module. +### **.spec.associatedResources** + +Associated resources are resources that are not managed by Lifecycle Manager. They are represented by the `group/version/kind` format. +Suppose the module is managed and gets deleted from the Kyma CR. In that case, the module deletion is suspended until all custom resources with GVK listed in the **spec.associatedResources** are removed manually by the user. +```yaml +spec: + associatedResources: + - serverless.kyma-project.io/v1alpha2/functions + - operator.kyma-project.io/v1alpha1/serverlesses +``` + ### **.status** The Manifest CR status is set based on the following logic, managed by the manifest reconciler: