-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add serviceUID/configUID labels to pods & deployments, serviceUID label to configs #10539
Conversation
Why would there be pods from previous incarnation? Or this is about race condition while old one is still being deleted and new ones already online? |
Yes exactly. If the old pods are in Terminating state a query for all pods related to a ksvc will return both sets of pods because all we can query on (in a single query) is the ksvc name (or config name). By adding the serviceUID we can ensure we get just the pods for the correct ksvc. |
/retest |
@@ -78,6 +78,7 @@ func TestMakeRevisions(t *testing.T) { | |||
serving.ConfigurationLabelKey: "build", |
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.
you don't seem to have any positive tests here.
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.
yep - on my todo list - wanted to get the core of this out there for review ASAP. Coming soon...
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.
done
@@ -41,7 +41,7 @@ func TestConfigurationSpec(t *testing.T) { | |||
} | |||
expectOwnerReferencesSetCorrectly(t, c.OwnerReferences) | |||
|
|||
if got, want := c.Labels, map[string]string{serving.ServiceLabelKey: testServiceName}; !cmp.Equal(got, want) { | |||
if got, want := c.Labels, map[string]string{serving.ServiceLabelKey: testServiceName, serving.ServiceUIDLabelKey: ""}; !cmp.Equal(got, want) { |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
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.
done
This will allow people to find all pods for a service w/o running into the problem of finding pods associated with an old ksvc that just happens to share the same name. With this the user can search for pods by the ksvc UID via the new label. Rather than having the code go and lookup the ksvc from the revision, I decided to just add this label to the config as well. If people would prefer to not have this extra label on the config (and do it via a ksvc lookup) I can look into that change. Signed-off-by: Doug Davis <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #10539 +/- ##
==========================================
- Coverage 88.09% 88.08% -0.02%
==========================================
Files 186 186
Lines 8831 8839 +8
==========================================
+ Hits 7780 7786 +6
- Misses 810 811 +1
- Partials 241 242 +1
Continue to review full report at Codecov.
|
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.
/lgtm
/approve /hold can you update the title to reflect what's happening now - ie. service & config uid added to revision/deployment |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dprotaso, duglin The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@dprotaso done! |
/hold cancel |
/retest |
While exporting the service using `service export` command, ignore the service labels with keys 'configUID' and `configUID` see knative/serving#10539 for further details.
While exporting the service using `service export` command, ignore the service labels with keys 'configUID' and `configUID` see knative/serving#10539 for further details.
…#1194) * Ignore serviceUID and configUID labels in service export result While exporting the service using `service export` command, ignore the service labels with keys 'configUID' and `configUID` see knative/serving#10539 for further details. * Fix the var names per golint recommendation * Ignore the serviceUID and configUID labels from revision labels * Add e2e for verifying configUID and serviceUID labels are absent * Add CHANGELOG
This will allow people to find all pods for a service w/o running into the
problem of finding pods associated with an old ksvc that just happens to
share the same name. With this the user can search for pods by the ksvc UID
via the new label.
Rather than having the code go and lookup the ksvc from the revision, I
decided to just add this label to the config as well. If people would prefer
to not have this extra label on the config (and do it via a ksvc lookup)
I can look into that change.
Signed-off-by: Doug Davis [email protected]