Skip to content
Open
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
4 changes: 4 additions & 0 deletions api/v1alpha1/helmchartproxy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ type HelmOptions struct {
// +kubebuilder:default=false
// +optional
EnableClientCache bool `json:"enableClientCache,omitempty"`

// TakeOwnership represents CLI --take-ownership flag passed to Helm upgrade or install operation. If set, install will ignore the check for helm annotations and take ownership of the existing resources
// +optional
TakeOwnership bool `json:"takeOwnership,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to this flag should be tested with e2e tests, as it's related to helm behavior.

The test may look like this: before starting the test, in the namespace where the chart will be installed, you need to create one or more objects from this chart (but without helm specific labels and annotations). Then install the HelmChartProxy and check that it is successfully installed and now helm chart owns these objects.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, will do that soon, alright

}

type HelmInstallOptions struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,12 @@ spec:
By default, CRDs are installed if not already present.
If set, no CRDs will be installed.
type: boolean
takeOwnership:
description: TakeOwnership represents CLI --take-ownership flag
passed to Helm upgrade or install operation. If set, install
will ignore the check for helm annotations and take ownership
of the existing resources
type: boolean
timeout:
description: |-
Timeout is the time to wait for any individual Kubernetes operation (like
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,12 @@ spec:
By default, CRDs are installed if not already present.
If set, no CRDs will be installed.
type: boolean
takeOwnership:
description: TakeOwnership represents CLI --take-ownership flag
passed to Helm upgrade or install operation. If set, install
will ignore the check for helm annotations and take ownership
of the existing resources
type: boolean
timeout:
description: |-
Timeout is the time to wait for any individual Kubernetes operation (like
Expand Down
2 changes: 2 additions & 0 deletions internal/helm_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ func generateHelmInstallConfig(actionConfig *helmAction.Configuration, helmOptio
installClient.Atomic = helmOptions.Atomic
installClient.IncludeCRDs = helmOptions.Install.IncludeCRDs
installClient.CreateNamespace = helmOptions.Install.CreateNamespace
installClient.TakeOwnership = helmOptions.TakeOwnership

return installClient
}
Expand Down Expand Up @@ -169,6 +170,7 @@ func generateHelmUpgradeConfig(actionConfig *helmAction.Configuration, helmOptio
upgradeClient.ResetThenReuseValues = helmOptions.Upgrade.ResetThenReuseValues
upgradeClient.MaxHistory = helmOptions.Upgrade.MaxHistory
upgradeClient.CleanupOnFail = helmOptions.Upgrade.CleanupOnFail
upgradeClient.TakeOwnership = helmOptions.TakeOwnership

return upgradeClient
}
Expand Down
Loading