-
Notifications
You must be signed in to change notification settings - Fork 917
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
feat: show status.labelSelector
for CloneSet
#4839
feat: show status.labelSelector
for CloneSet
#4839
Conversation
Signed-off-by: 孙伟祥 <[email protected]>
Welcome @veophi! It looks like this is your first PR to karmada-io/karmada 🎉 |
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 #4839 +/- ##
==========================================
- Coverage 53.11% 53.10% -0.01%
==========================================
Files 250 250
Lines 20351 20351
==========================================
- Hits 10810 10808 -2
- Misses 8824 8826 +2
Partials 717 717
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Thanks @veophi, I notice you are from the openkruise community, so it makes sense for you to maintain the resource customizations of /assign @yike21 @chaunceyjiang |
From the code it looks fine, I'll do the test asap! Glad to see your contribution! @veophi |
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 status.labelSelector
field of cloneset
is equal to the items in .spec.selector.matchLabels
spliced together with ','. According to description, it has to do with the hpa feature of CloneSet
.
The changes in customizations.yaml
has been verified.
$ karmadactl version
karmadactl version: version.Info{GitVersion:"v1.7.0-alpha.1-1044-g5f4ff2435", GitCommit:"5f4ff24353409cd190537e45478d9c6ce6a3d370", GitTreeState:"clean", BuildDate:"2024-04-18T14:35:01Z", GoVersion:"go1.22.2", Compiler:"gc", Platform:"linux/amd64"}
# Execute the statusReflection rule
$ karmadactl interpret -f customizations.yaml --operation interpretStatus --observed-file testdata/observed-cloneset-nginx.yaml
---
# [1/1] status:
availableReplicas: 2
currentRevision: sample-59df6bd888
expectedUpdatedReplicas: 2
labelSelector: app=sample,test=cloneset
observedGeneration: 1
readyReplicas: 2
replicas: 2
updateRevision: sample-59df6bd888
updatedReadyReplicas: 2
updatedReplicas: 2
# Execute the statusAggregation rule
$ karmadactl interpret -f customizations.yaml --operation aggregateStatus --observed-file testdata/observed-cloneset-nginx.yaml --status-file testdata/status-file.yaml
---
# [1/1] aggregatedStatus:
apiVersion: apps.kruise.io/v1alpha1
kind: CloneSet
metadata:
generation: 1
labels:
app: sample
name: sample
namespace: test-cloneset
spec:
replicas: 2
selector:
matchLabels:
app: sample
test: cloneset
template:
metadata:
labels:
app: sample
test: cloneset
spec:
containers:
- env:
- name: logData
valueFrom:
configMapKeyRef:
key: log
name: mysql-config
- name: lowerData
valueFrom:
configMapKeyRef:
key: lower
name: mysql-config
image: nginx:alpine
name: nginx
volumes:
- configMap:
name: my-sample-config
name: configmap
status:
availableReplicas: 4
collisionCount: 0
currentRevision: sample-59df6bd888
expectedUpdatedReplicas: 4
labelSelector: app=sample,test=cloneset
observedGeneration: 1
readyReplicas: 4
replicas: 4
updateRevision: sample-59df6bd888
updatedReadyReplicas: 4
updatedReplicas: 4
And the test-data
need to be updated. I will do it soon.
/lgtm |
Thank you @yike21 .
Seems we still lack of a mechanism to run these test automatically? |
/assign @chaunceyjiang |
The tests are executed automatically. The test program ensures that the resourcecustomizations directory is structured with the test files and that the However, when an existing |
Get it. Thanks for the explanation. We have tests and they work as expected, we just need to add new fields to them, as #4849 does. |
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.
Thanks~
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chaunceyjiang 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 |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: