Skip to content

Commit

Permalink
Merge pull request #526 from gianlucam76/include-crds
Browse files Browse the repository at this point in the history
Helm client options
  • Loading branch information
gianlucam76 authored May 6, 2024
2 parents bd7056f + 8d601a7 commit 6251bae
Show file tree
Hide file tree
Showing 11 changed files with 1,048 additions and 82 deletions.
98 changes: 91 additions & 7 deletions api/v1alpha1/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,6 @@ type HelmOptions struct {
// +optional
SkipCRDs bool `json:"skipCRDs,omitempty"`

// Create the release namespace if not present. Defaults to true
// +kubebuilder:default:=true
// +optional
CreateNamespace bool `json:"createNamespace,omitempty"`

// if set, will wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment, StatefulSet, or ReplicaSet
// are in a ready state before marking the release as successful. It will wait for as long as --timeout
// Default to false
Expand All @@ -178,7 +173,7 @@ type HelmOptions struct {
// +optional
Timeout *metav1.Duration `json:"timeout,omitempty"`

// prevent hooks from running during install
// prevent hooks from running during install/upgrade/uninstall
// Default to false
// +kubebuilder:default:=false
// +optional
Expand All @@ -190,7 +185,7 @@ type HelmOptions struct {
// +optional
DisableOpenAPIValidation bool `json:"disableOpenAPIValidation,omitempty"`

// if set, the installation process deletes the installation on failure.
// if set, the installation process deletes the installation/upgrades on failure.
// The --wait flag will be set automatically if --atomic is used
// Default to false
// +kubebuilder:default:=false
Expand All @@ -211,6 +206,95 @@ type HelmOptions struct {
// +kubebuilder:default=false
// +optional
EnableClientCache bool `json:"enableClientCache,omitempty"`

// Description is the description of an helm operation
// +optional
Description string `json:"description,omitempty"`

// HelmInstallOptions are options specific to helm install
// +optional
InstallOptions HelmInstallOptions `json:"installOptions,omitempty"`

// HelmUpgradeOptions are options specific to helm upgrade
// +optional
UpgradeOptions HelmUpgradeOptions `json:"upgradeOptions,omitempty"`

// HelmUninstallOptions are options specific to helm uninstall
// +optional
UninstallOptions HelmUninstallOptions `json:"uninstallOptions,omitempty"`
}

type HelmInstallOptions struct {
// Create the release namespace if not present. Defaults to true
// +kubebuilder:default:=true
// +optional
CreateNamespace bool `json:"createNamespace,omitempty"`

// Replaces if set indicates to replace an older release with this one
// +kubebuilder:default:=true
// +optional
Replace bool `json:"replace,omitempty"`
}

type HelmUpgradeOptions struct {
// Force will, if set to `true`, ignore certain warnings and perform the upgrade anyway.
// This should be used with caution.
// +kubebuilder:default:=false
// +optional
Force bool `json:"force,omitempty"`

// ResetValues will reset the values to the chart's built-ins rather than merging with existing.
// +kubebuilder:default:=false
// +optional
ResetValues bool `json:"resetValues,omitempty"`

// ReuseValues copies values from the current release to a new release if the
// new release does not have any values. If the request already has values,
// or if there are no values in the current release, this does nothing.
// This is skipped if the ResetValues flag is set, in which case the
// request values are not altered.
// +kubebuilder:default:=false
// +optional
ReuseValues bool `json:"reuseValues,omitempty"`

// ResetThenReuseValues will reset the values to the chart's built-ins then merge with user's last supplied values.
// +kubebuilder:default:=false
// +optional
ResetThenReuseValues bool `json:"resetThenReuseValues,omitempty"`

// Recreate will (if true) recreate pods after a rollback.
// +kubebuilder:default:=false
// +optional
Recreate bool `json:"recreate,omitempty"`

// MaxHistory limits the maximum number of revisions saved per release
// Default to 2
// +kubebuilder:default=2
// +optional
MaxHistory int `json:"maxHistory,omitempty"`

// CleanupOnFail will, if true, cause the upgrade to delete newly-created resources on a failed update.
// +kubebuilder:default:=false
// +optional
CleanupOnFail bool `json:"cleanupOnFail,omitempty"`

// SubNotes determines whether sub-notes are rendered in the chart.
// +kubebuilder:default:=false
// +optional
SubNotes bool `json:"subNotes,omitempty"`
}

type HelmUninstallOptions struct {
// When uninstall a chart with this flag, Helm removes the resources associated with the chart,
// but it keeps the release information. This allows to see details about the uninstalled release
// using the helm history command.
// +optional
KeepHistory bool `json:"keepHistory,omitempty"`

// DeletionPropagation
// +kubebuilder:validation:Enum:=orphan;foreground;background
// +optional
DeletionPropagation string `json:"deletionPropagation,omitempty"`
}

type HelmChart struct {
Expand Down
48 changes: 48 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

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

98 changes: 91 additions & 7 deletions config/crd/bases/config.projectsveltos.io_clusterprofiles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,25 +160,23 @@ spec:
atomic:
default: false
description: |-
if set, the installation process deletes the installation on failure.
if set, the installation process deletes the installation/upgrades on failure.
The --wait flag will be set automatically if --atomic is used
Default to false
type: boolean
createNamespace:
default: true
description: Create the release namespace if not present.
Defaults to true
type: boolean
dependencyUpdate:
default: false
description: |-
update dependencies if they are missing before installing the chart
Default to false
type: boolean
description:
description: Description is the description of an helm operation
type: string
disableHooks:
default: false
description: |-
prevent hooks from running during install
prevent hooks from running during install/upgrade/uninstall
Default to false
type: boolean
disableOpenAPIValidation:
Expand All @@ -193,6 +191,21 @@ spec:
client cache. If it is not specified, it will be set to
false.
type: boolean
installOptions:
description: HelmInstallOptions are options specific to
helm install
properties:
createNamespace:
default: true
description: Create the release namespace if not present.
Defaults to true
type: boolean
replace:
default: true
description: Replaces if set indicates to replace an
older release with this one
type: boolean
type: object
labels:
additionalProperties:
type: string
Expand All @@ -208,6 +221,77 @@ spec:
description: time to wait for any individual Kubernetes
operation (like Jobs for hooks) (default 5m0s)
type: string
uninstallOptions:
description: HelmUninstallOptions are options specific to
helm uninstall
properties:
deletionPropagation:
description: DeletionPropagation
enum:
- orphan
- foreground
- background
type: string
keepHistory:
description: |-
When uninstall a chart with this flag, Helm removes the resources associated with the chart,
but it keeps the release information. This allows to see details about the uninstalled release
using the helm history command.
type: boolean
type: object
upgradeOptions:
description: HelmUpgradeOptions are options specific to
helm upgrade
properties:
cleanupOnFail:
default: false
description: CleanupOnFail will, if true, cause the
upgrade to delete newly-created resources on a failed
update.
type: boolean
force:
default: false
description: |-
Force will, if set to `true`, ignore certain warnings and perform the upgrade anyway.
This should be used with caution.
type: boolean
maxHistory:
default: 2
description: |-
MaxHistory limits the maximum number of revisions saved per release
Default to 2
type: integer
recreate:
default: false
description: Recreate will (if true) recreate pods after
a rollback.
type: boolean
resetThenReuseValues:
default: false
description: ResetThenReuseValues will reset the values
to the chart's built-ins then merge with user's last
supplied values.
type: boolean
resetValues:
default: false
description: ResetValues will reset the values to the
chart's built-ins rather than merging with existing.
type: boolean
reuseValues:
default: false
description: |-
ReuseValues copies values from the current release to a new release if the
new release does not have any values. If the request already has values,
or if there are no values in the current release, this does nothing.
This is skipped if the ResetValues flag is set, in which case the
request values are not altered.
type: boolean
subNotes:
default: false
description: SubNotes determines whether sub-notes are
rendered in the chart.
type: boolean
type: object
wait:
default: false
description: |-
Expand Down
Loading

0 comments on commit 6251bae

Please sign in to comment.