Skip to content

Commit

Permalink
feat: use kuma version when installing it
Browse files Browse the repository at this point in the history
  • Loading branch information
czeslavo committed Feb 2, 2024
1 parent bf671d1 commit 891d46e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
11 changes: 9 additions & 2 deletions pkg/clusters/addons/kuma/addon.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type Addon struct {
name string
logger *logrus.Logger

version semver.Version
version *semver.Version

mtlsEnabled bool
}
Expand All @@ -63,7 +63,10 @@ func (a *Addon) Namespace() string {

// Version indicates the Kuma version for this addon.
func (a *Addon) Version() semver.Version {
return a.version
if a.version == nil {
return semver.Version{}
}
return *a.version
}

// -----------------------------------------------------------------------------
Expand Down Expand Up @@ -144,6 +147,10 @@ func (a *Addon) Deploy(ctx context.Context, cluster clusters.Cluster) error {
// if the dbmode is postgres, set several related values
args := []string{"--kubeconfig", kubeconfig.Name(), "install", DefaultReleaseName, "kuma/kuma"}

if a.version != nil {
args = append(args, "--version", a.version.String())
}

// compile the helm installation values
args = append(args, "--create-namespace", "--namespace", Namespace)
a.logger.Debugf("helm install arguments: %+v", args)
Expand Down
4 changes: 2 additions & 2 deletions pkg/clusters/addons/kuma/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
// Builder is a configuration tool to generate Kuma cluster addons.
type Builder struct {
name string
version semver.Version
version *semver.Version
logger *logrus.Logger

mtlsEnabled bool
Expand All @@ -29,7 +29,7 @@ func NewBuilder() *Builder {

// WithVersion configures the specific version of Kuma which should be deployed.
func (b *Builder) WithVersion(version semver.Version) *Builder {
b.version = version
b.version = &version
return b
}

Expand Down

0 comments on commit 891d46e

Please sign in to comment.