-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
22 changed files
with
1,331 additions
and
432 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
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
68 changes: 68 additions & 0 deletions
68
tests/system-tests/vcore/internal/config-files/clo-instance.yaml
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,68 @@ | ||
apiVersion: logging.openshift.io/v1 | ||
kind: ClusterLogging | ||
metadata: | ||
name: "{{ .ClusterLoggingName }}" | ||
namespace: "{{ .ClusterLoggingNamespace }}" | ||
spec: | ||
collection: | ||
fluentd: | ||
resources: | ||
limits: | ||
memory: 2Gi | ||
requests: | ||
cpu: 100m | ||
memory: 1Gi | ||
tolerations: | ||
- effect: NoSchedule | ||
key: node-role.kubernetes.io/master | ||
operator: Exists | ||
type: fluentd | ||
curation: | ||
curator: | ||
schedule: 30 * * * * | ||
type: curator | ||
logStore: | ||
elasticsearch: | ||
nodeCount: {{ .NodeCount }} | ||
nodeSelector: | ||
node-role.kubernetes.io/master: '' | ||
redundancyPolicy: SingleRedundancy | ||
resources: | ||
limits: | ||
cpu: 8 | ||
memory: 64Gi | ||
requests: | ||
cpu: 8 | ||
memory: 64Gi | ||
storage: | ||
size: 150Gi | ||
storageClassName: ocs-storagecluster-cephfs | ||
tolerations: | ||
- effect: NoSchedule | ||
key: node-role.kubernetes.io/master | ||
operator: Exists | ||
retentionPolicy: | ||
application: | ||
maxAge: 1d | ||
audit: | ||
maxAge: 7d | ||
infra: | ||
maxAge: 7d | ||
type: elasticsearch | ||
managementState: Managed | ||
visualization: | ||
kibana: | ||
nodeSelector: | ||
node-role.kubernetes.io/master: '' | ||
replicas: 1 | ||
resources: | ||
limits: | ||
memory: 2Gi | ||
requests: | ||
cpu: 1 | ||
memory: 2Gi | ||
tolerations: | ||
- effect: NoSchedule | ||
key: node-role.kubernetes.io/master | ||
operator: Exists | ||
type: kibana |
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
120 changes: 120 additions & 0 deletions
120
tests/system-tests/vcore/internal/vcorecommon/helper.go
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,120 @@ | ||
package vcorecommon | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"time" | ||
|
||
"github.com/golang/glog" | ||
"github.com/onsi/gomega" | ||
"github.com/openshift-kni/eco-goinfra/pkg/namespace" | ||
"github.com/openshift-kni/eco-gotests/tests/system-tests/internal/mirroring" | ||
"github.com/openshift-kni/eco-gotests/tests/system-tests/internal/platform" | ||
"github.com/openshift-kni/eco-gotests/tests/system-tests/vcore/internal/vcoreinittools" | ||
"github.com/openshift-kni/eco-gotests/tests/system-tests/vcore/internal/vcoreparams" | ||
"k8s.io/apimachinery/pkg/util/wait" | ||
) | ||
|
||
func getImageURL(repository, name, tag string) (string, error) { | ||
imageURL := fmt.Sprintf("%s/%s", repository, name) | ||
|
||
isDisconnected, err := platform.IsDisconnectedDeployment(vcoreinittools.APIClient) | ||
|
||
if err != nil { | ||
return "", err | ||
} | ||
|
||
if !isDisconnected { | ||
glog.V(vcoreparams.VCoreLogLevel).Info("The connected deployment type was detected, " + | ||
"the images mirroring is not required") | ||
} else { | ||
glog.V(vcoreparams.VCoreLogLevel).Infof("Mirror image %s:%s locally", imageURL, tag) | ||
|
||
imageURL, _, err = mirroring.MirrorImageToTheLocalRegistry( | ||
vcoreinittools.APIClient, | ||
repository, | ||
name, | ||
tag, | ||
vcoreinittools.VCoreConfig.Host, | ||
vcoreinittools.VCoreConfig.User, | ||
vcoreinittools.VCoreConfig.Pass, | ||
vcoreinittools.VCoreConfig.CombinedPullSecretFile, | ||
vcoreinittools.VCoreConfig.RegistryRepository) | ||
|
||
if err != nil { | ||
return "", fmt.Errorf("failed to mirror image %s:%s locally due to %w", | ||
name, tag, err) | ||
} | ||
} | ||
|
||
return fmt.Sprintf("%s:%s", imageURL, tag), nil | ||
} | ||
|
||
func insureNamespaceNotExists(nsName string) bool { | ||
watchNamespace := namespace.NewBuilder(vcoreinittools.APIClient, nsName) | ||
if watchNamespace.Exists() { | ||
err := watchNamespace.Delete() | ||
gomega.Expect(err).ToNot(gomega.HaveOccurred(), | ||
fmt.Sprintf("Failed to delete watch namespace %s due to: %v", | ||
vcoreparams.KedaWatchNamespace, err)) | ||
|
||
err = wait.PollUntilContextTimeout( | ||
context.TODO(), | ||
time.Second, | ||
time.Minute*10, | ||
true, | ||
func(ctx context.Context) (bool, error) { | ||
isExists := watchNamespace.Exists() | ||
|
||
if !isExists { | ||
return true, nil | ||
} | ||
|
||
return false, nil | ||
}) | ||
gomega.Expect(err).ToNot(gomega.HaveOccurred(), | ||
fmt.Sprintf("Failed to delete watch namespace %s due to: %v", | ||
vcoreparams.KedaWatchNamespace, err)) | ||
} | ||
|
||
return true | ||
} | ||
|
||
func insureNamespaceExists(nsName string) bool { | ||
glog.V(vcoreparams.VCoreLogLevel).Infof("Insure namespace %q exists", nsName) | ||
|
||
createNs := namespace.NewBuilder(vcoreinittools.APIClient, nsName) | ||
|
||
if !createNs.Exists() { | ||
createNs, err := createNs.Create() | ||
|
||
if err != nil { | ||
glog.V(vcoreparams.VCoreLogLevel).Infof("Error creating namespace %q: %v", nsName, err) | ||
|
||
return false | ||
} | ||
|
||
err = wait.PollUntilContextTimeout( | ||
context.TODO(), | ||
time.Second, | ||
3*time.Second, | ||
true, | ||
func(ctx context.Context) (bool, error) { | ||
if !createNs.Exists() { | ||
glog.V(vcoreparams.VCoreLogLevel).Infof("Error creating namespace %q", nsName) | ||
|
||
return false, nil | ||
} | ||
|
||
glog.V(vcoreparams.VCoreLogLevel).Infof("Created namespace %q", createNs.Definition.Name) | ||
|
||
return true, nil | ||
}) | ||
|
||
if err != nil { | ||
return false | ||
} | ||
} | ||
|
||
return true | ||
} |
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
Oops, something went wrong.