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 ModuleInfo as optional to ModuleTemplate #1906

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api-version-compatibility-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ operator.kyma-project.io_moduletemplates.yaml:
- .spec.properties.version
- .spec.properties.moduleName
- .spec.properties.customStateCheck.description
- .spec.properties.info
26 changes: 26 additions & 0 deletions api/v1beta2/moduletemplate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,32 @@ type ModuleTemplateSpec struct {

// CustomStateCheck is deprecated.
CustomStateCheck []*CustomStateCheck `json:"customStateCheck,omitempty"`

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

type ModuleInfo struct {
// Repository is the link to the repository of the module.
Repository string `json:"repository"`

// Documentation is the link to the documentation of the module.
Documentation string `json:"documentation"`

// Icons is a list of icons of the module.
// +optional
c-pius marked this conversation as resolved.
Show resolved Hide resolved
// +listType=map
// +listMapKey=name
Icons []ModuleIcon `json:"icons,omitempty"`
}

type ModuleIcon struct {
// Name is the name of the icon.
Name string `json:"name"`

// Link is the link to the icon.
Link string `json:"link"`
}

type CustomStateCheck struct {
Expand Down
36 changes: 36 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.

32 changes: 32 additions & 0 deletions config/crd/bases/operator.kyma-project.io_moduletemplates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,38 @@ spec:
charts and kustomize renderers are deprecated and ignored.
type: object
x-kubernetes-preserve-unknown-fields: true
info:
description: Info contains metadata about the module.
properties:
documentation:
description: Documentation is the link to the documentation of
the module.
type: string
icons:
description: Icons is a list of icons of the module.
items:
properties:
link:
description: Link is the link to the icon.
type: string
name:
description: Name is the name of the icon.
type: string
required:
- link
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
repository:
description: Repository is the link to the repository of the module.
type: string
required:
- documentation
- repository
type: object
mandatory:
description: |-
Mandatory indicates whether the module is mandatory. It is used to enforce the installation of the module with
Expand Down
18 changes: 18 additions & 0 deletions docs/contributor/resources/03-moduletemplate.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,24 @@ spec:

If not specified, the **namespace** of the resource mentioned in **.spec.data** will be controlled by the `sync-namespace` flag; otherwise, it will be respected. All other attributes (including **.metadata.name**, **apiVersion**, and **kind**) are taken over as stated. Note that since it behaves similarly to a `template`, any subresources, such as **status**, are ignored, even if specified in the field.

### **.spec.info**

The **info** field contains module metadata, including the repository URL, documentation link, and icons. For example:

```
spec:
info:
repository: https://github.com/example/repo
documentation: https://docs.example.com
icons:
- name: example-icon
link: https://example.com/icon.png
```

- repository: The link to the repository of the module.
- documentation: The link to the documentation of the module.
- icons: A list of icons of the module, each with a name and link.

### **.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