flexibility in openAPI schema validation in rollback action | EnableOpenAPIValidation

Signed-off-by: Nitin Malik <nitinmalik02015@gmail.com>
pull/11459/head
Nitin Malik 2 years ago
parent 7f26907dd5
commit 273da40d2a

@ -35,17 +35,17 @@ import (
type Rollback struct {
cfg *Configuration
Version int
Timeout time.Duration
Wait bool
WaitForJobs bool
DisableHooks bool
DryRun bool
Recreate bool // will (if true) recreate pods after a rollback.
Force bool // will (if true) force resource upgrade through uninstall/recreate if needed
CleanupOnFail bool
MaxHistory int // MaxHistory limits the maximum number of revisions saved per release
DisableOpenAPIValidation bool // DisableOpenAPIValidation controls whether OpenAPI validation is enforced.
Version int
Timeout time.Duration
Wait bool
WaitForJobs bool
DisableHooks bool
DryRun bool
Recreate bool // will (if true) recreate pods after a rollback.
Force bool // will (if true) force resource upgrade through uninstall/recreate if needed
CleanupOnFail bool
MaxHistory int // MaxHistory limits the maximum number of revisions saved per release
EnableOpenAPIValidation bool // EnableOpenAPIValidation controls whether OpenAPI validation is enforced.
}
// NewRollback creates a new Rollback object with the given configuration.
@ -143,12 +143,12 @@ func (r *Rollback) prepareRollback(name string) (*release.Release, *release.Rele
func (r *Rollback) performRollback(currentRelease, targetRelease *release.Release) (*release.Release, error) {
current, err := r.cfg.KubeClient.Build(bytes.NewBufferString(currentRelease.Manifest), r.DisableOpenAPIValidation)
current, err := r.cfg.KubeClient.Build(bytes.NewBufferString(currentRelease.Manifest), r.EnableOpenAPIValidation)
if err != nil {
return targetRelease, errors.Wrap(err, "unable to build kubernetes objects from current release manifest")
}
target, err := r.cfg.KubeClient.Build(bytes.NewBufferString(targetRelease.Manifest), r.DisableOpenAPIValidation)
target, err := r.cfg.KubeClient.Build(bytes.NewBufferString(targetRelease.Manifest), r.EnableOpenAPIValidation)
if err != nil {
return targetRelease, errors.Wrap(err, "unable to build kubernetes objects from new release manifest")
}

Loading…
Cancel
Save