Skip to content

Commit

Permalink
CronJobs already GA in k8s 1.21
Browse files Browse the repository at this point in the history
The latest version of Cronjob is batch/v1, which is GA in version 1.21 of k8s

k8s PR: Promote CronJobs to batch/v1
kubernetes/kubernetes#98965
  • Loading branch information
ChenglongGao327 committed Jul 12, 2021
1 parent dc8e5e2 commit 04282a9
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions pkg/kube/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,6 @@ func GetDeployMetaFromPod(pod *kubeApiCore.Pod) (metav1.ObjectMeta, metav1.TypeM
if _, err := strconv.Atoi(controllerRef.Name[l-10:]); err == nil && string(controllerRef.Name[l-11]) == "-" {
deployMeta.Name = controllerRef.Name[:l-11]
typeMetadata.Kind = "CronJob"
// heuristically set cron job api version to v1beta1 as it cannot be derived from pod metadata.
// Cronjob is not GA yet and latest version is v1beta1: https://github.com/kubernetes/enhancements/pull/978
typeMetadata.APIVersion = "batch/v1beta1"
}
}
}
Expand Down

0 comments on commit 04282a9

Please sign in to comment.