This repository was archived by the owner on Jan 22, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -258,6 +258,12 @@ runs:
258258 run : |
259259 uuid=$(uuidgen | tr "[:upper:]" "[:lower:]")
260260 uuid=${uuid%%-*}
261+
262+ # GCP has a 6 character limit the additional uuid prefix since the full prefix length has a maximum of 24
263+ if [[ ${{ inputs.cloudProvider }} == 'gcp' ]]; then
264+ uuid=${uuid:0:6}
265+ fi
266+
261267 echo "uuid=${uuid}" | tee -a $GITHUB_OUTPUT
262268 echo "prefix=e2e-${{ github.run_id }}-${{ github.run_attempt }}-${uuid}" | tee -a $GITHUB_OUTPUT
263269
Original file line number Diff line number Diff line change 2929 regionRegex = regexp .MustCompile (`^\w+-\w+[0-9]$` )
3030 // Source: https://cloud.google.com/resource-manager/reference/rest/v1/projects.
3131 gcpIDRegex = regexp .MustCompile (`^[a-z][-a-z0-9]{4,28}[a-z0-9]$` )
32+
33+ // We currently append 6 characters to the prefix, therefore we remove 6 characters from the gcpIDRegex.
34+ gcpPrefixRegex = regexp .MustCompile (`^[a-z][-a-z0-9]{4,22}[a-z0-9]$` )
3235)
3336
3437// newIAMCreateCmd returns a new cobra.Command for the iam create parent command. It needs another verb, and does nothing on its own.
Original file line number Diff line number Diff line change @@ -106,6 +106,10 @@ func (f *gcpIAMCreateFlags) parse(flags *pflag.FlagSet) error {
106106 if err != nil {
107107 return fmt .Errorf ("getting 'prefix' flag: %w" , err )
108108 }
109+ if f .namePrefix != "" && ! gcpPrefixRegex .MatchString (f .namePrefix ) {
110+ return fmt .Errorf ("prefix %q doesn't match %s" , f .namePrefix , gcpIDRegex )
111+ }
112+
109113 return nil
110114}
111115
You can’t perform that action at this time.
0 commit comments