Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions cmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Examples:
cmd.Flags().StringVar(&shell, "shell", "", "Shell to spawn after Central deployment")
cmd.Flags().StringVar(&envrc, "envrc", "", "Write environment to file instead of spawning sub-shell")
cmd.Flags().BoolVar(&singleNamespace, "single-namespace", false, "Deploy all components in a single namespace ('stackrox' by default)")
cmd.Flags().StringVarP(&tag, "tag", "t", "", "Main image tag to use for deployment (takes precedence over MAIN_IMAGE_TAG environment variable)")

return cmd
}
Expand Down Expand Up @@ -178,9 +179,16 @@ func runDeploy(cmd *cobra.Command, args []string) error {
d.SetPauseReconciliation(pauseReconciliation)
d.SetSingleNamespace(singleNamespace)

mainImageTag, err := helpers.LookupMainImageTag(log)
if err != nil {
return fmt.Errorf("looking up main image tag: %w", err)
var mainImageTag string
if tag != "" {
log.Dimf("Using main image tag from --tag flag: %s", tag)
mainImageTag = tag
}
if mainImageTag == "" {
mainImageTag, err = helpers.LookupMainImageTag(log)
if err != nil {
return fmt.Errorf("looking up main image tag: %w", err)
}
}
d.SetMainImageTag(mainImageTag)

Expand Down
1 change: 1 addition & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var (
shell string
envrc string
singleNamespace bool
tag string
)

func main() {
Expand Down