Skip to content

Commit

Permalink
Emit a better error when the lifecycle isn't ready
Browse files Browse the repository at this point in the history
Signed-off-by: Natalie Arellano <[email protected]>
  • Loading branch information
natalieparellano committed Jun 6, 2024
1 parent 905ea8e commit 5371322
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/reconciler/builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@ func (c *Reconciler) reconcileBuilder(ctx context.Context, builder *buildapi.Bui
return buildapi.BuilderRecord{}, err
}

if !clusterLifecycle.Status.GetCondition(corev1alpha1.ConditionReady).IsTrue() {
return buildapi.BuilderRecord{}, errors.Errorf("Error: clusterlifecycle '%s' is not ready", clusterLifecycle.Name)
}

builderKeychain, err := c.KeychainFactory.KeychainForSecretRef(ctx, registry.SecretRef{
ServiceAccount: builder.Spec.ServiceAccount(),
Namespace: builder.Namespace,
Expand Down
4 changes: 4 additions & 0 deletions pkg/reconciler/clusterbuilder/clusterbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ func (c *Reconciler) reconcileBuilder(ctx context.Context, builder *buildapi.Clu
return buildapi.BuilderRecord{}, err
}

if !clusterLifecycle.Status.GetCondition(corev1alpha1.ConditionReady).IsTrue() {
return buildapi.BuilderRecord{}, errors.Errorf("Error: clusterlifecycle '%s' is not ready", clusterLifecycle.Name)
}

builderKeychain, err := c.KeychainFactory.KeychainForSecretRef(ctx, registry.SecretRef{
ServiceAccount: builder.Spec.ServiceAccountRef.Name,
Namespace: builder.Spec.ServiceAccountRef.Namespace,
Expand Down

0 comments on commit 5371322

Please sign in to comment.