Skip to content

Commit

Permalink
update cronjob to use batchv1 api
Browse files Browse the repository at this point in the history
  • Loading branch information
krishnaindani authored and Sajiyah-Salat committed Jun 11, 2023
1 parent e2e48b4 commit 49ed4c4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ package v1
/*
*/
import (
batchv1beta1 "k8s.io/api/batch/v1beta1"
batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand Down Expand Up @@ -88,7 +88,7 @@ type CronJobSpec struct {
Suspend *bool `json:"suspend,omitempty"`

// Specifies the job that will be created when executing a CronJob.
JobTemplate batchv1beta1.JobTemplateSpec `json:"jobTemplate"`
JobTemplate batchv1.JobTemplateSpec `json:"jobTemplate"`

//+kubebuilder:validation:Minimum=0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
batchv1 "k8s.io/api/batch/v1"
batchv1beta1 "k8s.io/api/batch/v1beta1"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
Expand Down Expand Up @@ -78,7 +77,7 @@ var _ = Describe("CronJob controller", func() {
},
Spec: cronjobv1.CronJobSpec{
Schedule: "1 * * * *",
JobTemplate: batchv1beta1.JobTemplateSpec{
JobTemplate: batchv1.JobTemplateSpec{
Spec: batchv1.JobSpec{
// For simplicity, we only fill out the required fields.
Template: v1.PodTemplateSpec{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ package v1
/*
*/
import (
batchv1beta1 "k8s.io/api/batch/v1beta1"
batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand Down Expand Up @@ -60,7 +60,7 @@ type CronJobSpec struct {
Suspend *bool `json:"suspend,omitempty"`

// Specifies the job that will be created when executing a CronJob.
JobTemplate batchv1beta1.JobTemplateSpec `json:"jobTemplate"`
JobTemplate batchv1.JobTemplateSpec `json:"jobTemplate"`

// +kubebuilder:validation:Minimum=0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ package v2
/*
*/
import (
batchv1beta1 "k8s.io/api/batch/v1beta1"
batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand Down Expand Up @@ -67,7 +67,7 @@ type CronJobSpec struct {
Suspend *bool `json:"suspend,omitempty"`

// Specifies the job that will be created when executing a CronJob.
JobTemplate batchv1beta1.JobTemplateSpec `json:"jobTemplate"`
JobTemplate batchv1.JobTemplateSpec `json:"jobTemplate"`

// +kubebuilder:validation:Minimum=0

Expand Down
2 changes: 1 addition & 1 deletion pkg/plugin/util/testdata/exampleFile.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
exampleTarget
exampleTargetexampleCodeexampleCode

0 comments on commit 49ed4c4

Please sign in to comment.