Skip to content

Commit

Permalink
MGMT-19708: Add unit tests for pull secret validation
Browse files Browse the repository at this point in the history
  • Loading branch information
CrystalChun committed Jan 17, 2025
1 parent e70e9a8 commit 72bda3b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/cluster/validations/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,14 @@ var _ = Describe("Pull secret validation", func() {
Expect(err).ShouldNot(HaveOccurred())
})

It("pull secret accepted when it doesn't contain auths for additional ignored registries", func() {
validator, err := NewPullSecretValidator(map[string]bool{}, authHandlerDisabled, "quay.io/testing:latest", "ignore.com/image:v1")
Expect(err).ShouldNot(HaveOccurred())
additionalIgnoredRegistries = []string{"ignore.com"}
err = validator.ValidatePullSecret(additionalIgnoredRegistries, validSecretFormat, "", "")
Expect(err).ShouldNot(HaveOccurred())
})

It("pull secret accepted when release image is specified and its registry credentials exists", func() {
publicRegistries := map[string]bool{}
validator, err := NewPullSecretValidator(publicRegistries, authHandlerDisabled, "quay.io/testing:latest")
Expand Down

0 comments on commit 72bda3b

Please sign in to comment.