-
Notifications
You must be signed in to change notification settings - Fork 278
Fix generating incorrect names for Jobs when generateName
is used
#718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
pkg/sync/sync_context.go
Outdated
@@ -754,7 +754,7 @@ func (sc *syncContext) getSyncTasks() (_ syncTasks, successful bool) { | |||
if targetObj.GetName() == "" { | |||
var syncRevision string | |||
if len(sc.revision) >= 8 { | |||
syncRevision = sc.revision[0:7] | |||
syncRevision = strings.Trim(sc.revision[0:7], ".") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Semver also allows dashes (-
) and plus (+
), I would trim for that too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dashes should be fine. Let's keep only letters, numbers and -
.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #718 +/- ##
==========================================
- Coverage 54.26% 53.65% -0.61%
==========================================
Files 64 64
Lines 6164 6476 +312
==========================================
+ Hits 3345 3475 +130
- Misses 2549 2725 +176
- Partials 270 276 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Discovered a case when processing of
generateName
produces incorrect results.For example if you have revision
1.1515.1
it's being cut a1.1515.
and combined with suffix that starts with-
character produces name that does not comply with RFC1123.