diff --git a/pkg/reconciler/builder/builder.go b/pkg/reconciler/builder/builder.go index 169b4db36..115a016ac 100644 --- a/pkg/reconciler/builder/builder.go +++ b/pkg/reconciler/builder/builder.go @@ -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, diff --git a/pkg/reconciler/clusterbuilder/clusterbuilder.go b/pkg/reconciler/clusterbuilder/clusterbuilder.go index f9839370f..a7e52c6f2 100644 --- a/pkg/reconciler/clusterbuilder/clusterbuilder.go +++ b/pkg/reconciler/clusterbuilder/clusterbuilder.go @@ -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,