diff --git a/pkg/kapp/clusterapply/add_or_update_change.go b/pkg/kapp/clusterapply/add_or_update_change.go index 7c57cf4c2..3c297b442 100644 --- a/pkg/kapp/clusterapply/add_or_update_change.go +++ b/pkg/kapp/clusterapply/add_or_update_change.go @@ -243,6 +243,7 @@ func (c AddOrUpdateChange) isResourceDoneApplying(res ctlres.Resource, isParent func(res ctlres.Resource) SpecificResource { return ctlresm.NewAppsv1Deployment(res) }, func(res ctlres.Resource) SpecificResource { return ctlresm.NewAppsv1DaemonSet(res) }, func(res ctlres.Resource) SpecificResource { return ctlresm.NewBatchv1Job(res) }, + func(res ctlres.Resource) SpecificResource { return ctlresm.NewBatchvxCronJob(res) }, } for _, f := range specificResFactories { diff --git a/pkg/kapp/resourcesmisc/batch_vx_cronjob.go b/pkg/kapp/resourcesmisc/batch_vx_cronjob.go new file mode 100644 index 000000000..d250d01c9 --- /dev/null +++ b/pkg/kapp/resourcesmisc/batch_vx_cronjob.go @@ -0,0 +1,26 @@ +package resourcesmisc + +import ( + ctlres "github.com/k14s/kapp/pkg/kapp/resources" +) + +type BatchvxCronJob struct { + resource ctlres.Resource +} + +func NewBatchvxCronJob(resource ctlres.Resource) *BatchvxCronJob { + matcher := ctlres.APIGroupKindMatcher{ + APIGroup: "batch", + Kind: "CronJob", + } + if matcher.Matches(resource) { + return &BatchvxCronJob{resource} + } + return nil +} + +func (s BatchvxCronJob) IsDoneApplying() DoneApplyState { + // Always return success as we do not want to pick up associated + // pods that might have previously failed + return DoneApplyState{Done: true, Successful: true} +}