Skip to content

Commit

Permalink
test deployer: fix a bug when deploying cluster with various ent imag…
Browse files Browse the repository at this point in the history
…es (#19381)
  • Loading branch information
huikang authored Oct 26, 2023
1 parent 4096c96 commit 3b806d4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion testing/deployer/topology/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ func compile(logger hclog.Logger, raw *Config, prev *Topology) (*Topology, error
n.Index = nextIndex
nextIndex++

n.Images = c.Images.OverrideWith(n.Images).ChooseNode(n.Kind)
n.Images = c.Images.OverrideWith(n.Images.ChooseConsul(c.Enterprise)).ChooseNode(n.Kind)

n.Cluster = c.Name
n.Datacenter = c.Datacenter
Expand Down
9 changes: 7 additions & 2 deletions testing/deployer/topology/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ import (
)

type Images struct {
Consul string `json:",omitempty"`
ConsulCE string `json:",omitempty"`
// Consul is the image used for creating the container,
// Use ChooseConsul() to control which image (ConsulCE or ConsulEnterprise) assign to Consul
Consul string `json:",omitempty"`
// ConsulCE sets the CE image
ConsulCE string `json:",omitempty"`
// ConsulEnterprise sets the ent image
ConsulEnterprise string `json:",omitempty"`
Envoy string
Dataplane string
Expand Down Expand Up @@ -82,6 +86,7 @@ func (i Images) ChooseNode(kind NodeKind) Images {
return i
}

// ChooseConsul controls which image assigns to Consul
func (i Images) ChooseConsul(enterprise bool) Images {
if enterprise {
i.Consul = i.ConsulEnterprise
Expand Down

0 comments on commit 3b806d4

Please sign in to comment.