Skip to content

Commit

Permalink
bump kapp-controller crd
Browse files Browse the repository at this point in the history
  • Loading branch information
cppforlife committed Nov 14, 2019
1 parent b813e6c commit 467b46a
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 30 deletions.
7 changes: 6 additions & 1 deletion pkg/kapp/clusterapply/converged_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,20 @@ func (c ConvergedResource) findParentAndAssociatedRes() (ctlres.Resource, []ctlr

func (c ConvergedResource) isResourceDoneApplying(res ctlres.Resource) (*ctlresm.DoneApplyState, error) {
specificResFactories := []func(ctlres.Resource) SpecificResource{
// kapp-controller app resource waiter deals with reconciliation _and_ deletion
func(res ctlres.Resource) SpecificResource { return ctlresm.NewKappctrlK14sIoV1alpha1App(res) },

// Deal with deletion generically since below resource waiters do not not know about that
// TODO shoud we make all of them deal with deletion internally?
func(res ctlres.Resource) SpecificResource { return ctlresm.NewDeleting(res) },

func(res ctlres.Resource) SpecificResource { return ctlresm.NewApiExtensionsVxCRD(res) },
func(res ctlres.Resource) SpecificResource { return ctlresm.NewCoreV1Pod(res) },
func(res ctlres.Resource) SpecificResource { return ctlresm.NewCoreV1Service(res) },
func(res ctlres.Resource) SpecificResource { return ctlresm.NewAppsV1Deployment(res, c.associatedRs) },
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) },
func(res ctlres.Resource) SpecificResource { return ctlresm.NewKappctrlK14sIoV1alpha1App(res) },
}

for _, f := range specificResFactories {
Expand Down
9 changes: 9 additions & 0 deletions pkg/kapp/resourcesmisc/kappctrl_k14s_io_v1alpha1_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,17 @@ func (s KappctrlK14sIoV1alpha1App) IsDoneApplying() DoneApplyState {
case cond.Type == kcv1alpha1.ReconcileFailed && cond.Status == corev1.ConditionTrue:
return DoneApplyState{Done: true, Successful: false, Message: fmt.Sprintf(
"Reconcile failed: %s (message: %s)", cond.Reason, cond.Message)}

case cond.Type == kcv1alpha1.DeleteFailed && cond.Status == corev1.ConditionTrue:
return DoneApplyState{Done: true, Successful: false, Message: fmt.Sprintf(
"Delete failed: %s (message: %s)", cond.Reason, cond.Message)}
}
}

deletingRes := NewDeleting(s.resource)
if deletingRes != nil {
return deletingRes.IsDoneApplying()
}

return DoneApplyState{Done: true, Successful: true}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 467b46a

Please sign in to comment.