Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable status subresource for integration context #456

Merged
merged 1 commit into from
Feb 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions deploy/crd-integration-context.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ spec:
group: camel.apache.org
scope: Namespaced
version: v1alpha1
subresources:
status: {}
names:
kind: IntegrationContext
listKind: IntegrationContextList
Expand Down
2 changes: 2 additions & 0 deletions deploy/resources.go

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

6 changes: 3 additions & 3 deletions pkg/controller/integrationcontext/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func (action *buildAction) handleBuildStateChange(ctx context.Context, res *buil

action.L.Info("IntegrationContext state transition", "phase", target.Status.Phase)

return action.client.Update(ctx, target)
return action.client.Status().Update(ctx, target)
case builder.StatusError:
// we should ensure that the integration context is still in the right
// phase, if not there is a chance that the context has been modified
Expand Down Expand Up @@ -188,7 +188,7 @@ func (action *buildAction) handleBuildStateChange(ctx context.Context, res *buil

action.L.Error(res.Error, "IntegrationContext state transition", "phase", target.Status.Phase)

return action.client.Update(ctx, target)
return action.client.Status().Update(ctx, target)
case builder.StatusCompleted:
// we should ensure that the integration context is still in the right
// phase, if not there is a chance that the context has been modified
Expand Down Expand Up @@ -220,7 +220,7 @@ func (action *buildAction) handleBuildStateChange(ctx context.Context, res *buil
}

action.L.Info("IntegrationContext state transition", "phase", target.Status.Phase)
if err := action.client.Update(ctx, target); err != nil {
if err := action.client.Status().Update(ctx, target); err != nil {
return err
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/integrationcontext/build_failure_recovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (action *errorRecoveryAction) Handle(ctx context.Context, ictx *v1alpha1.In

action.L.Info("Max recovery attempt reached, transition to error phase")

return action.client.Update(ctx, target)
return action.client.Status().Update(ctx, target)
}

if ictx.Status.Failure != nil {
Expand Down Expand Up @@ -98,7 +98,7 @@ func (action *errorRecoveryAction) Handle(ctx context.Context, ictx *v1alpha1.In
target.Status.Failure.Recovery.AttemptMax,
)

return action.client.Update(ctx, target)
return action.client.Status().Update(ctx, target)
}

return nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/integrationcontext/initialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,5 @@ func (action *initializeAction) Handle(ctx context.Context, ictx *v1alpha1.Integ

action.L.Info("IntegrationContext state transition", "phase", target.Status.Phase)

return action.client.Update(ctx, target)
return action.client.Status().Update(ctx, target)
}
2 changes: 1 addition & 1 deletion pkg/controller/integrationcontext/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (action *monitorAction) Handle(ctx context.Context, ictx *v1alpha1.Integrat

action.L.Info("IntegrationContext state transition", "phase", target.Status.Phase)

return action.client.Update(ctx, target)
return action.client.Status().Update(ctx, target)
}

return nil
Expand Down