Skip to content

Commit

Permalink
feat: Add AssociatedResources field to Manifest Spec (#1656)
Browse files Browse the repository at this point in the history
* Add managedResources to ManifestSpec

* Add managedResources to ManifestSpec

* Fix docs deadlink

* Adjust docs

* Code review comments

* TWS review

* Renaming ManagedResources to AssociatedResources

* Update manifest-cr.md

Co-authored-by: Małgorzata Świeca <malgorzata.swieca@sap.com>

* Update manifest-cr.md

Co-authored-by: Małgorzata Świeca <malgorzata.swieca@sap.com>

* Update manifest_types.go

Co-authored-by: Małgorzata Świeca <malgorzata.swieca@sap.com>

---------

Co-authored-by: Małgorzata Świeca <malgorzata.swieca@sap.com>
  • Loading branch information
nesmabadr and mmitoraj authored Jul 8, 2024
1 parent b47b191 commit 2e620d7
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
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 Lifecycle Manager. The resources have the following format: <group>/<version>/<kind>.
// +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 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 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 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

0 comments on commit 2e620d7

Please sign in to comment.