Skip to content

Conversation

@mrodm
Copy link
Contributor

@mrodm mrodm commented Feb 20, 2024

Update terraform label used for GCP resources

terraform-1  | Error: Error creating instance: googleapi: Error 400: Invalid value for field 'resource.labels': ''. Label value 'elastic-dependabot-go-modules-github-com-elastic-package-spec-v3-3-1-2' violates format constraints. The value can only contain lowercase letters, numeric characters, underscores and dashes. The value can be at most 63 characters long. International characters are allowed., invalid

Branch variable looks like this:

BUILDKITE_BRANCH="elastic:dependabot/go_modules/helm.sh/helm/v3-3.14.1"

Tests:

 $ branch_name_label "main"
main
 $ branch_name_label "elastic:dependabot/go_modules/github.com/elastic/package-spec/v3-3.1.2"
dependabot-go-modules-github-com-elastic-package-spec-v3-3-1-2
 $ branch_name_label "elastic:dependabot/go_modules/github.com/elastic/package-spec/v3-3.1.2.123456789"
dependabot-go-modules-github-com-elastic-package-spec-v3-3-1-2-

export BRANCH_NAME_LOWER_CASE
export BUILD_ID="${BUILDKITE_BUILD_ID}"
# This variable contains the build number https://buildkite.com/elastic/elastic-package/<number>
export BUILD_ID="${BUILDKITE_BUILD_NUMBER}"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this variable to be the BUILD NUMBER of the pipeline, I think it would be easier to find the right build where the resources were created with that number instead of the UUID

@mrodm mrodm self-assigned this Feb 20, 2024
@mrodm mrodm requested a review from a team February 20, 2024 16:02
@mrodm mrodm enabled auto-merge (squash) February 20, 2024 16:07
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

cc @mrodm

@mrodm mrodm merged commit 8597e7d into elastic:main Feb 20, 2024
@mrodm mrodm deleted the update_branch_name_label branch February 20, 2024 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants