Skip to content

Commit

Permalink
BackPort: Handle pipeline failures in Makefile steps (#810)
Browse files Browse the repository at this point in the history
* Fix flake in operator-in-operator test (#799)
* brew is deprecated and replaced by a brews list (#771)
  • Loading branch information
kensipe authored Sep 12, 2019
1 parent c74d227 commit dd83ad0
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 34 deletions.
30 changes: 15 additions & 15 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,21 @@ archives:
386: i386
amd64: x86_64
format: binary
brew:
name: kudo-cli
github:
owner: kudobuilder
name: homebrew-tap
commit_author:
name: kudoreleasebot
email: [email protected]
folder: Formula
homepage: https://kudo.dev
description: Interact with KUDO via the kubectl plugin
dependencies:
- kubernetes-cli
install: |
bin.install "kubectl-kudo"
brews:
- name: kudo-cli
github:
owner: kudobuilder
name: homebrew-tap
commit_author:
name: kudoreleasebot
email: [email protected]
folder: Formula
homepage: https://kudo.dev
description: Interact with KUDO via the kubectl plugin
dependencies:
- kubernetes-cli
install: |
bin.install "kubectl-kudo"
checksum:
name_template: 'checksums.txt'
snapshot:
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/instance/instance_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ func createPlanAndUpdateReference(c client.Client, r record.EventRecorder, schem

planExecution := newPlanExecution(instance, planName, scheme)
log.Printf("Creating PlanExecution of planExecution %s for instance %s", planName, instance.Name)
r.Event(instance, "Normal", "CreatePlanExecution", fmt.Sprintf("Creating \"%v\" planExecution execution", planName))
r.Event(instance, "Normal", "CreatePlanExecution", fmt.Sprintf("Creating \"%v\" planExecution on %s", planName, instance.Name))

// Make this instance the owner of the PlanExecution
if err := controllerutil.SetControllerReference(instance, planExecution, scheme); err != nil {
Expand Down
40 changes: 22 additions & 18 deletions pkg/controller/planexecution/planexecution_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,26 +165,28 @@ func add(mgr manager.Manager, r reconcile.Reconciler) error {
&handler.EnqueueRequestsFromMapFunc{
ToRequests: handler.ToRequestsFunc(
func(a handler.MapObject) []reconcile.Request {
// instance in instance -> reconcile plan for outer instance
requests := mapToOwningInstanceActivePlan(a)
if len(requests) == 0 {
inst := &kudov1alpha1.Instance{}
err = mgr.GetClient().Get(context.TODO(), client.ObjectKey{
Name: a.Meta.GetName(),
Namespace: a.Meta.GetNamespace(),
}, inst)

if err == nil {
// for every updated/added instance also trigger reconcile for its active plan
requests = append(requests, reconcile.Request{
NamespacedName: types.NamespacedName{
Name: inst.Status.ActivePlan.Name,
Namespace: inst.Status.ActivePlan.Namespace,
},
})
} else {
log.Printf("PlanExecutionController: received event from Instance %s/%s but instance of that name does not exist", a.Meta.GetNamespace(), a.Meta.GetName())
}

// instance in instance -> reconcile plan for inner instance
inst := &kudov1alpha1.Instance{}
err = mgr.GetClient().Get(context.TODO(), client.ObjectKey{
Name: a.Meta.GetName(),
Namespace: a.Meta.GetNamespace(),
}, inst)

if err == nil {
// for every updated/added instance also trigger reconcile for its active plan
requests = append(requests, reconcile.Request{
NamespacedName: types.NamespacedName{
Name: inst.Status.ActivePlan.Name,
Namespace: inst.Status.ActivePlan.Namespace,
},
})
} else {
log.Printf("PlanExecutionController: received event from Instance %s/%s but instance of that name does not exist", a.Meta.GetNamespace(), a.Meta.GetName())
}

return requests
}),
},
Expand Down Expand Up @@ -313,6 +315,8 @@ func (r *ReconcilePlanExecution) Reconcile(request reconcile.Request) (reconcile
return reconcile.Result{}, err
}

log.Printf("Going to execute plan %s on instance %s", planExecution.Name, instance.Name)

// now we're actually starting with the execution of plan/phase/step
for i, phase := range planExecution.Status.Phases {
// If we still want to execute phases in this plan check if phase is healthy
Expand Down

0 comments on commit dd83ad0

Please sign in to comment.