Skip to content

Commit

Permalink
feat: Add spec.manager (#1958)
Browse files Browse the repository at this point in the history
* add spec.manager
---------

Co-authored-by: Christoph Schwägerl <[email protected]>
Co-authored-by: Małgorzata Świeca <[email protected]>
  • Loading branch information
3 people authored Oct 16, 2024
1 parent 9491cf4 commit 5eddd74
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 2 deletions.
1 change: 1 addition & 0 deletions api-version-compatibility-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ operator.kyma-project.io_moduletemplates.yaml:
- .spec.properties.customStateCheck.description
- .spec.properties.resources
- .spec.properties.info
- .spec.properties.manager
- .spec.properties.associatedResources
18 changes: 17 additions & 1 deletion api/v1beta2/moduletemplate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,27 @@ type ModuleTemplateSpec struct {

// Info contains metadata about the module.
// +optional
Info ModuleInfo `json:"info,omitempty"`
Info *ModuleInfo `json:"info,omitempty"`

// AssociatedResources is a list of module related resources that usually must be cleaned when uninstalling a module. Informational purpose only.
// +optional
AssociatedResources []apimetav1.GroupVersionKind `json:"associatedResources,omitempty"`

// Manager contains information for identifying a module's resource that can be used as indicator for the installation readiness of the module. Typically, this is the manager Deployment of the module. In exceptional cases, it may also be another resource.
// +optional
Manager *Manager `json:"manager,omitempty"`
}

// Manager defines the structure for the manager field in ModuleTemplateSpec.
type Manager struct {
apimetav1.GroupVersionKind `json:",inline"`

// Namespace is the namespace of the manager. It is optional.
// +optional
Namespace string `json:"namespace,omitempty"`

// Name is the name of the manager.
Name string `json:"name"`
}

type ModuleInfo struct {
Expand Down
27 changes: 26 additions & 1 deletion api/v1beta2/zz_generated.deepcopy.go

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

25 changes: 25 additions & 0 deletions config/crd/bases/operator.kyma-project.io_moduletemplates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,31 @@ spec:
- documentation
- repository
type: object
manager:
description: Manager contains information for identifying a module's
resource that can be used as indicator for the installation readiness
of the module. Typically, this is the manager Deployment of the
module. In exceptional cases, it may also be another resource.
properties:
group:
type: string
kind:
type: string
name:
description: Name is the name of the manager.
type: string
namespace:
description: Namespace is the namespace of the manager. It is
optional.
type: string
version:
type: string
required:
- group
- kind
- name
- version
type: object
mandatory:
description: |-
Mandatory indicates whether the module is mandatory. It is used to enforce the installation of the module with
Expand Down
26 changes: 26 additions & 0 deletions docs/contributor/resources/03-moduletemplate.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,32 @@ spec:
- documentation: The link to the documentation of the module.
- icons: A list of icons of the module, each with a name and link.

### **.spec.manager**

The `manager` field provides information for identifying a module's resource that can indicate the module's installation readiness. Typically, the manager is the module's `Deployment` resource. In exceptional cases, it may also be another resource. The **namespace** parameter is optional if the resource is not namespaced. For example, if the resource is the module CR's `CustomResourceDefinition`.

In this example, the module's manager is the `Deployment` resource in the `kyma-system` namespace.

```yaml
spec:
manager:
group: apps
version: v1
kind: Deployment
namespace: kyma-system
name: [module manager name]
```

In this example, the module's manager is the module's `CustomResourceDefinition` that does not require the **namespace** parameter.

```yaml
spec:
manager:
group: apiextensions.k8s.io
version: v1
kind: CustomResourceDefinition
name: [module CRD name]
```
### **.spec.customStateCheck**

> **CAUTION:** This field was deprecated at the end of July 2024 and will be deleted in the next ModuleTemplate API version. As of the deletion day, you can define the custom state only in a module's custom resource.
Expand Down

0 comments on commit 5eddd74

Please sign in to comment.