Skip to content
Open
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
9 changes: 8 additions & 1 deletion cmd/promote/saas/saas.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ type saasOptions struct {
gitHash string
namespaceRef string
isHotfix bool
isPKO bool
}

func validateSaasServiceFilePath(filePath string) string {
Expand Down Expand Up @@ -270,7 +271,12 @@ func NewCmdSaas() *cobra.Command {

cmd.SilenceUsage = true

service, err := servicesRegistry.GetService(ops.serviceId)
serviceId := ops.serviceId
if ops.isPKO && !strings.HasSuffix(serviceId, "-pko") {
serviceId += "-pko"
}

service, err := servicesRegistry.GetService(serviceId)
if err != nil {
return err
}
Expand All @@ -291,6 +297,7 @@ func NewCmdSaas() *cobra.Command {
saasCmd.Flags().StringVarP(&ops.namespaceRef, "namespaceRef", "n", "", "SaaS target namespace reference name")
saasCmd.Flags().StringVarP(&ops.appInterfaceProvidedPath, "appInterfaceDir", "", "", "Location of app-interface checkout. Falls back to the current working directory")
saasCmd.Flags().BoolVarP(&ops.isHotfix, "hotfix", "", false, "Add gitHash to hotfixVersions in app.yml to bypass progressive delivery (requires --gitHash)")
saasCmd.Flags().BoolVarP(&ops.isPKO, "pko", "", false, "Promote the PKO variant of the service (appends -pko to serviceId)")
_ = saasCmd.Flags().MarkHidden("serviceName")

return saasCmd
Expand Down