-
Notifications
You must be signed in to change notification settings - Fork 828
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 customizations for apps.krusie.io/v1alpha1/AdvancedCronJob #3368
add customizations for apps.krusie.io/v1alpha1/AdvancedCronJob #3368
Conversation
251a381
to
4785d4e
Compare
desiredObj.status.lastScheduleTime = lastScheduleTime | ||
return desiredObj | ||
end | ||
healthInterpretation: |
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.
For AdvancedCronJob, its .spec.template
is either a jobTemplate
or a broadcastJobTemplate
, and .status.type
indicates the type of the template, which is the only one considered legal in the health judgment.
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.
For AdvancedCronJob
, status only reflects template information, not the status of actual workloads. So interpretHealth
is not needed.
c947db0
to
5845ddb
Compare
The test report based on ### Check the customizations in file
byk@debian:~/go/src/karmada/pkg/resourceinterpreter/default/thirdparty/resourcecustomizations/apps.kruise.io/v1alpha1/CronJob$ karmadactl interpret -f customizations.yaml --check
I0414 15:24:18.047536 2954857 deploy.go:75] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0414 15:24:18.047705 2954857 enable_option.go:63] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0414 15:24:18.056998 2954857 cmdinit.go:149] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0414 15:24:18.057131 2954857 register.go:160] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
-----------------------------------
SOURCE: declarative-configuration-advancedcronjob
TARGET: apps.kruise.io/v1alpha1 AdvancedCronJob
RULERS:
Retain: UNSET
InterpretReplica: UNSET
ReviseReplica: UNSET
InterpretStatus: UNSET
AggregateStatus: PASS
InterpretHealth: UNSET
InterpretDependency: PASS
### Execute the statusAggregation rule
byk@debian:~/go/src/karmada/pkg/resourceinterpreter/default/thirdparty/resourcecustomizations/apps.kruise.io/v1alpha1/CronJob$ karmadactl interpret -f customizations.yaml --operation aggregateStatus --observed-file testdata/observed-acj-nginx.yaml --status-file testdata/status-file.yaml
I0414 15:24:44.501376 2954911 deploy.go:75] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0414 15:24:44.501563 2954911 enable_option.go:63] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0414 15:24:44.513731 2954911 cmdinit.go:149] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0414 15:24:44.514235 2954911 register.go:160] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
---
# [1/1] aggregatedStatus:
apiVersion: apps.kruise.io/v1alpha1
kind: AdvancedCronJob
metadata:
labels:
app: sample
name: sample
namespace: test-acj
spec:
schedule: '*/2 * * * *'
template:
broadcastJobTemplate:
spec:
completionPolicy:
type: Never
template:
metadata:
labels:
app: sample
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
restartPolicy: Never
volumes:
- configMap:
name: my-sample-config
name: configmap
status:
active:
- apiVersion: apps.kruise.io/v1alpha1
kind: BroadcastJob
name: sample-1681378080
namespace: test-acj
resourceVersion: "3636404"
uid: f96013ef-2869-49d7-adf3-8f7231cc5e2a
- apiVersion: apps.kruise.io/v1alpha1
kind: BroadcastJob
name: sample-1681378080
namespace: test-acj
resourceVersion: "3635081"
uid: d1f3c194-d650-4cce-b23d-307a445bb92e
lastScheduleTime: "2023-04-13T09:30:00Z"
type: BroadcastJob
### Execute the dependencyInterpretation rule
byk@debian:~/go/src/karmada/pkg/resourceinterpreter/default/thirdparty/resourcecustomizations/apps.kruise.io/v1alpha1/CronJob$ karmadactl interpret -f customizations.yaml --operation interpretDependency --observed-file testdata/observed-acj-nginx.yaml
I0414 15:25:07.628068 2954947 deploy.go:75] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0414 15:25:07.628536 2954947 enable_option.go:63] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0414 15:25:07.650315 2954947 cmdinit.go:149] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
I0414 15:25:07.651070 2954947 register.go:160] No default release version found. build version: version.Info{GitVersion:"", GitCommit:"c8720e81c7f4badb2a2e07ed7218391b3ea7d912", GitTreeState:"dirty", BuildDate:"2023-04-12T09:43:27Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
---
# [1/1] dependencies:
- apiVersion: v1
kind: ConfigMap
name: my-sample-config
namespace: test-acj
- apiVersion: v1
kind: ConfigMap
name: mysql-config
namespace: test-acj
|
Signed-off-by: yike21 <yike21@qq.com>
5845ddb
to
9628830
Compare
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## master #3368 +/- ##
=======================================
Coverage 51.64% 51.64%
=======================================
Files 210 210
Lines 18926 18926
=======================================
Hits 9775 9775
Misses 8620 8620
Partials 531 531
Flags with carried forward coverage won't be shown. Click here to find out more. Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
/cc @Poor12 |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Poor12 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 cleanup
What this PR does / why we need it:
Add third-party resources
apps.krusie.io/v1alpha1/AdvancedCronJob
into Resource Interpreter framework.Which issue(s) this PR fixes:
Part of #3331
Special notes for your reviewer:
@Poor12
Does this PR introduce a user-facing change?:
NONE