-
Notifications
You must be signed in to change notification settings - Fork 776
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
Make CloneSet and StatefulSet Support the generateName setting #1635
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Welcome @Radeity! It looks like this is your first PR to openkruise/kruise 🎉 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1635 +/- ##
==========================================
+ Coverage 47.91% 48.99% +1.08%
==========================================
Files 162 180 +18
Lines 23491 18803 -4688
==========================================
- Hits 11256 9213 -2043
+ Misses 11014 8378 -2636
+ Partials 1221 1212 -9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Aaron Wang <[email protected]>
@@ -95,7 +95,7 @@ func (c *commonControl) newVersionedPods(cs *appsv1alpha1.CloneSet, revision str | |||
} | |||
clonesetutils.WriteRevisionHash(pod, revision) | |||
|
|||
pod.Name = fmt.Sprintf("%s-%s", cs.Name, id) | |||
pod.Name = fmt.Sprintf("%s-%s", cs.GenerateName, id) |
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.
Consider the case where the generateName filed for the inventory cluster is empty.
@@ -95,7 +95,7 @@ func (c *commonControl) newVersionedPods(cs *appsv1alpha1.CloneSet, revision str | |||
} | |||
clonesetutils.WriteRevisionHash(pod, revision) | |||
|
|||
pod.Name = fmt.Sprintf("%s-%s", cs.Name, id) | |||
pod.Name = fmt.Sprintf("%s-%s", cs.GenerateName, id) |
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.
shall we leave pod name empty and let the apiserver assign unique names using generateName?
/hold |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Ⅰ. Describe what this PR does
generateName
setting for CloneSet and StatefulSet.generateName
as prefix of the name of owned pod/pvc, rather usingname
like before. And if user doesn't declaregenerateName
,generateName
will be set the same value ofname
in webhook.Ⅱ. Does this pull request fix one issue?
Ⅲ. Describe how to verify it
name
andgenerateName
to verify pod/pvc usinggenerateName
can work well during doReconcile (like cloneset_controller_test:TestReconcile, stateful_set_utils_test.go:newStatefulSet).Ⅳ. Special notes for reviews