Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: use the tags in the scorecard scaffolded manifests #3845

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 16 additions & 0 deletions changelog/fragments/scorecard_scaffolded_version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# entries is a list of entries to include in
# release notes and/or the migration guide
entries:
- description: >
When scaffolding scorecard configurations, use release versions instead of `latest` in image tags.

# kind is one of:
# - addition
# - change
# - deprecation
# - removal
# - bugfix
kind: "bugfix"

# Is this a breaking change?
breaking: false
11 changes: 6 additions & 5 deletions internal/plugins/scorecard/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"io/ioutil"
"os"
"path/filepath"
"strings"
"text/template"

"github.com/operator-framework/api/pkg/apis/scorecard/v1alpha3"
Expand All @@ -29,6 +30,7 @@ import (

"github.com/operator-framework/operator-sdk/internal/plugins/util/kustomize"
"github.com/operator-framework/operator-sdk/internal/scorecard"
"github.com/operator-framework/operator-sdk/internal/version"
)

const (
Expand All @@ -54,17 +56,16 @@ patchesJson6902:
)

const (
// defaultTestImageTag points to the latest-released image.
// TODO: change the tag to "latest" once config scaffolding is in a release,
// as the new config spec won't work with the current latest image.
defaultTestImageTag = "quay.io/operator-framework/scorecard-test:master"

// defaultConfigName is the default scorecard componentconfig's metadata.name,
// which must be set on all kustomize-able bases. This name is only used for
// `kustomize build` pattern match and not for on-cluster creation.
defaultConfigName = "config"
)

// defaultTestImageTag points to the latest-released image.
var defaultTestImageTag = fmt.Sprintf("quay.io/operator-framework/scorecard-test:%s",
strings.TrimSuffix(version.Version, "+git"))

// defaultDir is the default directory in which to generate kustomize bases and the kustomization.yaml.
var defaultDir = filepath.Join("config", "scorecard")

Expand Down