Skip to content

Commit 2440b80

Browse files
jimmycgzjimmy-cui-sada
authored andcommitted
fix: Sanitize owner label to comply with GCP label requirements
Fixes #6218 GCP labels only allow lowercase letters, numbers, underscores, and hyphens. The owner flag (typically an email address) was being used directly as a label value without sanitization, causing errors when it contained periods or uppercase letters. This change applies the existing _SafeLabelKeyOrValue() method to sanitize the owner value before using it as a GCP label, ensuring compliance with GCP's label requirements.
1 parent acb1caf commit 2440b80

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

perfkitbenchmarker/benchmark_spec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1253,7 +1253,7 @@ def _GetResourceDict(self, time_format, timeout_minutes=None):
12531253
'create_time_utc': now_utc.strftime(time_format),
12541254
'benchmark': self.name,
12551255
'perfkit_uuid': self.uuid,
1256-
'owner': FLAGS.owner,
1256+
'owner': self._SafeLabelKeyOrValue(FLAGS.owner),
12571257
'benchmark_uid': self.uid,
12581258
}
12591259

0 commit comments

Comments
 (0)