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 spec.manager #1958

Merged
merged 11 commits into from
Oct 16, 2024
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"`
c-pius marked this conversation as resolved.
Show resolved Hide resolved

// 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 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. If the resource is not namespaced, such as the module CR's `CRD`, the namespace can be optional.
ruanxin marked this conversation as resolved.
Show resolved Hide resolved

For example, if the module has a manager `Deployment` in the `kyma-system` namespace:
ruanxin marked this conversation as resolved.
Show resolved Hide resolved

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

For a module without a manager, such as [cloud manager](https://github.com/kyma-project/cloud-manager):
ruanxin marked this conversation as resolved.
Show resolved Hide resolved

```yaml
spec:
manager:
group: apiextensions.k8s.io
version: v1
kind: CustomResourceDefinition
name: [module CRD name]
```
c-pius marked this conversation as resolved.
Show resolved Hide resolved
### **.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
Loading