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"`

// ManagedResources specifies a list of resources which are managed
// manually by the user. The resources have the following format: <group>/<version>/<kind>.
// +optional
ManagedResources []string `json:"managedResources,omitempty"`
nesmabadr marked this conversation as resolved.
Show resolved Hide resolved
}

// 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 @@ -136,6 +136,13 @@ spec:
- name
- source
type: object
managedResources:
description: |-
ManagedResources specifies a list of resources which are managed
manually by the user. The resources have the following format: <group>/<version>/<kind>.
items:
type: string
type: array
remote:
description: Remote indicates if Manifest should be installed on a
remote cluster
Expand Down Expand Up @@ -406,6 +413,13 @@ spec:
- name
- source
type: object
managedResources:
description: |-
ManagedResources specifies a list of resources which are managed
manually by the user. The resources have the following format: <group>/<version>/<kind>.
items:
type: string
type: array
remote:
description: Remote indicates if Manifest should be installed on a
remote cluster
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.managedResources**

The managed resources are the resources that are handled manually by the user. 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.managedResources** are removed manually by the user.
nesmabadr marked this conversation as resolved.
Show resolved Hide resolved
```yaml
spec:
managedResources:
- 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