Skip to content

Commit

Permalink
fix: chart upgrade on chart version change
Browse files Browse the repository at this point in the history
  • Loading branch information
matteogastaldello committed Sep 26, 2024
1 parent 46f7467 commit 4b2d7df
Show file tree
Hide file tree
Showing 6 changed files with 330 additions and 61 deletions.
24 changes: 24 additions & 0 deletions apis/compositiondefinitions/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,26 @@ type ChartInfo struct {
Credentials *Credentials `json:"credentials,omitempty"`
}

type ChartInfoProps struct {
// Url: oci or tgz full url
Url string `json:"url"`
// Version: desired chart version, needed for oci charts and for helm repo urls
// +kubebuilder:validation:Optional
// +kubebuilder:validation:MaxLength=20
Version string `json:"version,omitempty"`
// Repo: helm repo name (for helm repo urls only)
// +kubebuilder:validation:Optional
// +kubebuilder:validation:MaxLength=256
Repo string `json:"repo,omitempty"`

// InsecureSkipVerifyTLS: skip tls verification
// +optional
InsecureSkipVerifyTLS bool `json:"insecureSkipVerifyTLS,omitempty"`

// Credentials: credentials for private repos
// +optional
Credentials *Credentials `json:"credentials,omitempty"`
}
type CompositionDefinitionSpec struct {
// rtv1.ManagedSpec `json:",inline"`
Chart *ChartInfo `json:"chart,omitempty"`
Expand All @@ -70,6 +90,10 @@ type VersionDetail struct {
// Stored: whether the version is stored
// +optional
Stored bool `json:"stored"`

// Chart: the chart information
// +optional
Chart *ChartInfoProps `json:"chart"`
}

type Managed struct {
Expand Down
29 changes: 28 additions & 1 deletion apis/compositiondefinitions/v1alpha1/zz_generated.deepcopy.go

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

50 changes: 50 additions & 0 deletions crds/core.krateo.io_compositiondefinitions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,56 @@ spec:
description: 'VersionInfo: the version information of the chart'
items:
properties:
chart:
description: 'Chart: the chart information'
properties:
credentials:
description: 'Credentials: credentials for private repos'
properties:
passwordRef:
description: 'PasswordRef: reference to secret containing
password for private repo'
properties:
key:
description: The key to select.
type: string
name:
description: Name of the referenced object.
type: string
namespace:
description: Namespace of the referenced object.
type: string
required:
- key
- name
- namespace
type: object
username:
description: 'Username: username for private repo'
type: string
required:
- passwordRef
- username
type: object
insecureSkipVerifyTLS:
description: 'InsecureSkipVerifyTLS: skip tls verification'
type: boolean
repo:
description: 'Repo: helm repo name (for helm repo urls
only)'
maxLength: 256
type: string
url:
description: 'Url: oci or tgz full url'
type: string
version:
description: 'Version: desired chart version, needed
for oci charts and for helm repo urls'
maxLength: 20
type: string
required:
- url
type: object
served:
description: 'Served: whether the version is served'
type: boolean
Expand Down
Loading

0 comments on commit 4b2d7df

Please sign in to comment.