Skip to content

Commit

Permalink
fix: merge cronjob config
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Sukhin <vladislav@kubeshop.io>
  • Loading branch information
vsukhin committed Oct 29, 2024
1 parent 6a23684 commit 151ffd3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/controller/testworkflows/testworkflow_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/intstr"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/log"
Expand Down Expand Up @@ -242,6 +243,11 @@ func MergeCronJobJobConfig(dst, include *testworkflowsv1.CronJobConfig) *testwor
}
maps.Copy(dst.Annotations, include.Annotations)

if len(include.Config) > 0 && dst.Config == nil {
dst.Config = map[string]intstr.IntOrString{}
}
maps.Copy(dst.Config, include.Config)

return dst
}

Expand Down

0 comments on commit 151ffd3

Please sign in to comment.