Mark OpenShift test as an integration test (#870)

Signed-off-by: Matej Vasek <mvasek@redhat.com>
This commit is contained in:
Matej Vasek 2022-02-28 17:58:09 +01:00 committed by GitHub
parent 60dbeacc46
commit bea34d21a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -150,17 +150,16 @@ var checkOpenShiftOnce sync.Once
func IsOpenShift() bool {
checkOpenShiftOnce.Do(func() {
isOpenShift = false
client, err := k8s.NewKubernetesClientset()
if err != nil {
isOpenShift = false
return
}
_, err = client.CoreV1().Services("openshift-image-registry").Get(context.TODO(), "image-registry", metav1.GetOptions{})
if k8sErrors.IsNotFound(err) {
isOpenShift = false
if err == nil || k8sErrors.IsForbidden(err) {
isOpenShift = true
return
}
isOpenShift = true
})
return isOpenShift
}

View File

@ -1,3 +1,6 @@
//go:build integration
// +build integration
package openshift_test
import (