From cdd9551a8483ad31790773b9798a5a2d460864a7 Mon Sep 17 00:00:00 2001 From: Andreas Neumann Date: Fri, 7 Aug 2020 11:14:33 +0200 Subject: [PATCH] Add a "skipVerify" attribute to version so that old versions that would fail the kudo package verify can be added to the index Signed-off-by: Andreas Neumann --- pkg/apis/operator/v1alpha1/types.go | 4 ++++ pkg/internal/apis/operator/encode/convert.go | 3 +++ pkg/internal/apis/operator/types.go | 4 ++++ pkg/internal/validation/validate.go | 4 +++- 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/pkg/apis/operator/v1alpha1/types.go b/pkg/apis/operator/v1alpha1/types.go index c575b06..8acc060 100644 --- a/pkg/apis/operator/v1alpha1/types.go +++ b/pkg/apis/operator/v1alpha1/types.go @@ -44,6 +44,10 @@ type Version struct { // URL specifies a version as a URL of a package tarball. URL *string `yaml:"url,omitempty"` + + // SkipVerify can be used to skip the KUDO package verification step to publish + // old versions of an operator that would fail the package verification + SkipVerify *bool `yaml:"url,omitempty"` } // Git references a specific tag of a Git repository of a KUDO operator. diff --git a/pkg/internal/apis/operator/encode/convert.go b/pkg/internal/apis/operator/encode/convert.go index 574d249..acda14e 100644 --- a/pkg/internal/apis/operator/encode/convert.go +++ b/pkg/internal/apis/operator/encode/convert.go @@ -46,6 +46,9 @@ func convertV1Alpha1Version(in v1alpha1.Version) operator.Version { out.Git = &git } + if in.SkipVerify != nil { + out.SkipVerify = *in.SkipVerify + } return out } diff --git a/pkg/internal/apis/operator/types.go b/pkg/internal/apis/operator/types.go index b494ba0..cc9b16f 100644 --- a/pkg/internal/apis/operator/types.go +++ b/pkg/internal/apis/operator/types.go @@ -37,6 +37,10 @@ type Version struct { // URL specifies a version as a URL of a package tarball. URL *string + + // SkipVerify can be used to skip the KUDO package verification step to publish + // old versions of an operator that would fail the package verification + SkipVerify bool } // Version prints the version as a combination of appVersion and operatorVersion diff --git a/pkg/internal/validation/validate.go b/pkg/internal/validation/validate.go index f80e134..88b233e 100644 --- a/pkg/internal/validation/validate.go +++ b/pkg/internal/validation/validate.go @@ -16,7 +16,9 @@ func Validate(operator operator.Operator, version operator.Version, pkg repo.Pac result := Result{} validateVersion(version, pkg, &result) - validateVerify(pkg, &result) + if !version.SkipVerify { + validateVerify(pkg, &result) + } return result }