File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
staging/src/k8s.io/kubectl/pkg/cmd/create Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -256,7 +256,12 @@ func (o *CreateJobOptions) createJobFromCronJob(cronJob *batchv1beta1.CronJob) *
256
256
Annotations : annotations ,
257
257
Labels : cronJob .Spec .JobTemplate .Labels ,
258
258
OwnerReferences : []metav1.OwnerReference {
259
- * metav1 .NewControllerRef (cronJob , cronJob .GroupVersionKind ()),
259
+ {
260
+ APIVersion : batchv1beta1 .SchemeGroupVersion .String (),
261
+ Kind : cronJob .Kind ,
262
+ Name : cronJob .GetName (),
263
+ UID : cronJob .GetUID (),
264
+ },
260
265
},
261
266
},
262
267
Spec : cronJob .Spec .JobTemplate .Spec ,
Original file line number Diff line number Diff line change @@ -162,9 +162,16 @@ func TestCreateJobFromCronJob(t *testing.T) {
162
162
expected : & batchv1.Job {
163
163
TypeMeta : metav1.TypeMeta {APIVersion : batchv1 .SchemeGroupVersion .String (), Kind : "Job" },
164
164
ObjectMeta : metav1.ObjectMeta {
165
- Name : jobName ,
166
- Annotations : map [string ]string {"cronjob.kubernetes.io/instantiate" : "manual" },
167
- OwnerReferences : []metav1.OwnerReference {* metav1 .NewControllerRef (cronJob , cronJob .GroupVersionKind ())},
165
+ Name : jobName ,
166
+ Annotations : map [string ]string {"cronjob.kubernetes.io/instantiate" : "manual" },
167
+ OwnerReferences : []metav1.OwnerReference {
168
+ {
169
+ APIVersion : batchv1beta1 .SchemeGroupVersion .String (),
170
+ Kind : cronJob .Kind ,
171
+ Name : cronJob .GetName (),
172
+ UID : cronJob .GetUID (),
173
+ },
174
+ },
168
175
},
169
176
Spec : batchv1.JobSpec {
170
177
Template : corev1.PodTemplateSpec {
You can’t perform that action at this time.
0 commit comments