Skip to content

Commit

Permalink
EVEREST-107: fast channel for rc builds (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Kralik authored Apr 17, 2024
1 parent a364272 commit fef840a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 10 deletions.
14 changes: 5 additions & 9 deletions pkg/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,10 @@ const (
everestServiceAccountRoleBinding = "everest-admin-role-binding"
everestServiceAccountClusterRoleBinding = "everest-admin-cluster-role-binding"

everestOperatorChannel = "stable-v0"
pxcOperatorChannel = "stable-v1"
psmdbOperatorChannel = "stable-v1"
pgOperatorChannel = "stable-v2"
vmOperatorChannel = "stable-v0"
pxcOperatorChannel = "stable-v1"
psmdbOperatorChannel = "stable-v1"
pgOperatorChannel = "stable-v2"
vmOperatorChannel = "stable-v0"

// catalogSource is the name of the catalog source.
catalogSource = "everest-catalog"
Expand Down Expand Up @@ -342,10 +341,7 @@ func (o *Install) provisionEverestOperator(ctx context.Context, recVer *version.
v = recVer.EverestOperator.String()
}

ch := everestOperatorChannel
if version.EverestChannelOverride != "" {
ch = version.EverestChannelOverride
}
ch := version.CatalogChannel()
if err := o.installOperator(ctx, ch, common.EverestOperatorName, common.SystemNamespace, v)(); err != nil {
return err
}
Expand Down
24 changes: 23 additions & 1 deletion pkg/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ const (
releaseCatalogImage = "docker.io/percona/everest-catalog:%s"
devManifestURL = "https://raw.githubusercontent.com/percona/everest/main/deploy/quickstart-k8s.yaml"
releaseManifestURL = "https://raw.githubusercontent.com/percona/everest/v%s/deploy/quickstart-k8s.yaml"

everestOperatorChannelStable = "stable-v0"
everestOperatorChannelFast = "fast-v0"
)

var (
Expand All @@ -54,6 +57,9 @@ func CatalogImage(v *goversion.Version) string {
// Channels other than stable are only in dev catalog.
return devCatalogImage
}
if isRC(v) {
return devCatalogImage
}
return fmt.Sprintf(releaseCatalogImage, v)
}

Expand All @@ -65,6 +71,18 @@ func ManifestURL(v *goversion.Version) string {
return fmt.Sprintf(releaseManifestURL, v)
}

// CatalogChannel returns a channel for Everest catalog.
func CatalogChannel() string {
if EverestChannelOverride != "" {
return EverestChannelOverride
}
v, err := goversion.NewVersion(Version)
if err == nil && isRC(v) {
return everestOperatorChannelFast
}
return everestOperatorChannelStable
}

func isDevVersion(ver string) bool {
if ver == "" {
return true
Expand All @@ -79,7 +97,7 @@ func isDevVersion(ver string) bool {
return false
}

if rcSuffix.MatchString(v.Prerelease()) {
if isRC(v) {
return false
}

Expand All @@ -90,6 +108,10 @@ func isDevVersion(ver string) bool {
return false
}

func isRC(v *goversion.Version) bool {
return rcSuffix.MatchString(v.Prerelease())
}

// FullVersionInfo returns full version report.
func FullVersionInfo() string {
out := []string{
Expand Down

0 comments on commit fef840a

Please sign in to comment.