@@ -15,6 +15,8 @@ import (
15
15
"k8s.io/apimachinery/pkg/runtime"
16
16
patchtypes "k8s.io/apimachinery/pkg/types"
17
17
18
+ "maps"
19
+
18
20
argorolloutv1alpha1 "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1"
19
21
openshiftv1 "github.com/openshift/api/apps/v1"
20
22
)
@@ -338,11 +340,16 @@ func UpdateDeployment(clients kube.Clients, namespace string, resource runtime.O
338
340
// CreateJobFromCronjob performs rolling upgrade on cronjob
339
341
func CreateJobFromCronjob (clients kube.Clients , namespace string , resource runtime.Object ) error {
340
342
cronJob := resource .(* batchv1.CronJob )
343
+
344
+ annotations := make (map [string ]string )
345
+ annotations ["cronjob.kubernetes.io/instantiate" ] = "manual"
346
+ maps .Copy (annotations , cronJob .Spec .JobTemplate .Annotations )
347
+
341
348
job := & batchv1.Job {
342
349
ObjectMeta : meta_v1.ObjectMeta {
343
350
GenerateName : cronJob .Name + "-" ,
344
351
Namespace : cronJob .Namespace ,
345
- Annotations : cronJob . Spec . JobTemplate . Annotations ,
352
+ Annotations : annotations ,
346
353
Labels : cronJob .Spec .JobTemplate .Labels ,
347
354
OwnerReferences : []meta_v1.OwnerReference {* meta_v1 .NewControllerRef (cronJob , batchv1 .SchemeGroupVersion .WithKind ("CronJob" ))},
348
355
},
0 commit comments