Skip to content

Commit

Permalink
Rename SpecRuntimeSecretRefNotFound -> SpecBuilderSecretRefNotFound
Browse files Browse the repository at this point in the history
  • Loading branch information
imjasonh committed Mar 21, 2021
1 parent 33cf526 commit ab84928
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/build/v1alpha1/build_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/build/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pkg/validate/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
4 changes: 2 additions & 2 deletions test/integration/build_to_secrets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)))

})
Expand All @@ -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)
Expand Down

0 comments on commit ab84928

Please sign in to comment.