Skip to content

Commit

Permalink
fix: latest on nimbus
Browse files Browse the repository at this point in the history
  • Loading branch information
stdevMac committed Dec 1, 2024
1 parent aa766fb commit 3ebaf4a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
4 changes: 4 additions & 0 deletions cli/actions/generation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,8 @@ func TestGenerateDockerCompose(t *testing.T) {
if tc.genData.LatestVersion {
if tc.genData.ConsensusClient.Modified {
assert.True(t, strings.HasSuffix(named.String(), tc.genData.ConsensusClient.Image))
} else if tc.genData.ConsensusClient.Name == "nimbus" {
assert.True(t, strings.HasSuffix(named.String(), ":multiarch-latest"))
} else {
assert.True(t, strings.HasSuffix(named.String(), ":latest"))
}
Expand Down Expand Up @@ -483,6 +485,8 @@ func TestGenerateDockerCompose(t *testing.T) {
if tc.genData.LatestVersion {
if tc.genData.ValidatorClient.Modified {
assert.True(t, strings.HasSuffix(named.String(), tc.genData.ValidatorClient.Image))
} else if tc.genData.ValidatorClient.Name == "nimbus" {
assert.True(t, strings.HasSuffix(named.String(), ":multiarch-latest"))
} else {
assert.True(t, strings.HasSuffix(named.String(), ":latest"))
}
Expand Down
13 changes: 10 additions & 3 deletions internal/pkg/generate/generate_scripts.go
Original file line number Diff line number Diff line change
Expand Up @@ -698,9 +698,16 @@ func joinIfNotEmpty(strs ...string) string {
func imageOrEmpty(cls *clients.Client, latest bool) string {
if cls != nil {
if latest && !cls.Modified {
splits := strings.Split(cls.Image, ":")
splits[len(splits)-1] = "latest"
return strings.Join(splits, ":")
if cls.Name == "nimbus" {
splits := strings.Split(cls.Image, ":")
splits[len(splits)-1] = "multiarch-latest"
return strings.Join(splits, ":")

} else {
splits := strings.Split(cls.Image, ":")
splits[len(splits)-1] = "latest"
return strings.Join(splits, ":")
}
}
return cls.Image
}
Expand Down

0 comments on commit 3ebaf4a

Please sign in to comment.