-
Notifications
You must be signed in to change notification settings - Fork 905
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 additionalPrinterColumns WORKLOAD-KIND
for Work CRD
#2066
Conversation
cool, i like this. |
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.
Looks great!
@@ -16,6 +16,9 @@ spec: | |||
scope: Namespaced | |||
versions: | |||
- additionalPrinterColumns: | |||
- jsonPath: .spec.workload.manifests[*].kind |
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.
kind
can be directly parsed from runtime.RawExtension
, it looks amazing! 👍
@@ -16,6 +16,9 @@ spec: | |||
scope: Namespaced | |||
versions: | |||
- additionalPrinterColumns: | |||
- jsonPath: .spec.workload.manifests[*].kind | |||
name: Kind |
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.
The work Kind
can be a bit confusing, IMOP, WorkloadKind
feel a little better.
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.
How is WORKLOAD-KIND
? like CLUSTER-IP
with splited by -
.
NAMESPACE NAME WORKLOAD-KIND APPLIED AGE
karmada-es-member1 cert-manager-674b866f4c Namespace True 9d
karmada-es-member1 karmada-impersonator-7cbb6bd5c9 ClusterRole True 9d
NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
default kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 88d
karmada-system karmada-aggregated-apiserver ExternalName <none> karmada-aggregated-apiserver.karmada-system.svc.cluster.local <none> 88d
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.
+1
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.
I totally agree with the idea that showing more info out.
In my opinion, it's still possible to put more than one manifests into a single Work. My concern is it might become technical debt. So, let's hold for a while, and see if we can solve it. |
I just researched it, the crd only support simple JsonPath. If we need to customize it, we could put it in
|
Thanks for your time. Yes, aggregated-apiserver is way too complicated for this. |
/cc @RainbowMango I think we can push this forward |
Yeah, I agree, we have to do this now. I'll get back to it later. |
Hi @lonelyCZ, can you help rebase the master branch and push it again? |
Signed-off-by: lonelyCZ <chengzhe@zju.edu.cn>
dd28feb
to
fd7139d
Compare
@@ -20,6 +20,9 @@ spec: | |||
scope: Namespaced | |||
versions: | |||
- additionalPrinterColumns: | |||
- jsonPath: .spec.workload.manifests[*].kind |
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.
What's the difference between manifests[*]
and manifests[0]
?
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.
It looks the same, that only print the fisrt one.
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #2066 +/- ##
=======================================
Coverage 51.87% 51.87%
=======================================
Files 243 243
Lines 24114 24114
=======================================
Hits 12509 12509
+ Misses 10923 10922 -1
- Partials 682 683 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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
Just echo the test report here:
-bash-5.0# kubectl get works.work.karmada.io -n karmada-es-member1
NAME WORKLOAD-KIND APPLIED AGE
karmada-impersonator-7cbb6bd5c9 ClusterRole True 2m55s
karmada-impersonator-84f8c8f8c6 ClusterRoleBinding True 2m55s
nginx-687f7fb96f Deployment True 13s
It looks good, and I think we still have the chance to update without breaking compatibility.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: RainbowMango 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 |
KIND
for Work CRDWORKLOAD-KIND
for Work CRD
Signed-off-by: lonelyCZ 531187475@qq.com
What type of PR is this?
/kind feature
What this PR does / why we need it:
When we debug,
kubectl get work -A
is only shown theNAME
, notKIND
, which will take more time to check the kind of manifests of work.So directly show the kind by additionalPrinterColumns.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
The best is to show all kind of manifests, because it possibly contains multi manifests in one work. But I don't find an easy way to implement it. Now, it only show the first manifests kind.
/cc @RainbowMango
Does this PR introduce a user-facing change?: