Skip to content

Commit

Permalink
feat: Add Resources as optional to ModuleTempalte
Browse files Browse the repository at this point in the history
  • Loading branch information
c-pius committed Oct 1, 2024
1 parent 5dd0414 commit 28f1275
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
14 changes: 14 additions & 0 deletions api/v1beta2/moduletemplate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ type ModuleTemplateSpec struct {

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

// Resources is a list of additional resources of the module that can be fetched, e.g., the raw manifest.
// +optional
// +listType=map
// +listMapKey=name
Resources []Resource `json:"resources,omitempty"`
}

type CustomStateCheck struct {
Expand All @@ -148,6 +154,14 @@ type ModuleTemplateList struct {
Items []ModuleTemplate `json:"items"`
}

type Resource struct {
// Name is the name of the resource.
Name string `json:"name"`
// Link is the URL to the resource.
// +kubebuilder:validation:Format=uri
Link string `json:"link"`
}

//nolint:gochecknoinits // registers ModuleTemplate CRD on startup
func init() {
SchemeBuilder.Register(&ModuleTemplate{}, &ModuleTemplateList{}, &Descriptor{})
Expand Down
20 changes: 20 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.

20 changes: 20 additions & 0 deletions config/crd/bases/operator.kyma-project.io_moduletemplates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,26 @@ spec:
maxLength: 64
pattern: ^([a-z]{3,}(-[a-z]{3,})*)?$
type: string
resources:
description: Resources is a list of additional resources of the module
that can be fetched, e.g., the raw manifest.
items:
properties:
link:
description: Link is the URL to the resource.
format: uri
type: string
name:
description: Name is the name of the resource.
type: string
required:
- link
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
version:
description: Version identifies the version of the Module. Can be
empty, or a semantic version.
Expand Down

0 comments on commit 28f1275

Please sign in to comment.