-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is the initial test. Only works on tech-preview. Checks for presence of OLMv1 CRDs. Signed-off-by: Todd Short <[email protected]>
- Loading branch information
Showing
4 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
reviewers: | ||
- grokspawn | ||
- m1kola | ||
- everettraven | ||
- tmshort | ||
- perdasilva | ||
- LalatenduMohanty | ||
- dtfranz | ||
- anik120 | ||
- ankitathomas | ||
- joelanford | ||
approvers: | ||
- joelanford | ||
- perdasilva | ||
- m1kola | ||
- tmshort | ||
- grokspawn | ||
- LalatenduMohanty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package operatorsv1 | ||
|
||
import ( | ||
"fmt" | ||
|
||
g "github.com/onsi/ginkgo/v2" | ||
o "github.com/onsi/gomega" | ||
|
||
exutil "github.com/openshift/origin/test/extended/util" | ||
) | ||
|
||
const ( | ||
operatorsGroupName = "olm.operatorframework.io" | ||
) | ||
|
||
var _ = g.Describe("[sig-olmv1] OLMv1 CRDs", func() { | ||
defer g.GinkgoRecover() | ||
oc := exutil.NewCLIWithoutNamespace("default") | ||
|
||
g.It("should be installed", func(ctx g.SpecContext) { | ||
// Check for tech preview, if this is not tech preview, bail | ||
if !exutil.IsTechPreviewNoUpgrade(ctx, oc.AdminConfigClient()) { | ||
g.Skip("Test only runs in tech-preview") | ||
} | ||
|
||
// supports multiple versions during transision | ||
providedAPIs := []struct { | ||
group string | ||
version []string | ||
plural string | ||
}{ | ||
{ | ||
group: operatorsGroupName, | ||
version: []string{"v1alpha1", "v1"}, | ||
plural: "clusterextensions", | ||
}, | ||
{ | ||
group: operatorsGroupName, | ||
version: []string{"v1alpha1", "v1"}, | ||
plural: "clustercatalogs", | ||
}, | ||
} | ||
|
||
for _, api := range providedAPIs { | ||
g.By(fmt.Sprintf("checking %s at version %s [apigroup:%s]", api.plural, api.version, api.group)) | ||
// Ensure expected version exists in spec.versions and is both served and stored | ||
var err error | ||
var raw string | ||
for _, ver := range api.version { | ||
raw, err = oc.AsAdmin().Run("get").Args("crds", fmt.Sprintf("%s.%s", api.plural, api.group), fmt.Sprintf("-o=jsonpath={.spec.versions[?(@.name==\"%s\")]}", ver)).Output() | ||
if err == nil { | ||
break | ||
} | ||
} | ||
o.Expect(err).NotTo(o.HaveOccurred()) | ||
o.Expect(raw).To(o.MatchRegexp(`served.?:true`)) | ||
o.Expect(raw).To(o.MatchRegexp(`storage.?:true`)) | ||
} | ||
}) | ||
}) |
2 changes: 2 additions & 0 deletions
2
test/extended/util/annotate/generated/zz_generated.annotations.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.