Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add AssociatedResources field to Manifest Spec #1656

5 changes: 5 additions & 0 deletions api/v1beta2/manifest_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 the lifecycle manager. The resources have the following format: <group>/<version>/<kind>.
nesmabadr marked this conversation as resolved.
Show resolved Hide resolved
// +optional
AssociatedResources []string `json:"associatedResources,omitempty"`
}

// ImageSpec defines OCI Image specifications.
Expand Down
5 changes: 5 additions & 0 deletions api/v1beta2/zz_generated.deepcopy.go

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

14 changes: 14 additions & 0 deletions config/crd/bases/operator.kyma-project.io_manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 the lifecycle manager. The resources have the following format: <group>/<version>/<kind>.
nesmabadr marked this conversation as resolved.
Show resolved Hide resolved
items:
type: string
type: array
config:
description: Config specifies OCI image configuration for Manifest
properties:
Expand Down Expand Up @@ -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 the lifecycle manager. The resources have the following format: <group>/<version>/<kind>.
items:
type: string
type: array
config:
description: Config specifies OCI image configuration for Manifest
properties:
Expand Down
11 changes: 11 additions & 0 deletions docs/technical-reference/api/manifest-cr.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading