Skip to content

Commit

Permalink
Add a "skipVerify" attribute to version so that old versions that wou…
Browse files Browse the repository at this point in the history
…ld fail the kudo package verify can be added to the index
  • Loading branch information
ANeumann82 committed Aug 7, 2020
1 parent 2104530 commit 3b95c3e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions pkg/apis/operator/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions pkg/internal/apis/operator/encode/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ func convertV1Alpha1Version(in v1alpha1.Version) operator.Version {
out.Git = &git
}

if in.SkipVerify != nil {
out.SkipVerify = *in.SkipVerify
}
return out
}

Expand Down
4 changes: 4 additions & 0 deletions pkg/internal/apis/operator/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion pkg/internal/validation/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 3b95c3e

Please sign in to comment.