diff --git a/docs/build.md b/docs/build.md index 65fcc29d0..5af473b19 100644 --- a/docs/build.md +++ b/docs/build.md @@ -52,7 +52,7 @@ In order to prevent users from triggering `BuildRuns` (_execution of a Build_) t | SetOwnerReferenceFailed | Setting ownerreferences between a Build and a BuildRun failed. This is triggered when making use of the `build.shipwright.io/build-run-deletion` annotation in a Build. | | SpecSourceSecretNotFound | The secret used to authenticate to git doesn´t exist. | | SpecOutputSecretRefNotFound | The secret used to authenticate to the container registry doesn´t exist. | -| SpecRuntimeSecretRefNotFound | The secret used to authenticate to the container registry doesn´t exist.| +| SpecBuilderSecretRefNotFound | The secret used to authenticate to the container registry doesn´t exist.| | MultipleSecretRefNotFound | More than one secret is missing. At the moment, only three paths on a Build can specify a secret. | | RuntimePathsCanNotBeEmpty | The Runtime feature is used, but the runtime path was not defined. This is mandatory. | | RemoteRepositoryUnreachable | The defined `spec.source.url` was not found. This validation only take place for http/https protocols. | diff --git a/pkg/apis/build/v1alpha1/build_types.go b/pkg/apis/build/v1alpha1/build_types.go index 49b980fbc..64f77e8cf 100644 --- a/pkg/apis/build/v1alpha1/build_types.go +++ b/pkg/apis/build/v1alpha1/build_types.go @@ -26,8 +26,8 @@ const ( SpecSourceSecretRefNotFound BuildReason = "SpecSourceSecretRefNotFound" // SpecOutputSecretRefNotFound indicates the referenced secret in output is missing SpecOutputSecretRefNotFound BuildReason = "SpecOutputSecretRefNotFound" - // SpecRuntimeSecretRefNotFound indicates the referenced secret in runtime is missing - SpecRuntimeSecretRefNotFound BuildReason = "SpecRuntimeSecretRefNotFound" + // SpecBuilderSecretRefNotFound indicates the referenced secret in builder is missing + SpecBuilderSecretRefNotFound BuildReason = "SpecBuilderSecretRefNotFound" // MultipleSecretRefNotFound indicates that multiple secrets are missing MultipleSecretRefNotFound BuildReason = "MultipleSecretRefNotFound" // RuntimePathsCanNotBeEmpty indicates that the spec.runtime feature is used but the paths were not specified diff --git a/pkg/reconciler/build/build_test.go b/pkg/reconciler/build/build_test.go index 2ca1113a2..2ea9880d0 100644 --- a/pkg/reconciler/build/build_test.go +++ b/pkg/reconciler/build/build_test.go @@ -138,7 +138,7 @@ var _ = Describe("Reconcile Build", func() { } buildSample.Spec.Output.SecretRef = nil - statusCall := ctl.StubFunc(corev1.ConditionFalse, build.SpecRuntimeSecretRefNotFound, "referenced secret non-existing not found") + statusCall := ctl.StubFunc(corev1.ConditionFalse, build.SpecBuilderSecretRefNotFound, "referenced secret non-existing not found") statusWriter.UpdateCalls(statusCall) _, err := reconciler.Reconcile(request) diff --git a/pkg/validate/secrets.go b/pkg/validate/secrets.go index 7360ee67c..780e4ca0b 100644 --- a/pkg/validate/secrets.go +++ b/pkg/validate/secrets.go @@ -62,7 +62,7 @@ func (s SecretRef) buildSecretReferences() map[string]build.BuildReason { secretRefMap[s.Build.Spec.Source.SecretRef.Name] = build.SpecSourceSecretRefNotFound } if s.Build.Spec.BuilderImage != nil && s.Build.Spec.BuilderImage.SecretRef != nil && s.Build.Spec.BuilderImage.SecretRef.Name != "" { - secretRefMap[s.Build.Spec.BuilderImage.SecretRef.Name] = build.SpecRuntimeSecretRefNotFound + secretRefMap[s.Build.Spec.BuilderImage.SecretRef.Name] = build.SpecBuilderSecretRefNotFound } return secretRefMap } diff --git a/test/integration/build_to_secrets_test.go b/test/integration/build_to_secrets_test.go index 822f3be2e..396fc5242 100644 --- a/test/integration/build_to_secrets_test.go +++ b/test/integration/build_to_secrets_test.go @@ -309,7 +309,7 @@ var _ = Describe("Integration tests Build and referenced Secrets", func() { buildObject, err = tb.GetBuildTillRegistration(buildName, corev1.ConditionFalse) Expect(err).To(BeNil()) Expect(buildObject.Status.Registered).To(Equal(corev1.ConditionFalse)) - Expect(buildObject.Status.Reason).To(Equal(v1alpha1.SpecRuntimeSecretRefNotFound)) + Expect(buildObject.Status.Reason).To(Equal(v1alpha1.SpecBuilderSecretRefNotFound)) Expect(buildObject.Status.Message).To(Equal(fmt.Sprintf("referenced secret %s not found", buildObject.Spec.BuilderImage.SecretRef.Name))) }) @@ -330,7 +330,7 @@ var _ = Describe("Integration tests Build and referenced Secrets", func() { buildObject, err := tb.GetBuildTillValidation(buildName) Expect(err).To(BeNil()) Expect(buildObject.Status.Registered).To(Equal(corev1.ConditionFalse)) - Expect(buildObject.Status.Reason).To(Equal(v1alpha1.SpecRuntimeSecretRefNotFound)) + Expect(buildObject.Status.Reason).To(Equal(v1alpha1.SpecBuilderSecretRefNotFound)) Expect(buildObject.Status.Message).To(Equal(fmt.Sprintf("referenced secret %s not found", buildObject.Spec.BuilderImage.SecretRef.Name))) sampleSecret := tb.Catalog.SecretWithAnnotation(buildObject.Spec.BuilderImage.SecretRef.Name, buildObject.Namespace)