Skip to content

Commit 3cc6c65

Browse files
authored
feat: support skip-schema-validation helm option (run-int-tests) (#1519)
1 parent d323ae8 commit 3cc6c65

File tree

8 files changed

+38
-19
lines changed

8 files changed

+38
-19
lines changed

apis/deployer/helm/types_provider.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,9 @@ type HelmDeploymentConfiguration struct {
152152

153153
// HelmInstallConfiguration defines settings for a helm install operation.
154154
type HelmInstallConfiguration struct {
155-
Atomic bool `json:"atomic,omitempty"`
156-
Force bool `json:"force,omitempty"`
155+
Atomic bool `json:"atomic,omitempty"`
156+
Force bool `json:"force,omitempty"`
157+
SkipSchemaValidation bool `json:"skipSchemaValidation,omitempty"`
157158

158159
// Timeout is the timeout for the operation in minutes.
159160
// +optional

apis/deployer/helm/v1alpha1/types_provider.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,9 @@ type HelmDeploymentConfiguration struct {
157157

158158
// HelmInstallConfiguration defines settings for a helm install operation.
159159
type HelmInstallConfiguration struct {
160-
Atomic bool `json:"atomic,omitempty"`
161-
Force bool `json:"force,omitempty"`
160+
Atomic bool `json:"atomic,omitempty"`
161+
Force bool `json:"force,omitempty"`
162+
SkipSchemaValidation bool `json:"skipSchemaValidation,omitempty"`
162163

163164
// Timeout is the timeout for the operation in minutes.
164165
// +optional

apis/deployer/helm/v1alpha1/validation/validation.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ import (
1818
)
1919

2020
const (
21-
helmArgumentAtomic = "atomic"
22-
helmArgumentForce = "force"
23-
helmArgumentTimeout = "timeout"
21+
helmArgumentAtomic = "atomic"
22+
helmArgumentForce = "force"
23+
helmArgumentTimeout = "timeout"
24+
helmArgumentSkipSchemaValidation = "skipSchemaValidation"
2425
)
2526

2627
// ValidateProviderConfiguration validates a helm deployer configuration
@@ -106,11 +107,11 @@ func ValidateHelmDeploymentConfiguration(fldPath *field.Path, deployConfig *helm
106107
}
107108

108109
func ValidateInstallConfiguration(fldPath *field.Path, conf map[string]lsv1alpha1.AnyJSON) field.ErrorList {
109-
return validateHelmArguments(fldPath, conf, []string{helmArgumentAtomic, helmArgumentTimeout, helmArgumentForce})
110+
return validateHelmArguments(fldPath, conf, []string{helmArgumentAtomic, helmArgumentTimeout, helmArgumentForce, helmArgumentSkipSchemaValidation})
110111
}
111112

112113
func ValidateUpgradeConfiguration(fldPath *field.Path, conf map[string]lsv1alpha1.AnyJSON) field.ErrorList {
113-
return validateHelmArguments(fldPath, conf, []string{helmArgumentAtomic, helmArgumentTimeout, helmArgumentForce})
114+
return validateHelmArguments(fldPath, conf, []string{helmArgumentAtomic, helmArgumentTimeout, helmArgumentForce, helmArgumentSkipSchemaValidation})
114115
}
115116

116117
func ValidateUninstallConfiguration(fldPath *field.Path, conf map[string]lsv1alpha1.AnyJSON) field.ErrorList {

apis/deployer/helm/v1alpha1/zz_generated.conversion.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apis/openapi/zz_generated.openapi.go

Lines changed: 12 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/deployer/helm.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,11 @@ spec:
5757
install: # see https://helm.sh/docs/helm/helm_install/#options
5858
atomic: true
5959
force: true
60+
skipSchemaValidation: true
6061
upgrade: # see https://helm.sh/docs/helm/helm_upgrade/#options
6162
atomic: true
6263
force: true
64+
skipSchemaValidation: true
6365
uninstall: {} # see https://helm.sh/docs/helm/helm_uninstall/#options
6466

6567
updateStrategy: update | patch # optional; defaults to update

pkg/deployer/helm/realhelmdeployer/deploy_config.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ const (
1919

2020
// installConfiguration defines settings for a helm install operation.
2121
type installConfiguration struct {
22-
Atomic bool `json:"atomic,omitempty"`
23-
Force bool `json:"force,omitempty"`
24-
Timeout *lsv1alpha1.Duration `json:"timeout,omitempty"`
22+
Atomic bool `json:"atomic,omitempty"`
23+
Force bool `json:"force,omitempty"`
24+
SkipSchemaValidation bool `json:"skipSchemaValidation,omitempty"`
25+
Timeout *lsv1alpha1.Duration `json:"timeout,omitempty"`
2526
}
2627

2728
func newInstallConfiguration(conf *helmv1alpha1.HelmDeploymentConfiguration) (*installConfiguration, error) {
@@ -50,9 +51,10 @@ func newInstallConfiguration(conf *helmv1alpha1.HelmDeploymentConfiguration) (*i
5051

5152
// upgradeConfiguration defines settings for a helm upgrade operation.
5253
type upgradeConfiguration struct {
53-
Atomic bool `json:"atomic,omitempty"`
54-
Force bool `json:"force,omitempty"`
55-
Timeout *lsv1alpha1.Duration `json:"timeout,omitempty"`
54+
Atomic bool `json:"atomic,omitempty"`
55+
Force bool `json:"force,omitempty"`
56+
SkipSchemaValidation bool `json:"skipSchemaValidation,omitempty"`
57+
Timeout *lsv1alpha1.Duration `json:"timeout,omitempty"`
5658
}
5759

5860
func newUpgradeConfiguration(conf *helmv1alpha1.HelmDeploymentConfiguration) (*upgradeConfiguration, error) {

pkg/deployer/helm/realhelmdeployer/real_helm_deployer.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ func (c *RealHelmDeployer) installRelease(ctx context.Context, values map[string
166166
install.CreateNamespace = c.createNamespace
167167
install.Atomic = installConfig.Atomic
168168
install.Force = installConfig.Force
169+
install.SkipSchemaValidation = installConfig.SkipSchemaValidation
169170

170171
timeout, err := timeout.TimeoutExceeded(ctx, c.di, TimeoutCheckpointHelmBeforeInstallingRelease)
171172
if err != nil {
@@ -219,6 +220,7 @@ func (c *RealHelmDeployer) upgradeRelease(ctx context.Context, values map[string
219220
upgrade.MaxHistory = 10
220221
upgrade.Atomic = upgradeConfig.Atomic
221222
upgrade.Force = upgradeConfig.Force
223+
upgrade.SkipSchemaValidation = upgradeConfig.SkipSchemaValidation
222224

223225
timeout, err := timeout.TimeoutExceeded(ctx, c.di, TimeoutCheckpointHelmBeforeUpgradingRelease)
224226
if err != nil {

0 commit comments

Comments
 (0)