Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require (
github.com/openshift/api v0.0.0-20251015135203-5d856d3e8354
github.com/openshift/client-go v0.0.0-20251015124057-db0dee36e235
github.com/operator-framework/api v0.41.0
github.com/operator-framework/operator-manifest-tools v0.11.0
github.com/operator-framework/operator-manifest-tools v0.12.0
github.com/shurcooL/graphql v0.0.0-20230722043721-ed46e5a46466
github.com/sirupsen/logrus v1.9.4
github.com/spf13/afero v1.15.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ github.com/openshift/client-go v0.0.0-20251015124057-db0dee36e235 h1:9JBeIXmnHlp
github.com/openshift/client-go v0.0.0-20251015124057-db0dee36e235/go.mod h1:L49W6pfrZkfOE5iC1PqEkuLkXG4W0BX4w8b+L2Bv7fM=
github.com/operator-framework/api v0.41.0 h1:B0nutndl95elbLXJGRlkFNTI8OuZIjSqvTEeORPhTKo=
github.com/operator-framework/api v0.41.0/go.mod h1:Ouud+eqruzll9X3iv8wuAOTNAyyEncYXp4IVgbIlIdg=
github.com/operator-framework/operator-manifest-tools v0.11.0 h1:4qJ6c2XqPSKzlqyyM41bCEfN/+tYQsDwWckW0vL8rlk=
github.com/operator-framework/operator-manifest-tools v0.11.0/go.mod h1:Tp0cSG7X7/6k6tmKLeEpPq5f1fw6RiqwyfoNIWOz6v8=
github.com/operator-framework/operator-manifest-tools v0.12.0 h1:RZU49mLdyHv2C9OMXuQXMYteKan6LahX5P66r1iLrYw=
github.com/operator-framework/operator-manifest-tools v0.12.0/go.mod h1:Qe6H69HTSnzdMZxDZ584yQAr/+hQwEeEZI0NwmHbigg=
github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=
github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
Expand Down
26 changes: 26 additions & 0 deletions internal/policy/operator/certified_images_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,5 +215,31 @@ spec:
Expect(result).To(BeFalse())
})
})
When("the CSV has empty relatedImages entries", func() {
It("should handle gracefully without panicking", func() {
csvContents := `kind: ClusterServiceVersion
apiVersion: operators.coreos.com/v1alpha1
spec:
install:
spec:
deployments:
- spec:
template:
spec:
containers:
- image: registry.example.io/foo/bar@sha256:f000432f07cd187469f0310e3ed9dcf9a5db2be14b8bab9c5293dd1ee8518176
name: the-operator
relatedImages:
- name: the-operator
image: registry.example.io/foo/bar@sha256:f000432f07cd187469f0310e3ed9dcf9a5db2be14b8bab9c5293dd1ee8518176
- name: ''
image: ''`
Expect(os.WriteFile(filepath.Join(imageRef.ImageFSPath, manifestsDir, clusterServiceVersionFilename), []byte(csvContents), 0o644)).To(Succeed())
result, err := certifiedImagesCheck.Validate(context.TODO(), imageRef)
Expect(err).ToNot(HaveOccurred())
Expect(result).To(BeFalse())
Expect(certifiedImagesCheck.nonCertifiedImages).To(HaveLen(1))
})
})
AssertMetaData(certifiedImagesCheck)
})