-
Notifications
You must be signed in to change notification settings - Fork 947
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
bugfix: Support batch/v1beta1 cronjobs for compatibility before Kubernetes v1.21 #3280
bugfix: Support batch/v1beta1 cronjobs for compatibility before Kubernetes v1.21 #3280
Conversation
Signed-off-by: trafalgarzzz <trafalgarz@outlook.com>
Codecov Report
@@ Coverage Diff @@
## master #3280 +/- ##
=======================================
Coverage 65.48% 65.48%
=======================================
Files 397 397
Lines 23170 23170
=======================================
Hits 15173 15173
Misses 6214 6214
Partials 1783 1783 |
/test fluid-e2e |
Can you also update the cronjob version in https://github.com/fluid-cloudnative/fluid/blob/master/charts/fluid-datamigrate/juicefs/templates/cronjob.yaml#L2 based on k8s version, just like https://github.com/fluid-cloudnative/fluid/blob/master/charts/fluid/fluid/templates/csi/driver.yaml#L1 ? |
/lgtm |
Signed-off-by: trafalgarzzz <trafalgarz@outlook.com>
@@ -0,0 +1,35 @@ | |||
package compatibility |
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.
Please add license header.
) | ||
|
||
var batchV1CronJobCompatible = false | ||
|
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 about moving this file to pkg/utils/kubeclient
?
Signed-off-by: trafalgarzzz <trafalgarz@outlook.com>
9d9ad69
to
f30d3ef
Compare
Kudos, SonarCloud Quality Gate passed!
|
/test fluid-e2e |
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cheyang, zwwhdls 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 |
Ⅰ. Describe what this PR does
batchv1.CronJobs
is not supported before Kubernetes v1.20 so that Fluid now fails to run on K8s v1.20 with the following error:This PR fixes by firstly listing all supported API resources in the
batch/v1
group version through discovery client and check ifcronjobs
resource exists. If not, it fallbacks to usebatch/v1beta1
forcronjobs
.Ⅱ. Does this pull request fix one issue?
#3279
Ⅲ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews