Skip to content

Commit

Permalink
Merge pull request #131516 from herkolategan/backport23.2-131218
Browse files Browse the repository at this point in the history
release-23.2: roachprod: validate cloud providers
  • Loading branch information
herkolategan authored Sep 30, 2024
2 parents 830c239 + 9b8175a commit a0080c7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/cmd/roachprod/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -1395,6 +1395,18 @@ func validateAndConfigure(cmd *cobra.Command, args []string) {
_ = cmd.Flags().Set("arch", string(arch))
}
}

// Validate cloud providers, if set.
providersSet := make(map[string]struct{})
for _, p := range createVMOpts.VMProviders {
if _, ok := vm.Providers[p]; !ok {
printErrAndExit(fmt.Errorf("unknown cloud provider %q", p))
}
if _, ok := providersSet[p]; ok {
printErrAndExit(fmt.Errorf("duplicate cloud provider specified %q", p))
}
providersSet[p] = struct{}{}
}
}

var updateCmd = &cobra.Command{
Expand Down

0 comments on commit a0080c7

Please sign in to comment.