compat_otp

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2026 License: Apache-2.0 Imports: 183 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MachineAPINamespace = "openshift-machine-api"
	//MapiMachineset means the fullname of mapi machineset
	MapiMachineset = "machinesets.machine.openshift.io"
	//MapiMachine means the fullname of mapi machine
	MapiMachine = "machines.machine.openshift.io"
)

We are no longer updating this file because we deprecated it, the new file is test/extended/util/clusterinfra/machine_helpers.go This file is not deleted because there are some old dependencies

View Source
const (
	CoreOSBootImagesFile                      = "0000_50_installer_coreos-bootimages.yaml"
	CoreOSBootImageArchX86_64 CoreOSImageArch = "x86_64"

	ReleaseImageLatestEnv = "RELEASE_IMAGE_LATEST"
)
View Source
const (
	AsAdmin          = true
	AsUser           = false
	WithoutNamespace = true
	WthNamespace     = false
	Immediately      = true
	NotImmediately   = false
	AllowEmpty       = true
	NotAllowEmpty    = false
	Appear           = true
	Disappear        = false
)
View Source
const (
	EnvIsExternalOIDCCluster = "ENV_IS_EXTERNAL_OIDC_CLUSTER"
	EnvIsKubernetesCluster   = "ENV_IS_KUBERNETES_CLUSTER"
)
View Source
const (
	TestEnvProw TestEnvType = 1 << iota
	TestEnvJenkins
	TestEnvLocal

	ArtifactDirEnvProw = "ARTIFACT_DIR"

	PullSecretDirEnvProw       = "CLUSTER_PROFILE_DIR"
	PullSecretFileNameProw     = "pull-secret"
	PullSecretLocationEnvLocal = "PULL_SECRET_LOCATION"
)
View Source
const (
	BMPoweredOn  = "poweredon"
	BMPoweredOff = "poweredoff"
)
View Source
const (
	PropRuntimePowerState = "summary.runtime.powerState"
	PropConfigTemplate    = "summary.config.template"
)

A creating represents constants ...

View Source
const (
	AKSNodeLabel = "kubernetes.azure.com/cluster"
)
View Source
const (
	AzureCredsLocationEnv = "AZURE_AUTH_LOCATION"
)
View Source
const (
	// This image is used for both client and server pods. Temporary repo location.
	OpenLDAPTestImage = "docker.io/mrogers950/origin-openldap-test:fedora29"
)

Variables

View Source
var (
	IsExternalOIDCClusterFlag = ""
	IsKubernetesClusterFlag   = ""
)

Functions

func AddAnnotationsToSpecificResource

func AddAnnotationsToSpecificResource(oc *exutil.CLI, resourceKindAndName, resourceNamespace string, annotations ...string) (string, error)

AddAnnotationsToSpecificResource adds the custom annotations to the specific resource

func AddLabelToNode

func AddLabelToNode(oc *exutil.CLI, node string, label string, value string) (string, error)

AddLabelToNode add the custom label to the node

func AddLabelsToSpecificResource

func AddLabelsToSpecificResource(oc *exutil.CLI, resourceKindAndName string, resourceNamespace string, labels ...string) (string, error)

AddLabelsToSpecificResource adds the custom labels to the specific resource

func AnnotateTestSuite

func AnnotateTestSuite()

func ApplyClusterResourceFromTemplate

func ApplyClusterResourceFromTemplate(oc *exutil.CLI, parameters ...string)

ApplyClusterResourceFromTemplate apply the changes to the cluster resource. For ex: ApplyClusterResourceFromTemplate(oc, "--ignore-unknown-parameters=true", "-f", "TEMPLATE LOCATION")

func ApplyClusterResourceFromTemplateWithError

func ApplyClusterResourceFromTemplateWithError(oc *exutil.CLI, parameters ...string) error

ApplyClusterResourceFromTemplateWithError apply the changes to the cluster resource and return error if happned. For ex: ApplyClusterResourceFromTemplateWithError(oc, "--ignore-unknown-parameters=true", "-f", "TEMPLATE LOCATION")

func ApplyNsResourceFromTemplate

func ApplyNsResourceFromTemplate(oc *exutil.CLI, namespace string, parameters ...string)

ApplyNsResourceFromTemplate apply changes to the ns resource. No need to add a namespace parameter in the template file as it can be provided as a function argument. For ex: ApplyNsResourceFromTemplate(oc, "NAMESPACE", "--ignore-unknown-parameters=true", "-f", "TEMPLATE LOCATION")

func ApplyOperatorResourceByYaml

func ApplyOperatorResourceByYaml(oc *exutil.CLI, namespace string, yamlfile string)

ApplyOperatorResourceByYaml - It's not a template yaml file, the yaml shouldn't include namespace, we specify namespace by parameter.

func ApplyResourceFromTemplateWithNonAdminUser

func ApplyResourceFromTemplateWithNonAdminUser(oc *exutil.CLI, parameters ...string) error

ApplyResourceFromTemplateWithNonAdminUser to as normal user to create resource from template

func ArchiveMustGatherFile

func ArchiveMustGatherFile(oc *exutil.CLI, addExtraContent func(*exutil.CLI, string) error) error

ArchiveMustGatherFile creates a must-gather file to be archived by the CI prow job The addExtraContent function can be provided to add extra content to the must-gather file. Set it to nil if no extra content is needed. Conditions to generate a must-gather file: - The QE_MUST_GATHER_DIR environment variable must be defined and pointing to a valid directory. - The directory defined in the QE_MUST_GATHER_DIR env var must not contain more than 500M, including the must-gather file that is being generated. - A maximum of 2 must-gather files are allowed per prow job execution. If more that 2 test cases try to create a must-gather file in a the same prow job execution, only 2 must-gather files will be created and the rest will be ignored. - One test case can only create one must-gather file

func ArtifactDirPath

func ArtifactDirPath() string

ArtifactDirPath returns the value of ARTIFACT_DIR environment variable

func ArtifactPath

func ArtifactPath(elem ...string) string

ArtifactPath returns the absolute path to the fix artifact file The path is relative to ARTIFACT_DIR

func AssertAllNonJobPodsToBeReadyWithPollerParams

func AssertAllNonJobPodsToBeReadyWithPollerParams(oc *exutil.CLI, namespace string, interval, timeout time.Duration)

AssertAllNonJobPodsToBeReadyWithPollerParams assert all non-Job pods in NS are in ready state until timeout in a given namespace Exclude transient Job pods ('job-name') from readiness: build Job pods are short‑lived and not expected to be Ready=True, so including them causes false failure we validate the Job via logs/conditions separately, and this gate only asserts persistent controller pods (e.g., machine‑os‑builder) are Ready.

func AssertAllPodsToBeReady

func AssertAllPodsToBeReady(oc *exutil.CLI, namespace string)

AssertAllPodsToBeReady assert all pods in NS are in ready state until timeout in a given namespace

func AssertAllPodsToBeReadyWithPollerParams

func AssertAllPodsToBeReadyWithPollerParams(oc *exutil.CLI, namespace string, interval, timeout time.Duration)

AssertAllPodsToBeReadyWithPollerParams assert all pods in NS are in ready state until timeout in a given namespace Pros: allow user to customize poller parameters

func AssertIfMCPChangesAppliedByName

func AssertIfMCPChangesAppliedByName(oc *exutil.CLI, mcpName string, timeDurationSec int)

AssertIfMCPChangesAppliedByName checks the MCP of a given oc client and determines if the machine counts are as expected

func AssertIfNodePoolIsReadyByName

func AssertIfNodePoolIsReadyByName(oc *exutil.CLI, nodePoolName string, timeDurationSec int, clustersNS string)

AssertIfNodePoolIsReadyByName checks if the Nodepool is ready

func AssertIfNodePoolUpdatingConfigByName

func AssertIfNodePoolUpdatingConfigByName(oc *exutil.CLI, nodePoolName string, timeDurationSec int, clustersNS string)

AssertIfNodePoolUpdatingConfigByName checks if the Nodepool is ready

func AssertOprPodLogsbyFilter

func AssertOprPodLogsbyFilter(oc *exutil.CLI, podName string, namespace string, filter string, minimalMatch int) bool

AssertOprPodLogsbyFilter trunct pods logs by filter

func AssertOprPodLogsbyFilterWithDuration

func AssertOprPodLogsbyFilterWithDuration(oc *exutil.CLI, podName string, namespace string, filter string, timeDurationSec int, minimalMatch int)

AssertOprPodLogsbyFilterWithDuration used for truncting pods logs by filter

func AssertOrCheckMCP

func AssertOrCheckMCP(oc *exutil.CLI, mcp string, interval, timeout time.Duration, skip bool) error

func AssertPodToBeReady

func AssertPodToBeReady(oc *exutil.CLI, podName string, namespace string)

AssertPodToBeReady poll pod status to determine it is ready

func AssertWaitPollNoErr

func AssertWaitPollNoErr(e error, msg string)

func AssertWaitPollWithErr

func AssertWaitPollWithErr(e error, msg string)

func AzureCredentialsStructToString

func AzureCredentialsStructToString[T any](s T) string

func BASE64DecodeStr

func BASE64DecodeStr(src string) string

BASE64DecodeStr Base64 Decode

func By

func By(text string)

when 4.14 synch with k1.27, there is gingkgo upgrade from 2.4 to 26 By method changes and it does not print "STEP:" information. some tester want to use it. so, make this wrapper to print if you want to get "STEP:", you need to change g.By to exutil.By text is the string you want to describe the step.

func CPUManagerStatebyNode

func CPUManagerStatebyNode(oc *exutil.CLI, namespace string, nodeName string, ContainerName string) (string, string)

func CalculatePodMetrics

func CalculatePodMetrics(adminClient kubernetes.Interface, adminConfig *restclient.Config) error

CalculatePodMetrics receives an admin client and an admin.kubeconfig, and traverses a list of operator namespaces, measuring requests-per-second for each operator pod, using the overall long-running time of each pod as a base metric.

func CanArchiveMustGather

func CanArchiveMustGather() (float64, error)

CanArchiveMustGather returns the number of megas in the artifacts directory and and error if the must-gather file cannot be created

func CheckAKSCluster

func CheckAKSCluster(ctx context.Context, oc *exutil.CLI) bool

func CheckAllNodepoolReadyByHostedClusterName

func CheckAllNodepoolReadyByHostedClusterName(oc *exutil.CLI, nodePoolName, hostedClusterNS string, timeDurationSec int) bool

CheckAllNodepoolReadyByHostedClusterName used for checking if all nodepool is ready eg. CheckAllNodepoolReadyByHostedClusterName(oc, psap-qe-hcluster01,clusters,3600)

func CheckAppearance

func CheckAppearance(oc *exutil.CLI, interval, timeout time.Duration, immediately, asAdmin, withoutNamespace, appear bool, parameters ...string) bool

CheckAppearance check if the resource appears or not. interval and timeout is the inveterl and timeout of Poll immediately means if it wait first interval and then check asAdmin means oc.AsAdmin() or not withoutNamespace means oc.WithoutNamespace() or not. appear means expect appear or not for example, expect pod in ns appear CheckAppearance(oc, 4*time.Second, 200*time.Second, exutil.NotImmediately, exutil.AsAdmin, exutil.WithoutNamespace, exutil.Appear, "-n", ns, "pod" name) if you expect pod in ns disappear, could be CheckAppearance(oc, 4*time.Second, 200*time.Second, exutil.NotImmediately, exutil.AsAdmin, exutil.WithoutNamespace, exutil.Disappear, "-n", ns, "pod" name)

func CheckBuildCancelled

func CheckBuildCancelled(b *buildv1.Build) bool

CheckBuildCancelled return true if the build was canceled

func CheckBuildFailed

func CheckBuildFailed(b *buildv1.Build) bool

CheckBuildFailed return true if the build failed

func CheckBuildSuccess

func CheckBuildSuccess(b *buildv1.Build) bool

CheckBuildSuccess returns true if the build succeeded

func CheckForBuildEvent

func CheckForBuildEvent(client corev1client.CoreV1Interface, build *buildv1.Build, reason, message string)

CheckForBuildEvent will poll a build for up to 1 minute looking for an event with the specified reason and message template.

func CheckHypershiftOperatorExistence

func CheckHypershiftOperatorExistence(mgmtOC *exutil.CLI) (bool, error)

func CheckImageStreamLatestTagPopulated

func CheckImageStreamLatestTagPopulated(i *imagev1.ImageStream) bool

CheckImageStreamLatestTagPopulated returns true if the imagestream has a ':latest' tag filed

func CheckImageStreamTagNotFound

func CheckImageStreamTagNotFound(i *imagev1.ImageStream) bool

CheckImageStreamTagNotFound return true if the imagestream update was not successful

func CheckNetworkOperatorStatus

func CheckNetworkOperatorStatus(oc *exutil.CLI) error

check until CNO operator status reports True, False, False for Available, Progressing, Degraded status,

func CheckNetworkType

func CheckNetworkType(oc *exutil.CLI) string

func CheckPlatform

func CheckPlatform(oc *exutil.CLI) string

CheckPlatform check the cluster's platform

func CheckPodIsReady

func CheckPodIsReady(pod kapiv1.Pod) bool

CheckPodIsReady returns true if the pod's ready probe determined that the pod is ready.

func CheckPodIsRunning

func CheckPodIsRunning(pod kapiv1.Pod) bool

CheckPodIsRunning returns true if the pod is running

func CheckPodIsSucceeded

func CheckPodIsSucceeded(pod kapiv1.Pod) bool

CheckPodIsSucceeded returns true if the pod status is "Succdeded"

func CheckPodNoOp

func CheckPodNoOp(pod kapiv1.Pod) bool

CheckPodNoOp always returns true

func CleanupOperatorResourceByYaml

func CleanupOperatorResourceByYaml(oc *exutil.CLI, namespace string, yamlfile string)

CleanupOperatorResourceByYaml - It's not a template yaml file, the yaml shouldn't include namespace, we specify namespace by parameter.

func CleanupResource

func CleanupResource(oc *exutil.CLI, interval, timeout time.Duration, asAdmin, withoutNamespace bool, parameters ...string)

CleanupResource cleanup one resouce and check if it is not found. interval and timeout is the inveterl and timeout of Poll to check if it is not found asAdmin means oc.AsAdmin() or not withoutNamespace means oc.WithoutNamespace() or not. for example, cleanup cluster level resource CleanupResource(oc, 4*time.Second, 160*time.Second, exutil.AsAdmin, exutil.WithoutNamespace, "operator.operators.operatorframework.io", operator.Name) cleanup ns resource CleanupResource(oc, 4*time.Second, 160*time.Second, exutil.AsAdmin, exutil.WithoutNamespace, "-n", ns, "pod" name)

func CompareMachineCreationTime

func CompareMachineCreationTime(oc *exutil.CLI, ms1 string, ms2 string) bool

func ContainsAll

func ContainsAll(big, small map[string]interface{}) bool

ContainsAll checks if all keys and values in small are also in the big map.

func ConvertStrToJson

func ConvertStrToJson(str string) (map[string]interface{}, error)

ConvertStrToJson converts a JSON format string to data structure of map[string]interface{}

func CountLinuxWorkerNodeNumByOS

func CountLinuxWorkerNodeNumByOS(oc *exutil.CLI) (linuxNum int)

CountNodeNumByOS used for count how many worker node by windows or linux

func CountNodeNumByOS

func CountNodeNumByOS(oc *exutil.CLI) (linuxNum int, windowsNum int)

CountNodeNumByOS used for count how many worker node by windows or linux

func CreateAzureContainerRegistry

func CreateAzureContainerRegistry(sess *AzureSession, registryName string, resourceGroupName string, location string) error

CreateAzureContainerRegistry create azure container registry

func CreateAzureStorageBlobContainer

func CreateAzureStorageBlobContainer(container azblob.ContainerURL) error

CreateAzureStorageBlobContainer creates azure storage container

func CreateCentosExecPodOrFail

func CreateCentosExecPodOrFail(client kubernetes.Interface, ns, generateName string, tweak func(*v1.Pod)) *v1.Pod

CreateCentosExecPodOrFail creates a centos:7 pause pod used as a vessel for kubectl exec commands. Pod name is uniquely generated.

func CreateClusterResourceFromTemplate

func CreateClusterResourceFromTemplate(oc *exutil.CLI, parameters ...string)

CreateClusterResourceFromTemplate create resource from the template. For ex: CreateClusterResourceFromTemplate(oc, "--ignore-unknown-parameters=true", "-f", "TEMPLATE LOCATION")

func CreateClusterResourceFromTemplateWithError

func CreateClusterResourceFromTemplateWithError(oc *exutil.CLI, parameters ...string) error

CreateClusterResourceFromTemplateWithError create resource from the template and return error if happened. For ex: CreateClusterResourceFromTemplateWithError(oc, "--ignore-unknown-parameters=true", "-f", "TEMPLATE LOCATION")

func CreateCustomNodePoolInHypershift

func CreateCustomNodePoolInHypershift(oc *exutil.CLI, cloudProvider, guestClusterName, nodePoolName, nodeCount, instanceType, upgradeType, clustersNS, defaultNodePoolName string)

CreateCustomNodePoolInHypershift retrun custom nodepool yaml

func CreateExecPodOrFail

func CreateExecPodOrFail(client corev1client.CoreV1Interface, ns, name string) string

CreateExecPodOrFail creates a simple busybox pod in a sleep loop used as a vessel for kubectl exec commands. Returns the name of the created pod. TODO: expose upstream

func CreateGCSBucket

func CreateGCSBucket(projectID, bucketName string) error

CreateGCSBucket creates a GCS bucket in a project

func CreateLDAPTestServer

func CreateLDAPTestServer(oc *exutil.CLI) (string, []byte, error)

CreateLDAPTestServer deploys an LDAP server on the service network and then confirms StartTLS connectivity with an ldapsearch against it. It returns the ldapserver host and the ldap CA, or an error.

func CreateMachinesetbyInstanceType

func CreateMachinesetbyInstanceType(oc *exutil.CLI, machinesetName string, instanceType string)

CreateMachinesetbyInstanceType used to create a machineset with specified machineset name and instance type

func CreateNFDInstance

func CreateNFDInstance(oc *exutil.CLI, namespace string)

CreateNFDInstance used for create NFD Instance in different namespace

func CreateNsResourceFromTemplate

func CreateNsResourceFromTemplate(oc *exutil.CLI, namespace string, parameters ...string)

CreateNsResourceFromTemplate create ns resource from the template. No need to add a namespace parameter in the template file as it can be provided as a function argument. For ex: CreateNsResourceFromTemplate(oc, "NAMESPACE", "--ignore-unknown-parameters=true", "-f", "TEMPLATE LOCATION")

func CreateOpenStackContainer

func CreateOpenStackContainer(client *gophercloud.ServiceClient, name string) error

CreateOpenStackContainer creates a storage container in openstack

func CreateResource

func CreateResource(jsonFilePath string, oc *exutil.CLI) error

CreateResource creates the resources from the supplied json file (not a template); ginkgo error checking included

func CreateServiceAccount

func CreateServiceAccount(oc *exutil.CLI, account string, clusterRole string) (token string, err error)

CreateServiceAccount @Description Create a service account when it does not exist @Create jianl Jul 2 2025 @Param oc exCLI oc client instance @Param account string The service account name @Param clusterRole string The cluster role that the service account will be added to @Return (account token, error)

func DebugNode

func DebugNode(oc *exutil.CLI, nodeName string, cmd ...string) (string, error)

DebugNode creates a debugging session of the node

func DebugNodeRetryWithOptionsAndChroot

func DebugNodeRetryWithOptionsAndChroot(oc *exutil.CLI, nodeName string, options []string, cmd ...string) (string, error)

DebugNodeRetryWithOptionsAndChroot launches debug container using chroot and with options And waitPoll to avoid "error: unable to create the debug pod" and do retry

func DebugNodeRetryWithOptionsAndChrootWithStdErr

func DebugNodeRetryWithOptionsAndChrootWithStdErr(oc *exutil.CLI, nodeName string, options []string, cmd ...string) (string, string, error)

DebugNodeRetryWithOptionsAndChroot launches debug container using chroot and with options And waitPoll to avoid "error: unable to create the debug pod" and do retry Separate the Warning from Output: metadata.name: this is used in the Pod's hostname, which can result in surprising behavior; a DNS label is recommended: [must be no more than 63 characters]\ndevice name 'Warning: metadata.name: this is used in the Pod's hostname, which can result in surprising behavior; a DNS label is recommended: [must be no more than 63 characters]' longer than 127 characters\nerror: non-zero exit code from debug container

func DebugNodeWithChroot

func DebugNodeWithChroot(oc *exutil.CLI, nodeName string, cmd ...string) (string, error)

DebugNodeWithChroot creates a debugging session of the node with chroot

func DebugNodeWithOptions

func DebugNodeWithOptions(oc *exutil.CLI, nodeName string, options []string, cmd ...string) (string, error)

DebugNodeWithOptions launches debug container with options e.g. --image

func DebugNodeWithOptionsAndChroot

func DebugNodeWithOptionsAndChroot(oc *exutil.CLI, nodeName string, options []string, cmd ...string) (string, error)

DebugNodeWithOptionsAndChroot launches debug container using chroot and with options e.g. --image

func DebugNodeWithOptionsAndChrootWithoutRecoverNsLabel

func DebugNodeWithOptionsAndChrootWithoutRecoverNsLabel(oc *exutil.CLI, nodeName string, options []string, cmd ...string) (stdOut string, stdErr string, err error)

DebugNodeWithOptionsAndChrootWithoutRecoverNsLabel launches debug container using chroot and with options e.g. --image WithoutRecoverNsLabel which will not recover the labels that added for debug node container adapt the podSecurity changed on 4.12+ test clusters "security.openshift.io/scc.podSecurityLabelSync=false" And "pod-security.kubernetes.io/enforce=privileged"

func DeleteAzureContainerRegistry

func DeleteAzureContainerRegistry(sess *AzureSession, registryName string, resourceGroupName string) error

DeleteAzureContainerRegistry deletes azure container registry

func DeleteAzureStorageBlobContainer

func DeleteAzureStorageBlobContainer(container azblob.ContainerURL) error

DeleteAzureStorageBlobContainer deletes azure storage container

func DeleteGCSBucket

func DeleteGCSBucket(bucketName string) error

DeleteGCSBucket deletes the GCS bucket

func DeleteLabelFromNode

func DeleteLabelFromNode(oc *exutil.CLI, node string, label string) (string, error)

DeleteLabelFromNode delete the custom label from the node

func DeleteLabelsFromSpecificResource

func DeleteLabelsFromSpecificResource(oc *exutil.CLI, resourceKindAndName string, resourceNamespace string, labelNames ...string) (string, error)

DeleteLabelsFromSpecificResource deletes the custom labels from the specific resource

func DeleteMCAndMCPByName

func DeleteMCAndMCPByName(oc *exutil.CLI, mcName string, mcpName string, timeDurationSec int)

DeleteMCAndMCPByName used for checking if node return to worker machine config pool and the specified mcp is zero, then delete mc and mcp

func DeleteOpenStackContainer

func DeleteOpenStackContainer(client *gophercloud.ServiceClient, name string) error

DeleteOpenStackContainer deletes the storage container from openstack

func DeletePVCsForDeployment

func DeletePVCsForDeployment(client clientset.Interface, oc *exutil.CLI, deploymentPrefix string)

func DeleteRoleAssignments

func DeleteRoleAssignments(sess *AzureSession, roleAssignmentName string, scope string) error

DeleteRoleAssignments deletes role assignments

func DumpAndReturnTagging

func DumpAndReturnTagging(tags []string) ([]string, error)

DumpAndReturnTagging takes and array of tags and obtains the hex image IDs, dumps them to ginkgo for printing, and then returns them

func DumpApplicationPodLogs

func DumpApplicationPodLogs(dcName string, oc *exutil.CLI)

DumpApplicationPodLogs will dump the latest application logs for a DeploymentConfig for debug purposes

func DumpBuildLogs

func DumpBuildLogs(bc string, oc *exutil.CLI)

DumpBuildLogs will dump the latest build logs for a BuildConfig for debug purposes

func DumpBuilds

func DumpBuilds(oc *exutil.CLI)

DumpBuilds will dump the yaml for every build in the test namespace; remember, pipeline builds don't have build pods so a generic framework dump won't cat our pipeline builds objs in openshift

func DumpConfigMapStates

func DumpConfigMapStates(oc *exutil.CLI)

DumpConfigMapStates dumps the state of all ConfigMaps in the exutil.CLI's current namespace.

func DumpDeploymentLogs

func DumpDeploymentLogs(dcName string, version int64, oc *exutil.CLI)

DumpDeploymentLogs will dump the latest deployment logs for a DeploymentConfig for debug purposes

func DumpImageStreams

func DumpImageStreams(oc *exutil.CLI)

DumpImageStreams will dump both the openshift namespace and local namespace imagestreams as part of debugging when the language imagestreams in the openshift namespace seem to disappear

func DumpPersistentVolumeInfo

func DumpPersistentVolumeInfo(oc *exutil.CLI)

func DumpPodLogs

func DumpPodLogs(pods []kapiv1.Pod, oc *exutil.CLI)

func DumpPodLogsStartingWith

func DumpPodLogsStartingWith(prefix string, oc *exutil.CLI)

DumpPodLogsStartingWith will dump any pod starting with the name prefix provided

func DumpPodLogsStartingWithInNamespace

func DumpPodLogsStartingWithInNamespace(prefix, namespace string, oc *exutil.CLI)

DumpPodLogsStartingWith will dump any pod starting with the name prefix provided

func DumpPodStates

func DumpPodStates(oc *exutil.CLI)

DumpPodStates dumps the state of all pods in the exutil.CLI's current namespace.

func DumpPodStatesInNamespace

func DumpPodStatesInNamespace(namespace string, oc *exutil.CLI)

DumpPodStatesInNamespace dumps the state of all pods in the provided namespace.

func DumpPodsCommand

func DumpPodsCommand(c kubernetes.Interface, ns string, selector labels.Selector, cmd string)

DumpPodsCommand runs the provided command in every pod identified by selector in the provided namespace.

func DumpSampleOperator

func DumpSampleOperator(oc *exutil.CLI)

func DuplicateFileToPath

func DuplicateFileToPath(srcPath string, destPath string)

DuplicateFileToPath copies the file at srcPath to destPath.

func DuplicateFileToTemp

func DuplicateFileToTemp(srcPath string, destPrefix string) string

DuplicateFileToTemp creates a temporary duplicate of the file at srcPath using destPattern for naming, returning the path of the duplicate.

func EmptyAzureBlobContainer

func EmptyAzureBlobContainer(container azblob.ContainerURL) error

EmptyAzureBlobContainer removes all the files in azure storage container

func EmptyGCSBucket

func EmptyGCSBucket(client storage.Client, bucketName string) error

EmptyGCSBucket removes all the objects in the bucket

func EmptyOpenStackContainer

func EmptyOpenStackContainer(client *gophercloud.ServiceClient, name string) error

EmptyOpenStackContainer clear all the objects in storage container

func ExamineDiskUsage

func ExamineDiskUsage()

ExamineDiskUsage will dump df output on the testing system; leveraging this as part of diagnosing the registry's disk filling up during external tests on jenkins

func ExaminePodDiskUsage

func ExaminePodDiskUsage(oc *exutil.CLI)

ExaminePodDiskUsage will dump df/du output on registry pod; leveraging this as part of diagnosing the registry's disk filling up during external tests on jenkins

func ExtendedCheckPlatform

func ExtendedCheckPlatform(ctx context.Context, oc *exutil.CLI) string

func ExtractCcoctl

func ExtractCcoctl(oc *exutil.CLI, releaseImage, ccoctlTarget string) string

ExtractCcotl extracts the specified version of the ccoctl binary from the given release image. It supports different versions of ccoctl for RHEL environments, including:

  • "ccoctl"
  • "ccoctl.rhel8" (RHEL 8 version)
  • "ccoctl.rhel9" (RHEL 9 version)

Usage example:

ccoctlTarget := "ccoctl.rhel8"
ccoctlPath := exutil.ExtractCcotl(oc, testOCPImage, ccoctlTarget, true)
defer os.Remove(filepath.Dir(ccoctlPath))

Parameters:

  • oc: exutil.CLI object to interact with OpenShift commands.
  • releaseImage: The OpenShift release image from which to extract the ccoctl binary.
  • ccoctlTarget: The target ccoctl version to extract (e.g., "ccoctl"(default), "ccoctl.rhel8", "ccoctl.rhel9").

Returns:

  • A string containing the file path of the extracted ccoctl binary.

func ExtractCoreOSBootImagesConfigMap

func ExtractCoreOSBootImagesConfigMap(oc *exutil.CLI, releaseImage, pullSecretFile string) (*corev1.ConfigMap, error)

ExtractCoreOSBootImagesConfigMap extracts the CoreOS boot images ConfigMap from the given release image

func ExtractSpecifiedValueFromMetricData4MemRSS

func ExtractSpecifiedValueFromMetricData4MemRSS(oc *exutil.CLI, metricResult string) (string, int)

ExtractSpecifiedValueFromMetricData4MemRSS extracts the value of the container_memory_rss metric from the result of a Prometheus query

func ExtractVPCIDFromBaseDomain

func ExtractVPCIDFromBaseDomain(oc *exutil.CLI, vpcs []vpcv1.VPC, baseDomain string) (string, error)

ExtractVPCIDFromBaseDomain extracts the VPC ID based on the DNS base domain.

func FatalErr

func FatalErr(msg interface{})

FatalErr prints the error and exits the process

func FetchURL

func FetchURL(oc *exutil.CLI, url string, retryTimeout time.Duration) (string, error)

FetchURL grabs the output from the specified url and returns it. It will retry once per second for duration retryTimeout if an error occurs during the request.

func FindCLIImage

func FindCLIImage(oc *exutil.CLI) (string, bool)

func FindImageFormatString

func FindImageFormatString(oc *exutil.CLI) (string, bool)

FindImageFormatString returns a format string for components on the cluster. It returns false if no format string could be inferred from the cluster. OpenShift 4.0 clusters will not be able to infer an image format string, so you must wrap this method in one that can locate your specific image.

func FindRouterImage

func FindRouterImage(oc *exutil.CLI) (string, error)

func FixturePath

func FixturePath(elem ...string) string

FixturePath returns an absolute path to a fixture file in test/extended/testdata/, test/integration/, or examples/.

func GenerateManifestFile

func GenerateManifestFile(oc *exutil.CLI, baseDir string, manifestFile string, replacement ...map[string]string) (string, error)

This function accept key value replacement in multiple formats manifestFile, err := GenerateManifestFile(oc, "config-map.yaml", "myDir", map[string]string{"<address>": address, "<username>": user}) manifestFile, err := GenerateManifestFile(oc, "namespace.yaml", "myDir", map[string]string{"<namespace>": namespace})

func GetAWSClusterRegion

func GetAWSClusterRegion(oc *exutil.CLI) (string, error)

GetAWSClusterRegion returns AWS region of the cluster

func GetAllNodes

func GetAllNodes(oc *exutil.CLI) ([]string, error)

GetAllNodes returns a list of the names of all nodes in the cluster

func GetAllNodesByNodePoolNameInHostedCluster

func GetAllNodesByNodePoolNameInHostedCluster(oc *exutil.CLI, nodePoolName string) ([]string, error)

GetAllNodesByNodePoolNameInHostedCluster return all node names of specified nodepool in hosted cluster.

func GetAllNodesbyOSType

func GetAllNodesbyOSType(oc *exutil.CLI, ostype string) ([]string, error)

GetAllNodesbyOSType returns a list of the names of all linux/windows nodes in the cluster have both linux and windows node

func GetAllPods

func GetAllPods(oc *exutil.CLI, namespace string) ([]string, error)

GetAllPods returns a list of the names of all pods in the cluster in a given namespace

func GetAllPodsWithLabel

func GetAllPodsWithLabel(oc *exutil.CLI, namespace string, label string) ([]string, error)

GetAllPodsWithLabel get array of all pods for a given namespace and label

func GetAllWorkerNodesByOSID

func GetAllWorkerNodesByOSID(oc *exutil.CLI, osID string) ([]string, error)

GetAllWorkerNodesByOSID returns list of worker nodes by OS ID

func GetAllocatableResourcesNodesMap

func GetAllocatableResourcesNodesMap(nodes []v1.Node) map[string]NodeResources

GetAllocatableResourcesNodesMap returns the total allocatable CPU and Memory in each node

func GetAnnotationsFromSpecificResource

func GetAnnotationsFromSpecificResource(oc *exutil.CLI, resourceKindAndName, resourceNamespace string) ([]string, error)

GetAnnotationsFromSpecificResource gets the annotations from the specific resource

func GetApplicationPods

func GetApplicationPods(oc *exutil.CLI, dcName string) (*kapiv1.PodList, error)

func GetAuthenticatedUserID

func GetAuthenticatedUserID(providerClient *gophercloud.ProviderClient) (string, error)

GetAuthenticatedUserID gets current user ID some users don't have permission to list users, so here extract user ID from auth response

func GetAzureContainerRepositoryCredential

func GetAzureContainerRepositoryCredential(sess *AzureSession, registryName string, resourceGroupName string) (string, string, error)

GetAzureContainerRepositoryCredential get azure container repository credential

func GetAzureCredentialFromCluster

func GetAzureCredentialFromCluster(oc *exutil.CLI) (string, error)

GetAzureCredentialFromCluster gets Azure credentials from cluster and loads them as environment variables

func GetAzureCredsLocation

func GetAzureCredsLocation() (string, error)

func GetAzureStackVMStatus

func GetAzureStackVMStatus(resourceGroupName, vmName string) (string, error)

GetAzureStackVMStatus gets the status of the virtual machine with the given name in the specified resource group using Azure exutil.CLI

func GetAzureStorageAccount

func GetAzureStorageAccount(sess *AzureSession, resourceGroupName string) (string, error)

GetAzureStorageAccount get Azure Storage Account

func GetAzureStorageAccountFromCluster

func GetAzureStorageAccountFromCluster(oc *exutil.CLI) (string, string, error)

GetAzureStorageAccountFromCluster gets azure storage accountName and accountKey from image registry TODO: create a storage account and use that accout to manage azure container

func GetAzureVMInstance

func GetAzureVMInstance(sess *AzureSession, vmName string, resourceGroupName string) (string, error)

GetAzureVMInstance get vm instance

func GetAzureVMInstanceState

func GetAzureVMInstanceState(sess *AzureSession, vmName string, resourceGroupName string) (string, error)

GetAzureVMInstanceState get vm instance state

func GetAzureVMPrivateIP

func GetAzureVMPrivateIP(sess *AzureSession, rg, vmName string) (string, error)

GetAzureVMPrivateIP get Azure vm private IP

func GetAzureVMPublicIP

func GetAzureVMPublicIP(sess *AzureSession, rg, vmName string) (string, error)

GetAzureVMPublicIP get azure vm public IP

func GetAzureVMPublicIPByNameRegex

func GetAzureVMPublicIPByNameRegex(sess *AzureSession, rg, publicIPNameRegex string) (string, error)

GetAzureVMPublicIPByNameRegex returns the first public IP whose name matches the given regex

func GetClusterNodesBy

func GetClusterNodesBy(oc *exutil.CLI, role string) ([]string, error)

GetClusterNodesBy returns the cluster nodes by role

func GetClusterNodesByRoleInHostedCluster

func GetClusterNodesByRoleInHostedCluster(oc *exutil.CLI, role string) ([]string, error)

GetClusterNodesByRoleInHostedCluster returns the cluster nodes by role

func GetClusterPrefixName

func GetClusterPrefixName(oc *exutil.CLI) string

GetClusterPrefixName return Cluster Prefix Name

func GetClusterVersion

func GetClusterVersion(oc *exutil.CLI) (string, string, error)

GetClusterVersion returns the cluster version as string value (Ex: 4.8) and cluster build (Ex: 4.8.0-0.nightly-2021-09-28-165247)

func GetContainerIDByPODName

func GetContainerIDByPODName(oc *exutil.CLI, podName string, namespace string) string

func GetCurrentTestPolarionIDNumber

func GetCurrentTestPolarionIDNumber() string

GetCurrentTestPolarionIDNumber inspects the name of the test case and return the number of the polarion ID linked to this automated test case. It returns an empty string if no ID found.

func GetDeploymentConfigPods

func GetDeploymentConfigPods(oc *exutil.CLI, dcName string, version int64) (*kapiv1.PodList, error)

func GetDockerImageReference

func GetDockerImageReference(c imagev1typedclient.ImageStreamInterface, name, tag string) (string, error)

GetDockerImageReference retrieves the full Docker pull spec from the given ImageStream and tag

func GetEndpointAddress

func GetEndpointAddress(oc *exutil.CLI, name string) (string, error)

GetEndpointAddress will return an "ip:port" string for the endpoint.

func GetFieldWithJsonpath

func GetFieldWithJsonpath(oc *exutil.CLI, interval, timeout time.Duration, immediately, allowEmpty, asAdmin, withoutNamespace bool, parameters ...string) (string, error)

GetFieldWithJsonpath gets the field of the resource per jsonpath interval and timeout is the inveterl and timeout of Poll immediately means if it wait first interval and then get allowEmpty means if the result allow empty string asAdmin means oc.AsAdmin() or not withoutNamespace means oc.WithoutNamespace() or not. for example, it is to get clusterresource GetFieldWithJsonpath(oc, 3*time.Second, 150*time.Second, exutil.NotImmediately, exutil.NotAllowEmpty, exutil.AsAdmin, exutil.WithoutNamespace, "operator", name, "-o", "jsonpath={.status}") if you want to get ns resource, could be GetFieldWithJsonpath(oc, 3*time.Second, 150*time.Second, exutil.NotImmediately, exutil.NotAllowEmpty, exutil.AsAdmin, exutil.WithoutNamespace, "-n", ns, "pod", name, "-o", "jsonpath={.status}") or if the ns is same to oc.Namespace, could be GetFieldWithJsonpath(oc, 3*time.Second, 150*time.Second, exutil.NotImmediately, exutil.AllowEmpty, exutil.AsAdmin, exutil.WithoutNamespace, "pod", name, "-o", "jsonpath={.status}")

func GetFileContent

func GetFileContent(baseDir string, name string) (fileContent string)

Get file content in test/extended/testdata/<basedir>/<name>

func GetFirstCoreOsWorkerNode

func GetFirstCoreOsWorkerNode(oc *exutil.CLI) (string, error)

GetFirstCoreOsWorkerNode returns the first CoreOS worker node

func GetFirstLinuxMachineSets

func GetFirstLinuxMachineSets(oc *exutil.CLI) string

GetFirstLinuxMachineSets used for getting first linux worker nodes name

func GetFirstLinuxWorkerNode

func GetFirstLinuxWorkerNode(oc *exutil.CLI) (string, error)

GetFirstLinuxWorkerNode returns the first linux worker node in the cluster

func GetFirstLinuxWorkerNodeInHostedCluster

func GetFirstLinuxWorkerNodeInHostedCluster(oc *exutil.CLI) (string, error)

GetFirstLinuxWorkerNodeInHostedCluster returns the first linux worker node in the cluster

func GetFirstMasterNode

func GetFirstMasterNode(oc *exutil.CLI) (string, error)

GetFirstMasterNode returns a first master node

func GetFirstRhelWorkerNode

func GetFirstRhelWorkerNode(oc *exutil.CLI) (string, error)

GetFirstRhelWorkerNode returns the first rhel worker node

func GetFirstWorkerNode

func GetFirstWorkerNode(oc *exutil.CLI) (string, error)

GetFirstWorkerNode returns a first worker node

func GetFirstWorkerNodeByNodePoolNameInHostedCluster

func GetFirstWorkerNodeByNodePoolNameInHostedCluster(oc *exutil.CLI, nodePoolName string) (string, error)

GetFirstWorkerNodeByNodePoolNameInHostedCluster returns the first linux worker node in the cluster

func GetGcpProjectID

func GetGcpProjectID(oc *exutil.CLI) (string, error)

GetGcpProjectID returns the gcp project id

func GetHostedClusterVersion

func GetHostedClusterVersion(mgmtOc *exutil.CLI, hostedClusterName, hostedClusterNs string) semver.Version

GetHostedClusterVersion gets a HostedCluster's version from the management cluster.

func GetHyperShiftHostedClusterNameSpace

func GetHyperShiftHostedClusterNameSpace(oc *exutil.CLI) string

GetHyperShiftHostedClusterNameSpace get hypershift hostedcluster namespace if not exist, it will return empty string. If more than one exists, it will return the first one.

func GetHyperShiftOperatorNameSpace

func GetHyperShiftOperatorNameSpace(oc *exutil.CLI) string

GetHyperShiftOperatorNameSpace get hypershift operator namespace if not exist, it will return empty string.

func GetIBMCredentialFromCluster

func GetIBMCredentialFromCluster(oc *exutil.CLI) (string, string, string, error)

GetIBMCredentialFromCluster gets IBM credentials like ibmapikey, ibmvpc, and ibmregion from the cluster

func GetIBMInstanceID

func GetIBMInstanceID(session *IBMSession, oc *exutil.CLI, region string, vpcName string, instanceID string, baseDomain string) (string, error)

GetIBMInstanceID get IBM instance id

func GetIBMInstanceStatus

func GetIBMInstanceStatus(session *IBMSession, instanceID string) (string, error)

GetIBMInstanceStatus check IBM instance running status

func GetIBMPowerVsCloudID

func GetIBMPowerVsCloudID(oc *exutil.CLI, nodeName string) string

GetIBMPowerVsCloudID get powervsCloud Id

func GetIBMPowerVsInstanceInfo

func GetIBMPowerVsInstanceInfo(powerClient *IBMPowerVsSession, instanceName string) (string, string, error)

GetInstanceInfo retrieves information for the specified instance name

func GetIBMRegion

func GetIBMRegion(oc *exutil.CLI) (string, error)

GetIBMRegion gets IBM cluster region

func GetIBMResourceGrpName

func GetIBMResourceGrpName(oc *exutil.CLI) (string, error)

GetIBMResourceGrpName get IBM cluster resource group name

func GetIPVersionStackType

func GetIPVersionStackType(oc *exutil.CLI) (ipvStackType string)

GetIPVersionStackType gets IP-version Stack type of the cluster

func GetImageIDForTags

func GetImageIDForTags(comps []string) ([]string, error)

GetImageIDForTags will obtain the hexadecimal IDs for the array of human readible image tags IDs provided

func GetImagestreamImageName

func GetImagestreamImageName(oc *exutil.CLI, imagestreamName string) string

GetImagestreamImageName Return an imagestream's image repository name

func GetInfraID

func GetInfraID(oc *exutil.CLI) (string, error)

GetInfraID returns the infra id

func GetLastLinuxWorkerNode

func GetLastLinuxWorkerNode(oc *exutil.CLI) (string, error)

GetLastLinuxWorkerNode return last worker node

func GetLatest4StableImage

func GetLatest4StableImage() (string, error)

GetLatest4StableImage to get the latest 4-stable OCP image from releasestream link Return OCP image for sample quay.io/openshift-release-dev/ocp-release:4.11.0-fc.0-x86_64

func GetLatest4StableImageByStream

func GetLatest4StableImageByStream(arch string, stream string) (latestImage string, err error)

GetLatest4StableImageByStream to get the latest 4-stable OCP image from a specifed releasestream link GetLatest4StableImageByStream("multi", "4-stable-multi/latest?in=>4.16.0-0+<4.17.0-0") GetLatest4StableImageByStream("amd64", "4-stable/latest")

func GetLatestImage

func GetLatestImage(arch, product, stream string) (string, error)

GetLatestImage retrieves the pull spec of the latest image satisfying the arch - product - stream combination. arch = "amd64", "arm64", "ppc64le", "s390x", "multi" product = "ocp", "origin" (i.e. okd, which only supports the amd64 architecture) Possible values for the stream parameter depend on arch and product. See https://docs.ci.openshift.org/docs/getting-started/useful-links/#services for relevant release status pages.

Examples: GetLatestImage("amd64", "ocp", "4.14.0-0.nightly") GetLatestImage("arm64", "ocp", "4.14.0-0.nightly-arm64") GetLatestImage("amd64", "origin", "4.14.0-0.okd")

func GetLatestNightlyImage

func GetLatestNightlyImage(release string) (string, error)

GetLatestNightlyImage to get the latest nightly OCP image from releasestream link Input parameter release: OCP release version such as 4.11, 4.9, ..., 4.6 Return OCP image

func GetLatestReleaseImageFromEnv

func GetLatestReleaseImageFromEnv() string

func GetMachineSetInstanceType

func GetMachineSetInstanceType(oc *exutil.CLI) string

GetMachineSetInstanceType used to get first machineset instance type

func GetMasterThreadDump

func GetMasterThreadDump(oc *exutil.CLI)

GetMasterThreadDump will get a golang thread stack dump

func GetMirrorRegistry

func GetMirrorRegistry(oc *exutil.CLI) (registry string, err error)

GetMirrorRegistry returns mirror registry from icsp

func GetMustGatherFileName

func GetMustGatherFileName() string

GetMustGatherFileName Get the name of the must-gather file for the current test case

func GetNFDInstanceImage

func GetNFDInstanceImage(oc *exutil.CLI, namespace string) string

GetNFDInstanceImage return correct image name in manifest channel

func GetNFDVersionbyPackageManifest

func GetNFDVersionbyPackageManifest(oc *exutil.CLI, namespace string) string

GetNFDVersionbyPackageManifest return NFD version

func GetNodeArchByName

func GetNodeArchByName(oc *exutil.CLI, nodeName string) string

GetNodeArchByName gets the node arch by its name

func GetNodeHostname

func GetNodeHostname(oc *exutil.CLI, node string) (string, error)

GetNodeHostname returns the cluster node hostname

func GetNodeListByLabel

func GetNodeListByLabel(oc *exutil.CLI, labelKey string) []string

GetNodeListByLabel gets the node list by label

func GetNodeNameByMachineset

func GetNodeNameByMachineset(oc *exutil.CLI, machinesetName string) string

GetNodeNameByMachineset used for get node name by machineset name

func GetNodePoolNamesbyHostedClusterName

func GetNodePoolNamesbyHostedClusterName(oc *exutil.CLI, hostedClusterName, hostedClusterNS string) []string

GetNodePoolNamesbyHostedClusterName gets the nodepools names of the hosted cluster

func GetNutanixCredFromCluster

func GetNutanixCredFromCluster(oc *exutil.CLI) (string, error)

GetNutanixCredentialFromCluster gets nutanix credentials from cluster

func GetNutanixCredentialFromCluster

func GetNutanixCredentialFromCluster(oc *exutil.CLI) (string, string, string, error)

GetNutanixCredentialFromCluster gets credentials like username, password, and endpoint URL from the cluster

func GetNutanixHostromCluster

func GetNutanixHostromCluster(oc *exutil.CLI) (string, error)

GetNutanixHostromCluster Gets nutanix [Host]:port from cluster

func GetOIDCProvider

func GetOIDCProvider(oc *exutil.CLI) (string, error)

GetOIDCProvider returns the OIDC provider for current cluster

func GetOpenStackUserIDAndDomainID

func GetOpenStackUserIDAndDomainID(cred *OpenstackCredentials) (string, string)

GetOpenStackUserIDAndDomainID returns the user ID and domain ID

func GetOperatorPKGManifestDefaultChannel

func GetOperatorPKGManifestDefaultChannel(oc *exutil.CLI, pkgManifestName, namespace string) (string, error)

GetOperatorPKGManifestDefaultChannel to getting operator Packagemanifest default channel

func GetOperatorPKGManifestSource

func GetOperatorPKGManifestSource(oc *exutil.CLI, pkgManifestName, namespace string) (string, error)

GetOperatorPKGManifestSource used for getting operator Packagemanifest source name

func GetPODCPUSet

func GetPODCPUSet(oc *exutil.CLI, namespace string, nodeName string, containerID string) string

func GetPodForContainer

func GetPodForContainer(container kapiv1.Container) *kapiv1.Pod

GetPodForContainer creates a new Pod that runs specified container

func GetPodLogs

func GetPodLogs(oc *exutil.CLI, pod, container, since string) (string, error)

GetPodLogs retrieves logs from a pod

func GetPodName

func GetPodName(oc *exutil.CLI, namespace string, podLabel string, node string) (string, error)

GetPodName returns the pod name

func GetPodNameInHostedCluster

func GetPodNameInHostedCluster(oc *exutil.CLI, namespace string, podLabel string, node string) (string, error)

GetPodNameInHostedCluster returns the pod name in hosted cluster of hypershift

func GetPodNamesByFilter

func GetPodNamesByFilter(c corev1client.PodInterface, label labels.Selector, predicate func(kapiv1.Pod) bool) (podNames []string, err error)

GetPodNamesByFilter looks up pods that satisfy the predicate and returns their names.

func GetPodNodeName

func GetPodNodeName(oc *exutil.CLI, namespace string, podName string) (string, error)

GetPodNodeName returns the name of the node the given pod is running on

func GetPodsNodesMap

func GetPodsNodesMap(oc *exutil.CLI, nodes []v1.Node) map[string][]v1.Pod

GetPodsNodesMap returns all the running pods in each node

func GetPrivateKey

func GetPrivateKey() (string, error)

func GetPublicKey

func GetPublicKey() (string, error)

func GetPullSec

func GetPullSec(oc *exutil.CLI, dirname string) (err error)

Extract pull secrect from cluster

func GetRDU2HostsList

func GetRDU2HostsList() (map[string]*RDU2Host, error)

GetRDU2HostsList returns the singleton instance of RDU2Hosts map It initializes the singleton on first call by reading the hosts.yaml file Returns a copy of the map to prevent external modifications

func GetRHCOSImageURLForAzureDisk

func GetRHCOSImageURLForAzureDisk(oc *exutil.CLI, releaseImage string, pullSecretFile string, arch CoreOSImageArch) (string, error)

GetRHCOSImageURLForAzureDisk retrieves the RHCOS URL for the specified architecture's Azure disk image

func GetROSAClusterID

func GetROSAClusterID() string

Get cluster ID for ROSA created cluster

func GetRandomString

func GetRandomString() string

GetRandomString to create random string

func GetReleaseImage

func GetReleaseImage(oc *exutil.CLI) (string, error)

GetReleaseImage returns the release image as string value (Ex: registry.ci.openshift.org/ocp/release@sha256:b13971e61312f5dddd6435ccf061ac1a8447285a85828456edcd4fc2504cfb8f)

func GetRelicasByMachinesetName

func GetRelicasByMachinesetName(oc *exutil.CLI, machinesetName string) string

GetRelicasByMachinesetName used for get replicas number by machineset name

func GetRemainingResourcesNodesMap

func GetRemainingResourcesNodesMap(oc *exutil.CLI, nodes []v1.Node) map[string]NodeResources

GetRemainingResourcesNodesMap returns the total remaning CPU and Memory in each node

func GetRequestedResourcesNodesMap

func GetRequestedResourcesNodesMap(oc *exutil.CLI, nodes []v1.Node) map[string]NodeResources

GetRequestedResourcesNodesMap returns the total requested CPU and Memory in each node

func GetResourceSpecificLabelValue

func GetResourceSpecificLabelValue(oc *exutil.CLI, resourceKindAndName string, resourceNamespace string, labelName string) (string, error)

GetResourceSpecificLabelValue gets the specified label value from the resource and label name

func GetRouterPodTemplate

func GetRouterPodTemplate(oc *exutil.CLI) (*corev1.PodTemplateSpec, string, error)

GetRouterPodTemplate finds the router pod template across different namespaces, helping to mitigate the transition from the default namespace to an operator namespace.

func GetSAToken

func GetSAToken(oc *exutil.CLI) (string, error)

GetSAToken get a token assigned to prometheus-k8s from openshift-monitoring namespace According to 2093780, the secret prometheus-k8s-token is removed from sa prometheus-k8s. So from 4.11, command <oc sa get-token prometheus-k8s -n openshift-monitoring> won't work Please install oc client and cluster with same major version.

func GetSchedulableLinuxWorkerNodes

func GetSchedulableLinuxWorkerNodes(oc *exutil.CLI) ([]v1.Node, error)

GetSchedulableLinuxWorkerNodes returns a group of nodes that match the requirements: os: linux, role: worker, status: ready, schedulable

func GetSpecificPodLogs

func GetSpecificPodLogs(oc *exutil.CLI, namespace string, container string, podName string, filter string) (string, error)

GetSpecificPodLogs returns the pod logs by the specific filter

func GetSpecificPodLogsCombinedOrNot

func GetSpecificPodLogsCombinedOrNot(oc *exutil.CLI, namespace string, container string, podName string, filter string, combined bool) (string, error)

GetSpecificPodLogsCombinedOrNot returns the pod logs by the specific filter with combining stderr or not

func GetStatefulSetPods

func GetStatefulSetPods(oc *exutil.CLI, setName string) (*kapiv1.PodList, error)

func GetSystemctlServiceUnitTimestampByPropertyNameWithMonotonic

func GetSystemctlServiceUnitTimestampByPropertyNameWithMonotonic(propertyValue string) int

func GetUserAssignedIdentityPrincipalID

func GetUserAssignedIdentityPrincipalID(sess *AzureSession, resourceGroup string, identityName string) (string, error)

GetUserAssignedIdentityPrincipalID get user assigned identity PrincipalID

func GetUserCAToFile

func GetUserCAToFile(oc *exutil.CLI, filename string) (err error)

GetUserCA dump user certificate from user-ca-bundle configmap to File

func GrantRoleToPrincipalIDByResourceGroup

func GrantRoleToPrincipalIDByResourceGroup(sess *AzureSession, principalID string, resourceGroup string, roleId string) (roleAssignmentName string, scope string)

GrantRoleToPrincipalIDByResourceGroup grant role to principalID by resource group

func ImplStringArrayContains

func ImplStringArrayContains(stringArray []string, name string) bool

fuction to check given string is in array or not

func InitDefaultEnvironmentVariables

func InitDefaultEnvironmentVariables()

ProwGCPSetup makes sure certain required env vars are available in the case that extended tests are invoked directly via calls to ginkgo/extended.test

func InitStandardFlags

func InitStandardFlags()

func InitTest

func InitTest(dryRun bool) error

func InstallNFD

func InstallNFD(oc *exutil.CLI, nfdNamespace string)

InstallNFD attempts to install the Node Feature Discovery operator and verify that it is running

func InstallPAO

func InstallPAO(oc *exutil.CLI, paoNamespace string)

InstallPAO attempts to install the Performance Add-On operator and verify that it is running

func Is3MasterNoDedicatedWorkerNode

func Is3MasterNoDedicatedWorkerNode(oc *exutil.CLI) bool

Is3MasterNoDedicatedWorkerNode reture if the OCP have three master/worker node, but no dedicated worker node.

func IsAKSCluster

func IsAKSCluster(ctx context.Context, oc *exutil.CLI) (bool, error)

IsAKSCluster checks if the active cluster is an AKS (Azure Kubernetes Service) cluster or not

func IsArbiterCluster

func IsArbiterCluster(oc *exutil.CLI) bool

A two-node-arbiter OpenShift cluster is a special type of high availability (HA) deployment designed to run in edge environments

func IsBase64Encoded

func IsBase64Encoded(s string) bool

IsBase64Encoded checks if the input string is likely base64-encoded.

func IsClusterOperated

func IsClusterOperated(oc *exutil.CLI) bool

func IsDefaultNodeSelectorEnabled

func IsDefaultNodeSelectorEnabled(oc *exutil.CLI) bool

IsDefaultNodeSelectorEnabled judges whether the test cluster enabled the defaultNodeSelector

func IsDeploymentReady

func IsDeploymentReady(deploy *appsv1.Deployment) bool

IsDeploymentReady checks if an *appsv1.Deployment is ready

func IsExternalOIDCCluster

func IsExternalOIDCCluster(oc *exutil.CLI) (bool, error)

IsExternalOIDCCluster checks if the cluster is using external OIDC.

func IsHypershiftHostedCluster

func IsHypershiftHostedCluster(oc *exutil.CLI) bool

IsHypershiftHostedCluster

func IsInfrastructuresHighlyAvailable

func IsInfrastructuresHighlyAvailable(oc *exutil.CLI) bool

IsInfrastructuresHighlyAvailable check if it is HighlyAvailable for infrastructures. Available for both classic OCP and the hosted cluster.

func IsKeycloakExtOIDCCluster

func IsKeycloakExtOIDCCluster() bool

IsKeycloakExtOIDCCluster assumes the cluster uses external oidc auth but checks if the oidc issuer is Keycloak.

func IsMachineSetExist

func IsMachineSetExist(oc *exutil.CLI) bool

IsMachineSetExist check if machineset exist in OCP

func IsNamespacePrivileged

func IsNamespacePrivileged(oc *exutil.CLI, namespace string) (bool, error)

IsNamespacePrivileged checks if a namespace has privileged SCC

func IsNodeLabeledByNFD

func IsNodeLabeledByNFD(oc *exutil.CLI) bool

IsNodeLabeledByNFD Check if NFD Installed base on the cluster labels

func IsOneMasterWithNWorkerNodes

func IsOneMasterWithNWorkerNodes(oc *exutil.CLI) bool

func IsOpenShiftCluster

func IsOpenShiftCluster(ctx context.Context, c corev1client.NamespaceInterface) (bool, error)

IsOpenShiftCluster checks if the active cluster is OpenShift or a derivative

func IsPAOInOperatorHub

func IsPAOInOperatorHub(oc *exutil.CLI) bool

IsPAOInOperatorHub used for checking if PAO exist in OperatorHub

func IsPAOInstalled

func IsPAOInstalled(oc *exutil.CLI) bool

IsPAOInstalled used for deploying Performance Add-on Operator

func IsROSA

func IsROSA() bool

IsROSA Determine whether it is a ROSA env, now only support prow

func IsROSACluster

func IsROSACluster(oc *exutil.CLI) bool

IsROSACluster checks if the cluster is running on ROSA

func IsRosaCluster

func IsRosaCluster(oc *exutil.CLI) bool

IsRosaCluster

func IsSNOCluster

func IsSNOCluster(oc *exutil.CLI) bool

IsSNOCluster will check if OCP is a single node cluster

func IsSTSCluster

func IsSTSCluster(oc *exutil.CLI) bool

IsSTSCluster determines if an AWS cluster is using STS

func IsSpecifiedAnnotationKeyExist

func IsSpecifiedAnnotationKeyExist(oc *exutil.CLI, resourceKindAndName, resourceNamespace, annotationKey string) bool

IsSpecifiedAnnotationKeyExist judges whether the specified annotationKey exist on the resource

func IsTechPreviewNoUpgrade

func IsTechPreviewNoUpgrade(oc *exutil.CLI) bool

IsTechPreviewNoUpgrade checks if a cluster is a TechPreviewNoUpgrade cluster

func IsWorkerNode

func IsWorkerNode(oc *exutil.CLI, nodeName string) bool

IsWorkerNode judges whether the node has the worker role

func IsWorkloadIdentityCluster

func IsWorkloadIdentityCluster(oc *exutil.CLI) bool

IsWorkloadIdentityCluster judges whether the Azure/GCP cluster is using the Workload Identity

func KubeConfigPath

func KubeConfigPath() string

KubeConfigPath returns the value of KUBECONFIG environment variable

func LDAPClientMounts

func LDAPClientMounts() ([]corev1.VolumeMount, []corev1.Volume)

func LabelPod

func LabelPod(oc *exutil.CLI, namespace string, podName string, label string) error

LabelPod labels a given pod with a given label in a given namespace

func LaunchWebserverPod

func LaunchWebserverPod(f *e2e.Framework, podName, nodeName string) (ip string)

LaunchWebserverPod launches a pod serving http on port 8080 to act as the target for networking connectivity checks. The ip address of the created pod will be returned if the pod is launched successfully.

func ListGCSBuckets

func ListGCSBuckets(client storage.Client, projectID string) ([]string, error)

ListGCSBuckets gets all the bucket names under the projectID

func ListImages

func ListImages() ([]string, error)

ListImages initiates the equivalent of a `docker images`

func ListServersByName

func ListServersByName(client *gophercloud.ServiceClient, instanceName string) ([]servers.Server, error)

ListServersByName retrieves a list of servers matching the given instance name.

func ModifyYamlFileContent

func ModifyYamlFileContent(file string, replacements []YamlReplace)

ModifyYamlFileContent modify the content of YAML file given the file path and a list of YamlReplace struct. Example: ModifyYamlFileContent(file, []YamlReplace {

	{
		Path: 'spec.template.spec.imagePullSecrets',
		Value: '- name: notmatch-secret',
	},
})

func MoveFileToPath

func MoveFileToPath(srcPath string, destPath string)

MoveFileToPath attempts to move a file from srcPath to destPath.

func MustGetAzureCredsLocation

func MustGetAzureCredsLocation() string

func NewAzureContainerClient

func NewAzureContainerClient(oc *exutil.CLI, accountName, accountKey, azContainerName string) (azblob.ContainerURL, error)

NewAzureContainerClient initializes a new azure blob container client

func NewCLI

func NewCLI(project, adminConfigPath string) *exutil.CLI

NewCLI initialize the upstream E2E framework and set the namespace to match with the project name. Note that this function does not initialize the project role bindings for the namespace.

func NewCLIForKube

func NewCLIForKube(basename string) *exutil.CLI

NewCLIForKube initializes the exutil.CLI for tests against pure Kubernetes environments

func NewCLIForKubeOpenShift

func NewCLIForKubeOpenShift(basename string) *exutil.CLI

NewCLIForKubeOpenShift provides a exutil.CLI that detects Kubernetes or OpenShift

func NewCLIWithoutNamespace

func NewCLIWithoutNamespace(project string) *exutil.CLI

NewCLIWithoutNamespace initializes the upstream E2E framework in a non-namespaced context. Most commonly used for global object (non-namespaced) tests.

func NewOpenStackClient

func NewOpenStackClient(cred *OpenstackCredentials, serviceType string) *gophercloud.ServiceClient

func NewPodExecutor

func NewPodExecutor(oc *exutil.CLI, name, image string) (*podExecutor, error)

NewPodExecutor returns an executor capable of running commands in a Pod.

func OrFail

func OrFail[T any](vals ...any) T

OrFail function will process another function's return values and fail if any of those returned values is ane error != nil and returns the first value example: if we have: func getValued() (string, error)

we can do:  value := OrFail[string](getValue())

func ParameterizedTemplateByReplaceToFile

func ParameterizedTemplateByReplaceToFile(oc *exutil.CLI, parameters ...string) string

ParameterizedTemplateByReplaceToFile parameterize template to new file

func ParseLabelsOrDie

func ParseLabelsOrDie(str string) labels.Selector

ParseLabelsOrDie turns the given string into a label selector or panics; for tests or other cases where you know the string is valid. TODO: Move this to the upstream labels package.

func PathExists

func PathExists(path string) (bool, error)

PathExists @Description Check if a file exists @Create jianl Jan 22 2025 @Param path string the file path @Return (bool, error)

func PerformInstanceActionOnPowerVs

func PerformInstanceActionOnPowerVs(powerClient *IBMPowerVsSession, instanceID, action string) error

PerformInstanceActionOnPowerVs performs start or stop action on the instance

func PreDetermineExternalOIDCCluster

func PreDetermineExternalOIDCCluster() (bool, error)

PreDetermineExternalOIDCCluster checks if the cluster is using external OIDC preflight to avoid to check it everytime.

func PreDetermineK8sCluster

func PreDetermineK8sCluster() (isK8s bool, err error)

PreDetermineK8sCluster checks if the active cluster is a Kubernetes cluster (as opposed to OpenShift).

func PreSetEnvK8s

func PreSetEnvK8s() (res string)

func PreSetEnvOIDCCluster

func PreSetEnvOIDCCluster() (res string)

func PreTestDump

func PreTestDump()

func ProcessAzurePages

func ProcessAzurePages[T any](ctx context.Context, pager *runtime.Pager[T], handlePage func(page T) error) error

func ProcessTemplate

func ProcessTemplate(oc *exutil.CLI, parameters ...string) string

ProcessTemplate process template given file path and parameters

func ROSALogin

func ROSALogin()

ROSALogin rosa login, If the login fails then skip

func ROSAValidHypershiftAndGetGuestKubeConf

func ROSAValidHypershiftAndGetGuestKubeConf(oc *exutil.CLI) (string, string, string)

ROSAValidHypershiftAndGetGuestKubeConf check if it is ROSA-hypershift env and get kubeconf of the hosted cluster, only support prow the first return is hosted cluster name the second return is the file of kubeconfig of the hosted cluster the third return is the hostedcluster namespace in mgmt cluster which contains the generated resources if it is not hypershift env, it will skip test.

func RandStr

func RandStr(n int) string

RandStr This is a utility function for random strings n: random strings' length

func RandStrCustomize

func RandStrCustomize(s string, n int) string

RandStrCustomize This is a utility function for random strings n: random strings' length, s: Customizable String Sets

func RandStrDefault

func RandStrDefault() string

RandStrDefault This is a utility function for random strings random strings' length=8

func ReadFixture

func ReadFixture(path string) (runtime.Object, error)

func ReadFixtureOrFail

func ReadFixtureOrFail(path string) runtime.Object

func ReadLDAPServerTestData

func ReadLDAPServerTestData() (*app.Deployment, *corev1.Service, *corev1.ConfigMap, *corev1.ConfigMap)

func RecoverNamespaceRestricted

func RecoverNamespaceRestricted(oc *exutil.CLI, namespace string) error

RecoverNamespaceRestricted recovers a namespace to restricted mode

func RemoteShContainer

func RemoteShContainer(oc *exutil.CLI, namespace string, podName string, container string, cmd ...string) (string, error)

RemoteShContainer creates a remote shell of the given container inside the pod

func RemoteShPod

func RemoteShPod(oc *exutil.CLI, namespace string, podName string, cmd ...string) (string, error)

RemoteShPod creates a remote shell of the pod

func RemoteShPodWithBash

func RemoteShPodWithBash(oc *exutil.CLI, namespace string, podName string, cmd ...string) (string, error)

RemoteShPodWithBash creates a remote shell of the pod with bash

func RemoteShPodWithBashSpecifyContainer

func RemoteShPodWithBashSpecifyContainer(oc *exutil.CLI, namespace string, podName string, containerName string, cmd ...string) (string, error)

RemoteShPodWithBashSpecifyContainer creates a remote shell of the pod with bash specifying container name

func RemoteShPodWithChroot

func RemoteShPodWithChroot(oc *exutil.CLI, namespace string, podName string, cmd ...string) (string, error)

RemoteShPodWithChroot creates a remote shell of the pod with chroot

func RemoveAnnotationFromSpecificResource

func RemoveAnnotationFromSpecificResource(oc *exutil.CLI, resourceKindAndName, resourceNamespace string, annotationName string) (string, error)

RemoveAnnotationFromSpecificResource removes the specified annotation from the resource

func RemoveDeploymentConfigs

func RemoveDeploymentConfigs(oc *exutil.CLI, dcs ...string) error

RemoveDeploymentConfigs deletes the given DeploymentConfigs in a namespace

func RemovePodsWithPrefixes

func RemovePodsWithPrefixes(oc *exutil.CLI, prefixes ...string) error

RemovePodsWithPrefixes deletes pods whose name begins with the supplied prefixes

func RemoveStatefulSets

func RemoveStatefulSets(oc *exutil.CLI, sets ...string) error

RemoveStatefulSets deletes the given stateful sets in a namespace

func RunOneShotCommandPod

func RunOneShotCommandPod(
	oc *exutil.CLI,
	name, image, command string,
	volumeMounts []corev1.VolumeMount,
	volumes []corev1.Volume,
	env []corev1.EnvVar,
	timeout time.Duration,
) (string, []error)

RunOneShotCommandPod runs the given command in a pod and waits for completion and log output for the given timeout duration, returning the command output or an error. TODO: merge with the PodExecutor above

func Secure

func Secure(securedMatcher types.GomegaMatcher) types.GomegaMatcher

func SetNamespacePrivileged

func SetNamespacePrivileged(oc *exutil.CLI, namespace string) error

SetNamespacePrivileged sets a namespace to use privileged SCC

func SetVPCServiceURLForRegion

func SetVPCServiceURLForRegion(session *IBMSession, region string) error

SetVPCServiceURLForRegion will set the VPC Service URL to a specific IBM Cloud Region, in order to access Region scoped resources

func SetupK8SNFSServerAndVolume

func SetupK8SNFSServerAndVolume(oc *exutil.CLI, count int) (*kapiv1.Pod, []*kapiv1.PersistentVolume, error)

SetupK8SNFSServerAndVolume sets up an nfs server pod with count number of persistent volumes

func ShowSystemctlPropertyValueOfServiceUnitByName

func ShowSystemctlPropertyValueOfServiceUnitByName(oc *exutil.CLI, tunedNodeName string, ntoNamespace string, serviceUnit string, propertyName string) string

func SkipBaselineCaps

func SkipBaselineCaps(oc *exutil.CLI, sets string)

SkipBaselineCaps skip the test if cluster has no required resources. sets is comma separated list of baselineCapabilitySets to skip. for example: "None, v4.11"

func SkipForSNOCluster

func SkipForSNOCluster(oc *exutil.CLI)

SkipForSNOCluster skip for SNO cluster

func SkipIfCapEnabled

func SkipIfCapEnabled(oc *exutil.CLI, capability string)

SkipIfCapEnabled skips the test if a capability is enabled

func SkipIfDisableDefaultCatalogsource

func SkipIfDisableDefaultCatalogsource(oc *exutil.CLI)

Skip the test if default catsrc is disable

func SkipIfPlatformType

func SkipIfPlatformType(oc *exutil.CLI, platforms string)

skip platform

func SkipIfPlatformTypeNot

func SkipIfPlatformTypeNot(oc *exutil.CLI, platforms string)

SkipIfPlatformTypeNot skips all platforms other than supported platforms is comma separated list of allowed platforms for example: "gcp, aws"

func SkipMissingQECatalogsource

func SkipMissingQECatalogsource(oc *exutil.CLI)

Skip the test if there is not catalogsource/qe-app-registry in the cluster

func SkipNoBuild

func SkipNoBuild(oc *exutil.CLI)

SkipNoBuild skip the test if the cluster has no Build component

func SkipNoCapabilities

func SkipNoCapabilities(oc *exutil.CLI, capability string)

SkipNoCapabilities skip the test if the cluster has no one capability

func SkipNoDefaultSC

func SkipNoDefaultSC(oc *exutil.CLI)

SkipNoDefaultSC skip the test if cluster has no default storageclass or has more than 1 default storageclass

func SkipNoDeploymentConfig

func SkipNoDeploymentConfig(oc *exutil.CLI)

SkipNoDeploymentConfig skip the test if the cluster has no DeploymentConfig component

func SkipNoImageRegistry

func SkipNoImageRegistry(oc *exutil.CLI)

SkipNoImageRegistry skip the test if the cluster has no ImageRegistry component

func SkipNoOLMCore

func SkipNoOLMCore(oc *exutil.CLI)

SkipNoOLMCore skip the test if the cluster has no OLM component from 4.15, OLM become optional core component. it means there is no OLM component for some profiles. so, the OLM case and optioinal operator case can not run on such cluster.

func SkipNoOLMv1Core

func SkipNoOLMv1Core(oc *exutil.CLI)

func SkipOnAKSNess

func SkipOnAKSNess(ctx context.Context, oc *exutil.CLI, expectAKS bool)

func SkipOnHypershiftOperatorExistence

func SkipOnHypershiftOperatorExistence(mgmtOC *exutil.CLI, expectHO bool)

func SkipOnOpenShiftNess

func SkipOnOpenShiftNess(expectOpenShift bool)

SkipOnOpenShiftNess skips the test if the cluster type doesn't match the expected type.

func SkipOnProxyCluster

func SkipOnProxyCluster(oc *exutil.CLI)

Skip for proxy platform

func SpecifyMachinesetWithDifferentInstanceType

func SpecifyMachinesetWithDifferentInstanceType(oc *exutil.CLI) string

SpecifyMachinesetWithDifferentInstanceType used for specify cpu type that different from default one

func StartAzureStackVM

func StartAzureStackVM(resourceGroupName, vmName string) error

StartAzureStackVM starts the virtual machine with the given name in the specified resource group using Azure exutil.CLI

func StartAzureVM

func StartAzureVM(sess *AzureSession, vmName string, resourceGroupName string) (osr autorest.Response, err error)

StartAzureVM starts the selected VM

func StartBuild

func StartBuild(oc *exutil.CLI, args ...string) (stdout, stderr string, err error)

StartBuild executes OC start-build with the specified arguments. StdOut and StdErr from the process are returned as separate strings.

func StartIBMInstance

func StartIBMInstance(session *IBMSession, instanceID string) error

StartIBMInstance start the IBM instance

func StopAzureStackVM

func StopAzureStackVM(resourceGroupName, vmName string) error

StopAzureStackVM stops the virtual machine with the given name in the specified resource group using Azure exutil.CLI

func StopAzureVM

func StopAzureVM(sess *AzureSession, vmName string, resourceGroupName string) (osr autorest.Response, err error)

StopAzureVM stops the selected VM

func StopIBMInstance

func StopIBMInstance(session *IBMSession, instanceID string) error

StopIBMInstance stop the IBM instance

func StringToBASE64

func StringToBASE64(src string) string

StringToBASE64 Base64 Encode

func StringsSliceContains

func StringsSliceContains(stringsSlice []string, element string) (bool, int)

StringsSliceContains judges whether the strings Slice contains specific element, return bool and the first matched index If no matched return (false, 0)

func StringsSliceElementsAddSuffix

func StringsSliceElementsAddSuffix(stringsSlice []string, suffix string) []string

StringsSliceElementsAddSuffix returns a new string slice all elements with the specific suffix added

func StringsSliceElementsHasPrefix

func StringsSliceElementsHasPrefix(stringsSlice []string, elementPrefix string, sequentialFlag bool) (bool, int)

StringsSliceElementsHasPrefix judges whether the strings Slice contains an element which has the specific prefix returns bool and the first matched index sequential order: -> sequentialFlag: "true" reverse order: -> sequentialFlag: "false" If no matched return (false, 0)

func TimedWaitForAnImageStreamTag

func TimedWaitForAnImageStreamTag(oc *exutil.CLI, namespace, name, tag string, waitTimeout time.Duration) error

TimedWaitForAnImageStreamTag waits until an image stream with given name has non-empty history for given tag. Gives up waiting after the specified waitTimeout

func UpdateFile

func UpdateFile(filePath string, stringPairs []StringPairs) (err error)

updateFile @Description Replace oldString in a given file by newString @Create jianl Jan 22 2025 @Param filePath string the file path @Param stringPairs StringPairs a list of struct of old string and new string @Return nil

func ValidHypershiftAndGetGuestKubeConf

func ValidHypershiftAndGetGuestKubeConf(oc *exutil.CLI) (string, string, string)

ValidHypershiftAndGetGuestKubeConf check if it is hypershift env and get kubeconf of the hosted cluster the first return is hosted cluster name the second return is the file of kubeconfig of the hosted cluster the third return is the hostedcluster namespace in mgmt cluster which contains the generated resources if it is not hypershift env, it will skip test.

func ValidHypershiftAndGetGuestKubeConf4SecondHostedCluster

func ValidHypershiftAndGetGuestKubeConf4SecondHostedCluster(oc *exutil.CLI) (string, string, string)

ValidHypershiftAndGetGuestKubeConf4SecondHostedCluster check if it is hypershift env and get kubeconf of the hosted cluster the first return is hosted cluster name the second return is the file of kubeconfig of the hosted cluster the third return is the hostedcluster namespace in mgmt cluster which contains the generated resources if it is not hypershift env, it will skip test.

func ValidHypershiftAndGetGuestKubeConfWithNoSkip

func ValidHypershiftAndGetGuestKubeConfWithNoSkip(oc *exutil.CLI) (string, string, string)

ValidHypershiftAndGetGuestKubeConfWithNoSkip check if it is hypershift env and get kubeconf of the hosted cluster the first return is hosted cluster name the second return is the file of kubeconfig of the hosted cluster the third return is the hostedcluster namespace in mgmt cluster which contains the generated resources if it is not hypershift env, it will not skip the testcase and return null string.

func VarSubOnFile

func VarSubOnFile(srcFile string, destFile string, vars map[string]string) error

VarSubOnFile reads in srcFile, finds instances of ${key} from the map and replaces them with their associated values.

func WaitAndGetSpecificPodLogs

func WaitAndGetSpecificPodLogs(oc *exutil.CLI, namespace string, container string, podName string, filter string) (string, error)

WaitAndGetSpecificPodLogs wait and return the pod logs by the specific filter

func WaitForABuild

func WaitForABuild(c buildv1clienttyped.BuildInterface, name string, isOK, isFailed, isCanceled func(*buildv1.Build) bool) error

WaitForABuild waits for a Build object to match either isOK or isFailed conditions.

func WaitForAJob

func WaitForAJob(c batchv1client.JobInterface, name string, timeout time.Duration) error

func WaitForAnImageStream

func WaitForAnImageStream(client imagev1typedclient.ImageStreamInterface,
	name string,
	isOK, isFailed func(*imagev1.ImageStream) bool) error

WaitForAnImageStream waits for an ImageStream to fulfill the isOK function

func WaitForAnImageStreamTag

func WaitForAnImageStreamTag(oc *exutil.CLI, namespace, name, tag string) error

WaitForAnImageStreamTag waits until an image stream with given name has non-empty history for given tag. Defaults to waiting for 300 seconds

func WaitForBuildResult

func WaitForBuildResult(c buildv1clienttyped.BuildInterface, result *BuildResult) error

WaitForBuildResult updates result wit the state of the build

func WaitForDeploymentConfig

func WaitForDeploymentConfig(kc kubernetes.Interface, dcClient appsv1clienttyped.DeploymentConfigsGetter, namespace, name string, version int64, enforceNotProgressing bool, cli *exutil.CLI) error

WaitForDeploymentConfig waits for a DeploymentConfig to complete transition to a given version and report minimum availability.

func WaitForDeploymentsReady

func WaitForDeploymentsReady(ctx context.Context, listDeployments func(ctx context.Context) (*appsv1.DeploymentList, error),
	isDeploymentReady func(*appsv1.Deployment) bool, timeout, interval time.Duration, printDebugInfo bool)

WaitForDeploymentsReady polls listDeployments() until deployments obtained are ready

func WaitForEndpoint

func WaitForEndpoint(c kclientset.Interface, ns, name string) error

func WaitForEndpointsAvailable

func WaitForEndpointsAvailable(oc *exutil.CLI, serviceName string) error

func WaitForHypershiftHostedClusterReady

func WaitForHypershiftHostedClusterReady(oc *exutil.CLI, hostedClusterName, hostedClusterNS string)

WaitForHypershiftHostedClusterReady waits for the hostedCluster ready

func WaitForInternalRegistryHostname

func WaitForInternalRegistryHostname(oc *exutil.CLI) (string, error)

WaitForInternalRegistryHostname waits for the internal registry hostname to be made available to the cluster.

func WaitForNoPodsAvailable

func WaitForNoPodsAvailable(oc *exutil.CLI) error

WaitForNoPodsAvailable waits until there are no pods in the given namespace

func WaitForNoPodsAvailableByKind

func WaitForNoPodsAvailableByKind(oc *exutil.CLI, kind string, name string, namespace string)

WaitForNoPodsAvailableByKind used for checking no pods in a certain namespace

func WaitForNodeToDisappear

func WaitForNodeToDisappear(oc *exutil.CLI, nodeName string, timeout, interval time.Duration)

func WaitForOpenShiftNamespaceImageStreams

func WaitForOpenShiftNamespaceImageStreams(oc *exutil.CLI) error

WaitForOpenShiftNamespaceImageStreams waits for the standard set of imagestreams to be imported

func WaitForPods

func WaitForPods(c corev1client.PodInterface, label labels.Selector, predicate func(kapiv1.Pod) bool, count int, timeout time.Duration) ([]string, error)

WaitForPods waits until given number of pods that match the label selector and satisfy the predicate are found

func WaitForQueryOutputContains

func WaitForQueryOutputContains(oc *exutil.CLI, d Database, timeout time.Duration, admin bool, query, resultSubstr string) error

WaitForQueryOutputContains will execute the query multiple times, until the specified substring is found in the results. This function should be used for testing replication, since it might take some time until the data is propagated to slaves.

func WaitForQueryOutputSatisfies

func WaitForQueryOutputSatisfies(oc *exutil.CLI, d Database, timeout time.Duration, admin bool, query string, predicate func(string) bool) error

WaitForQueryOutputSatisfies will execute the query multiple times, until the specified predicate function is return true.

func WaitForResourceQuotaSync

func WaitForResourceQuotaSync(
	client corev1client.ResourceQuotaInterface,
	name string,
	expectedUsage corev1.ResourceList,
	expectedIsUpperLimit bool,
	timeout time.Duration,
) (corev1.ResourceList, error)

WaitForResourceQuotaSync watches given resource quota until its usage is updated to desired level or a timeout occurs. If successful, used quota values will be returned for expected resources. Otherwise an ErrWaitTimeout will be returned. If expectedIsUpperLimit is true, given expected usage must compare greater or equal to quota's usage, which is useful for expected usage increment. Otherwise expected usage must compare lower or equal to quota's usage, which is useful for expected usage decrement.

func WaitForResourceUpdate

func WaitForResourceUpdate(ctx context.Context, oc *exutil.CLI, interval, timeout time.Duration, kindAndName, namespace, oldResourceVersion string) error

WaitForResourceUpdate waits for the resourceVersion of a resource to be updated

func WaitForRouterInternalIP

func WaitForRouterInternalIP(oc *exutil.CLI) (string, error)

func WaitForRouterServiceIP

func WaitForRouterServiceIP(oc *exutil.CLI) (string, error)

func WaitForSelfSAR

func WaitForSelfSAR(interval, timeout time.Duration, c kclientset.Interface, selfSAR authorizationapiv1.SelfSubjectAccessReviewSpec) error

func WaitForServiceAccount

func WaitForServiceAccount(c corev1client.ServiceAccountInterface, name string, checkSecret bool) error

WaitForServiceAccount waits until the named service account gets fully provisioned

func WaitForUserBeAuthorized

func WaitForUserBeAuthorized(oc *exutil.CLI, user, verb, resource string) error

WaitForUserBeAuthorized waits a minute until the cluster bootstrap roles are available and the provided user is authorized to perform the action on the resource.

func WaitOprResourceReady

func WaitOprResourceReady(oc *exutil.CLI, kind, name, namespace string, islongduration bool, excludewinnode bool)

WaitOprResourceReady used for checking if deployment/daemonset/statefulset is ready

func WaitUntilAllHelpersAreUp

func WaitUntilAllHelpersAreUp(oc *exutil.CLI, helpers []Database) error

WaitUntilAllHelpersAreUp waits until all helpers are ready to serve requests.

func WaitUntilPodIsGone

func WaitUntilPodIsGone(c corev1client.PodInterface, podName string, timeout time.Duration) error

WaitUntilPodIsGone waits until the named Pod will disappear

func WaitUntilUp

func WaitUntilUp(oc *exutil.CLI, d Database, timeout time.Duration) error

WaitUntilUp continuously waits for the server to become ready, up until timeout.

func Yaml2Json

func Yaml2Json(s string) (string, error)

Yaml2Json converts yaml file to json format. Example:

util.Yaml2Json(string(yamlFile))

Types

type AWSInstanceNotFound

type AWSInstanceNotFound struct{ InstanceName string }

AWSInstanceNotFound custom error for not found instances

func (*AWSInstanceNotFound) Error

func (nfe *AWSInstanceNotFound) Error() string

Error implements the error interface

type AwsClient

type AwsClient struct {
	// contains filtered or unexported fields
}

AwsClient struct

func InitAwsSession

func InitAwsSession() *AwsClient

InitAwsSession init session

func InitAwsSessionWithRegion

func InitAwsSessionWithRegion(region string) *AwsClient

func (*AwsClient) AssociateDhcpOptions

func (a *AwsClient) AssociateDhcpOptions(vpcID, dhcpOptionsID string) error

AssociateDhcpOptions Associate a VPC with a dhcpOptions

func (*AwsClient) CreateDhcpOptions

func (a *AwsClient) CreateDhcpOptions() (string, error)

CreateDhcpOptions Create a dhcpOptions

func (*AwsClient) CreateDhcpOptionsWithDomainName

func (a *AwsClient) CreateDhcpOptionsWithDomainName(domainName string) (string, error)

CreateDhcpOptions Create a dhcpOptions with domainName

func (*AwsClient) CreateSecurityGroup

func (a *AwsClient) CreateSecurityGroup(groupName, vpcID, description string) (string, error)

func (*AwsClient) CreateTag

func (a *AwsClient) CreateTag(resource string, key string, value string) error

func (*AwsClient) DeleteDhcpOptions

func (a *AwsClient) DeleteDhcpOptions(dhcpOptionsID string) error

DeleteDhcpOptions Delete a dhcpOptions

func (*AwsClient) DeleteSecurityGroup

func (a *AwsClient) DeleteSecurityGroup(groupID string) error

func (*AwsClient) DeleteTag

func (a *AwsClient) DeleteTag(resource string, key string, value string) error

func (*AwsClient) DescribeTags

func (a *AwsClient) DescribeTags(resourceType string, resourceId string) (*ec2.DescribeTagsOutput, error)

DescribeTags retrieves the AWS tags associated with the specified resource type and resourceId. The resourceType should be a valid AWS resource type (e.g., "instance", "volume"), and resourceId should be the unique identifier of the AWS resource.

It returns a EC2 DescribeTagsOutput and an error if any occurred during the call. The DescribeTagsOutput can be converted to string by describeTagsOutput.String()

func (*AwsClient) DescribeVpcEndpoint

func (a *AwsClient) DescribeVpcEndpoint(endpointID string) (*ec2.VpcEndpoint, error)

func (*AwsClient) GetAvailabilityZoneNames

func (a *AwsClient) GetAvailabilityZoneNames() ([]string, error)

func (*AwsClient) GetAwsInstanceID

func (a *AwsClient) GetAwsInstanceID(instanceName string) (string, error)

GetAwsInstanceID Get int svc instance ID

func (*AwsClient) GetAwsInstanceIDFromHostname

func (a *AwsClient) GetAwsInstanceIDFromHostname(hostname string) (string, error)

GetAwsInstanceIDFromHostname Get instance ID from hostname

func (*AwsClient) GetAwsInstanceState

func (a *AwsClient) GetAwsInstanceState(instanceID string) (string, error)

GetAwsInstanceState gives the instance state

func (*AwsClient) GetAwsInstanceVPCId

func (a *AwsClient) GetAwsInstanceVPCId(instanceID string) (string, error)

GetAwsInstanceVPCId gives the instance vpcID

func (*AwsClient) GetAwsIntIPs

func (a *AwsClient) GetAwsIntIPs(instanceID string) (map[string]string, error)

GetAwsIntIPs get aws int ip

func (*AwsClient) GetAwsPrivateSubnetIDs

func (a *AwsClient) GetAwsPrivateSubnetIDs(vpcID string) ([]string, error)

GetAwsPrivateSubnetIDs get private subnet IDs

func (*AwsClient) GetAwsPublicSubnetID

func (a *AwsClient) GetAwsPublicSubnetID(clusterID string) (string, error)

GetAwsPublicSubnetID get one regular public subnet ID in aws outpost mixed worker cluster

func (*AwsClient) GetDefaultSecurityGroupByVpcID

func (a *AwsClient) GetDefaultSecurityGroupByVpcID(vpcID string) (*ec2.SecurityGroup, error)

func (*AwsClient) GetDhcpOptionsIDFromTag

func (a *AwsClient) GetDhcpOptionsIDFromTag(tagKey string, tagValue string) ([]string, error)

GetDhcpOptionsIDFromTag Get the dhcpOptionsID that have a tag

func (*AwsClient) GetDhcpOptionsIDOfVpc

func (a *AwsClient) GetDhcpOptionsIDOfVpc(vpcID string) (string, error)

GetDhcpOptionsIDOfVpc Get VPC's dhcpOptionsID

func (*AwsClient) GetInstanceSecurityGroupIDs

func (a *AwsClient) GetInstanceSecurityGroupIDs(instanceID string) ([]string, error)

func (*AwsClient) GetPlacementGroupByName

func (a *AwsClient) GetPlacementGroupByName(groupName string) (string, error)

GetPlacementGroupByName Get placement group by group-name

func (*AwsClient) GetSecurityGroupByGroupID

func (a *AwsClient) GetSecurityGroupByGroupID(groupID string) (*ec2.SecurityGroup, error)

func (*AwsClient) GetSecurityGroupByGroupName

func (a *AwsClient) GetSecurityGroupByGroupName(groupName string) (*ec2.SecurityGroup, error)

func (*AwsClient) GetSecurityGroupsByVpcEndpointID

func (a *AwsClient) GetSecurityGroupsByVpcEndpointID(endpointID string) ([]*ec2.SecurityGroupIdentifier, error)

func (*AwsClient) StartInstance

func (a *AwsClient) StartInstance(instanceID string) error

StartInstance Start an instance

func (*AwsClient) StopInstance

func (a *AwsClient) StopInstance(instanceID string) error

StopInstance Stop an instance

func (*AwsClient) UpdateAwsIntSecurityRule

func (a *AwsClient) UpdateAwsIntSecurityRule(instanceID string, dstPort int64) error

UpdateAwsIntSecurityRule update int security rule

type AzureClientSet

type AzureClientSet struct {
	// Account information
	SubscriptionID string
	// contains filtered or unexported fields
}

AzureClientSet encapsulates Azure account information and multiple clients.

func NewAzureClientSet

func NewAzureClientSet(subscriptionId string, tokenCredential azcore.TokenCredential) *AzureClientSet

func NewAzureClientSetWithCredsFromCanonicalFile

func NewAzureClientSetWithCredsFromCanonicalFile() *AzureClientSet

NewAzureClientSetWithCredsFromCanonicalFile creates an AzureClientSet using credentials from the canonical file location defined by AZURE_CREDS_LOCATION.

func NewAzureClientSetWithCredsFromFile

func NewAzureClientSetWithCredsFromFile(filePath string) *AzureClientSet

NewAzureClientSetWithCredsFromFile constructs an AzureClientSet with info gleaned from a file.

func NewAzureClientSetWithRootCreds

func NewAzureClientSetWithRootCreds(oc *exutil.CLI) *AzureClientSet

NewAzureClientSetWithRootCreds constructs an AzureClientSet with info gleaned from the in-cluster root credential.

func (*AzureClientSet) CreateCapacityReservation

func (cs *AzureClientSet) CreateCapacityReservation(ctx context.Context, capacityReservationGroupName string, capacityReservationName string, location string, resourceGroupName string, skuName string, zone string) error

CreateCapacityReservation create a capacity reservation

func (*AzureClientSet) CreateCapacityReservationGroup

func (cs *AzureClientSet) CreateCapacityReservationGroup(ctx context.Context, capacityReservationGroupName string, resourceGroupName string, location string, zone string) (string, error)

CreateCapacityReservationGroup create a capacity reservation group

func (*AzureClientSet) CreateResourceGroup

func (cs *AzureClientSet) CreateResourceGroup(ctx context.Context, resourceGroupName, region string) (armresources.ResourceGroupsClientCreateOrUpdateResponse, error)

Create an Azure resource group.

func (*AzureClientSet) CreateStorageAccount

func (cs *AzureClientSet) CreateStorageAccount(ctx context.Context, resourceGroupName, storageAccountName, region string) (armstorage.AccountsClientListKeysResponse, error)

Creates Azure storage account.

func (*AzureClientSet) DeleteCapacityReservation

func (cs *AzureClientSet) DeleteCapacityReservation(ctx context.Context, capacityReservationGroupName string, capacityReservationName string, resourceGroupName string) error

DeleteCapacityReservation delete capacity reservation

func (*AzureClientSet) DeleteCapacityReservationGroup

func (cs *AzureClientSet) DeleteCapacityReservationGroup(ctx context.Context, capacityReservationGroupName string, resourceGroupName string) error

DeleteCapacityReservationGroup delete capacity reservation group

func (*AzureClientSet) DeleteResourceGroup

func (cs *AzureClientSet) DeleteResourceGroup(ctx context.Context, rgName string) error

func (*AzureClientSet) DeleteStorageAccount

func (cs *AzureClientSet) DeleteStorageAccount(ctx context.Context, resourceGroupName, storageAccountName string)

Delete the created storage account.

func (*AzureClientSet) GetCapacityReservationGroupClient

func (cs *AzureClientSet) GetCapacityReservationGroupClient(options *arm.ClientOptions) *armcompute.CapacityReservationGroupsClient

GetCapacityReservationGroupClient get capacity reservation group Client

func (*AzureClientSet) GetCapacityReservationsClient

func (cs *AzureClientSet) GetCapacityReservationsClient(options *arm.ClientOptions) *armcompute.CapacityReservationsClient

GetCapacityReservationsClient get capacity reservations client

func (*AzureClientSet) GetFeaturesClient

func (cs *AzureClientSet) GetFeaturesClient(options *arm.ClientOptions) *armfeatures.Client

GetFeaturesClient get feature Client

func (*AzureClientSet) GetGraphServiceClient

func (cs *AzureClientSet) GetGraphServiceClient(scopes []string) *msgraphsdkgo.GraphServiceClient

GetGraphServiceClient gets the graph service client from AzureClientSet, constructs it if necessary. Pass a nil slice to use the default scope.

func (*AzureClientSet) GetKeysClient

func (cs *AzureClientSet) GetKeysClient(options *arm.ClientOptions) *armkeyvault.KeysClient

GetKeysClient gets the keys client from AzureClientSet, constructs it if necessary.

func (*AzureClientSet) GetResourceGroupClient

func (cs *AzureClientSet) GetResourceGroupClient(options *arm.ClientOptions) *armresources.ResourceGroupsClient

GetResourceGroupClient gets the resource group client from the AzureClientSet, constructs it if necessary. Concurrent invocation of this method is safe only when AzureClientSet.resourceGroupsClient is non-nil, which is the case when the resourceGroupsClient is eagerly initialized.

func (*AzureClientSet) GetServicePrincipalObjectId

func (cs *AzureClientSet) GetServicePrincipalObjectId(ctx context.Context, appId string) (string, error)

func (*AzureClientSet) GetStorageAccountProperties

func (cs *AzureClientSet) GetStorageAccountProperties(storageAccountName string, resourceGroupName string) armstorage.AccountsClientGetPropertiesResponse

func (*AzureClientSet) GetVaultsClient

func (cs *AzureClientSet) GetVaultsClient(options *arm.ClientOptions) *armkeyvault.VaultsClient

GetVaultsClient gets the vaults client from AzureClientSet, constructs it if necessary.

func (*AzureClientSet) GetVirtualMachinesClient

func (cs *AzureClientSet) GetVirtualMachinesClient(options *arm.ClientOptions) *armcompute.VirtualMachinesClient

GetVirtualMachinesClient gets the virtual machine client from AzureClientSet, constructs it if necessary.

func (*AzureClientSet) RegisterEncryptionAtHost

func (cs *AzureClientSet) RegisterEncryptionAtHost(ctx context.Context) error

RegisterEncryptionAtHost enable EncryptionAtHost in azure

type AzureCredentials

type AzureCredentials struct {
	AzureClientID       string `json:"azure_client_id,omitempty"`
	AzureClientSecret   string `json:"azure_client_secret,omitempty" sensitive:"true"`
	AzureSubscriptionID string `json:"azure_subscription_id,omitempty"`
	AzureTenantID       string `json:"azure_tenant_id,omitempty"`
	AzureResourceGroup  string `json:"azure_resourcegroup,omitempty"`
	AzureResourcePrefix string `json:"azure_resource_prefix,omitempty"`
	AzureRegion         string `json:"azure_region"`
	// contains filtered or unexported fields
}

func NewEmptyAzureCredentials

func NewEmptyAzureCredentials() *AzureCredentials

func (*AzureCredentials) GetFromClusterAndDecode

func (ac *AzureCredentials) GetFromClusterAndDecode(oc *exutil.CLI) error

func (*AzureCredentials) SetSdkEnvVars

func (ac *AzureCredentials) SetSdkEnvVars() error

SetSdkEnvVars sets some environment variables used by azure-sdk-for-go. See https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/azidentity/README.md#environment-variables.

func (*AzureCredentials) String

func (ac *AzureCredentials) String() string

type AzureCredentialsFromFile

type AzureCredentialsFromFile struct {
	AzureClientID       string `json:"clientId,omitempty"`
	AzureClientSecret   string `json:"clientSecret,omitempty" sensitive:"true"`
	AzureSubscriptionID string `json:"subscriptionId,omitempty"`
	AzureTenantID       string `json:"tenantId,omitempty"`
}

func NewEmptyAzureCredentialsFromFile

func NewEmptyAzureCredentialsFromFile() *AzureCredentialsFromFile

func (*AzureCredentialsFromFile) LoadFromFile

func (ac *AzureCredentialsFromFile) LoadFromFile(filePath string) error

func (*AzureCredentialsFromFile) SetSdkEnvVars

func (ac *AzureCredentialsFromFile) SetSdkEnvVars() error

SetSdkEnvVars sets some environment variables used by azure-sdk-for-go. See https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/azidentity/README.md#environment-variables.

func (*AzureCredentialsFromFile) String

func (ac *AzureCredentialsFromFile) String() string

type AzureSession

type AzureSession struct {
	SubscriptionID string
	Authorizer     autorest.Authorizer
}

AzureSession is an object representing session for subscription

func NewAzureSessionFromEnv

func NewAzureSessionFromEnv() (*AzureSession, error)

NewAzureSessionFromEnv new azure session from env credentials

type BucketEmptiness

type BucketEmptiness bool

BucketEmptiness captures a S3 bucket's state of emptiness i.e. it is empty or not.

const (
	BucketEmpty    BucketEmptiness = true
	BucketNonEmpty BucketEmptiness = false
)

func (BucketEmptiness) String

func (be BucketEmptiness) String() string

type BuildResult

type BuildResult struct {
	// BuildPath is a resource qualified name (e.g. "build/test-1").
	BuildPath string
	// BuildName is the non-resource qualified name.
	BuildName string
	// StartBuildStdErr is the StdErr output generated by oc start-build.
	StartBuildStdErr string
	// StartBuildStdOut is the StdOut output generated by oc start-build.
	StartBuildStdOut string
	// StartBuildErr is the error, if any, returned by the direct invocation of the start-build command.
	StartBuildErr error
	// The buildconfig which generated this build.
	BuildConfigName string
	// Build is the resource created. May be nil if there was a timeout.
	Build *buildv1.Build
	// BuildAttempt represents that a Build resource was created.
	// false indicates a severe error unrelated to Build success or failure.
	BuildAttempt bool
	// BuildSuccess is true if the build was finshed successfully.
	BuildSuccess bool
	// BuildFailure is true if the build was finished with an error.
	BuildFailure bool
	// BuildCancelled is true if the build was canceled.
	BuildCancelled bool
	// BuildTimeout is true if there was a timeout waiting for the build to finish.
	BuildTimeout bool
	// Alternate log dumper function. If set, this is called instead of 'oc logs'
	LogDumper LogDumperFunc
	// The openshift client which created this build.
	Oc *exutil.CLI
}

func NewBuildResult

func NewBuildResult(oc *exutil.CLI, build *buildv1.Build) *BuildResult

func StartBuildAndWait

func StartBuildAndWait(oc *exutil.CLI, args ...string) (result *BuildResult, err error)

StartBuildAndWait executes OC start-build with the specified arguments on an existing buildconfig. Note that start-build will be run with "-o=name" as a parameter when using this method. If no error is returned from this method, it means that the build attempted successfully, NOT that the build completed. For completion information, check the BuildResult object.

func StartBuildResult

func StartBuildResult(oc *exutil.CLI, args ...string) (result *BuildResult, err error)

func (*BuildResult) AssertFailure

func (t *BuildResult) AssertFailure() *BuildResult

Dumps logs and triggers a Ginkgo assertion if the build did NOT have an error (this will not assert on timeouts)

func (*BuildResult) AssertSuccess

func (t *BuildResult) AssertSuccess() *BuildResult

Dumps logs and triggers a Ginkgo assertion if the build did NOT succeed.

func (*BuildResult) DumpLogs

func (t *BuildResult) DumpLogs()

DumpLogs sends logs associated with this BuildResult to the GinkgoWriter.

func (*BuildResult) Logs

func (t *BuildResult) Logs() (string, error)

Logs returns the logs associated with this build.

func (*BuildResult) LogsNoTimestamp

func (t *BuildResult) LogsNoTimestamp() (string, error)

LogsNoTimestamp returns the logs associated with this build.

type ByName

type ByName []mo.VirtualMachine

A ByName is vm type object

func (ByName) Len

func (n ByName) Len() int

func (ByName) Less

func (n ByName) Less(i, j int) bool

func (ByName) Swap

func (n ByName) Swap(i, j int)

type ContainerMemoryRSSType

type ContainerMemoryRSSType struct {
	Data struct {
		Result []struct {
			Metric struct {
				MetricName string `json:"__name__"`
				Container  string `json:"container"`
				Endpoint   string `json:"endpoint"`
				ID         string `json:"id"`
				Image      string `json:"image"`
				Instance   string `json:"instance"`
				Job        string `json:"job"`
				MetricPath string `json:"metrics_path"`
				Name       string `json:"name"`
				Namespace  string `json:"namespace"`
				Node       string `json:"node"`
				Pod        string `json:"pod"`
				Service    string `json:"service"`
			} `json:"metric"`
			Value []interface{} `json:"value"`
		} `json:"result"`
		ResultType string `json:"resultType"`
	} `json:"data"`
	Status string `json:"status"`
}

type CoreOSImageArch

type CoreOSImageArch string

func (CoreOSImageArch) String

func (a CoreOSImageArch) String() string

type Credential

type Credential struct {
	Type string `json:"type"`
	Data struct {
		PrismCentral struct {
			Username string `json:"username"`
			Password string `json:"password"`
		} `json:"prismCentral"`
	} `json:"data"`
}

Credential is an object representing credentials

type Database

type Database interface {
	// PodName returns the name of the Pod this helper is bound to.
	PodName() string

	// IsReady indicates whether the underlying Pod is ready for queries.
	IsReady(oc *exutil.CLI) (bool, error)

	// Query queries the database as a regular user.
	Query(oc *exutil.CLI, query string) (string, error)

	// QueryPrivileged queries the database as a privileged user.
	QueryPrivileged(oc *exutil.CLI, query string) (string, error)

	// TestRemoteLogin tests whether it is possible to remote login to hostAddress.
	TestRemoteLogin(oc *exutil.CLI, hostAddress string) error
}

Database interface allows testing database images.

type ECRClient

type ECRClient struct {
	// contains filtered or unexported fields
}

ECRClient struct

func NewECRClient

func NewECRClient(region string) *ECRClient

NewECRClient creates an ECRClient

func (*ECRClient) CreateContainerRepository

func (ecrClient *ECRClient) CreateContainerRepository(repositoryName string) (string, error)

CreateContainerRepository create a container repository

func (*ECRClient) DeleteContainerRepository

func (ecrClient *ECRClient) DeleteContainerRepository(repositoryName string) error

DeleteContainerRepository delete container repository

func (*ECRClient) GetAuthorizationToken

func (ecrClient *ECRClient) GetAuthorizationToken() (string, error)

GetAuthorizationToken get container repository credential

type Gcloud

type Gcloud struct {
	ProjectID string
}

Gcloud struct

func (*Gcloud) AddBGPPeerToRouter

func (gcloud *Gcloud) AddBGPPeerToRouter(routerName string, peerName string, peerASN int64, interfaceName string, peerIPAddress string, region string) (addBGPPeerToRouter []byte, err error)

func (*Gcloud) AddInterfaceToRouter

func (gcloud *Gcloud) AddInterfaceToRouter(routerName string, interfaceName string, tunnelName string, ipAddress string, maskLength int, region string) (addInterfaceToRouter []byte, err error)

func (*Gcloud) CreateDeploymentManager

func (gcloud *Gcloud) CreateDeploymentManager(deploymentName string, config string) (deploymentManagerInfo []byte, err error)

func (*Gcloud) CreateExternalVPNGateway

func (gcloud *Gcloud) CreateExternalVPNGateway(gatewayName string, vpnAddress []string) (createExternalVPNGateway []byte, err error)

func (*Gcloud) CreateVPNGateway

func (gcloud *Gcloud) CreateVPNGateway(gatewayName string, networkName string, region string) (createVPNGateway []byte, err error)

func (*Gcloud) CreateVPNTunnel

func (gcloud *Gcloud) CreateVPNTunnel(tunnelName string, peerGateway string, peerGatewayInterface int, region string, sharedSecret string, routerName string, vpnGateway string, interfaceIndex int) (createVPNTunnel []byte, err error)

func (*Gcloud) CreateVpnRouter

func (gcloud *Gcloud) CreateVpnRouter(routerName string, networkName string, region string, asn int32) (createVpnRouter []byte, err error)

func (*Gcloud) DeleteDeploymentManager

func (gcloud *Gcloud) DeleteDeploymentManager(deploymentName string) (deploymentManagerInfo []byte, err error)

func (*Gcloud) DeleteExternalVPNGateway

func (gcloud *Gcloud) DeleteExternalVPNGateway(gatewayName string) (deleteExternalVPNGateway []byte, err error)

func (*Gcloud) DeleteVPNGateway

func (gcloud *Gcloud) DeleteVPNGateway(gatewayName string, region string) (deleteVPNGateway []byte, err error)

func (*Gcloud) DeleteVPNTunnel

func (gcloud *Gcloud) DeleteVPNTunnel(tunnelName string, region string) (deleteVPNTunnel []byte, err error)

func (*Gcloud) DeleteVpnRouter

func (gcloud *Gcloud) DeleteVpnRouter(routerName string, region string) (deleteVpnRouter []byte, err error)

func (*Gcloud) GetFilestoreInstanceInfo

func (gcloud *Gcloud) GetFilestoreInstanceInfo(pvName string, filterArgs ...string) ([]byte, error)

GetFilestoreInstanceInfo returns filestore instance detailed info from banckend

func (*Gcloud) GetFirewallAllowPorts

func (gcloud *Gcloud) GetFirewallAllowPorts(ruleName string) (string, error)

GetFirewallAllowPorts returns firewall allow ports

func (*Gcloud) GetGcpInstanceByNode

func (gcloud *Gcloud) GetGcpInstanceByNode(nodeIdentity string) (string, error)

GetGcpInstanceByNode returns the instance name

func (*Gcloud) GetGcpInstanceStateByNode

func (gcloud *Gcloud) GetGcpInstanceStateByNode(nodeIdentity string) (string, error)

GetGcpInstanceStateByNode returns the instance state

func (*Gcloud) GetIntSvcExternalIP

func (gcloud *Gcloud) GetIntSvcExternalIP(infraID string) (string, error)

GetIntSvcExternalIP returns the int svc external IP

func (*Gcloud) GetIntSvcInternalIP

func (gcloud *Gcloud) GetIntSvcInternalIP(infraID string) (string, error)

GetIntSvcInternalIP returns the int svc internal IP

func (*Gcloud) GetPdVolumeInfo

func (gcloud *Gcloud) GetPdVolumeInfo(pvName string, filterArgs ...string) ([]byte, error)

GetPdVolumeInfo returns pd volume detailed info from backend

func (*Gcloud) GetResourceTags

func (gcloud *Gcloud) GetResourceTags(bucketName string, zone string) ([]byte, error)

func (*Gcloud) GetVPNGatewayIP

func (gcloud *Gcloud) GetVPNGatewayIP(gatewayName, region string, interfaceIndex int) (string, error)

func (*Gcloud) GetZone

func (gcloud *Gcloud) GetZone(infraID string, workerName string) (string, error)

GetZone get zone information for an instance

func (*Gcloud) Login

func (gcloud *Gcloud) Login() *Gcloud

Login logins to the gcloud. This function needs to be used only once to login into the GCP. the gcloud client is only used for the cluster which is on gcp platform.

func (*Gcloud) StartInstance

func (gcloud *Gcloud) StartInstance(nodeName string, zoneName string) error

StartInstance Bring GCP node/instance back up

func (*Gcloud) StopInstance

func (gcloud *Gcloud) StopInstance(nodeName string, zoneName string) error

StopInstance Shutdown GCP node/instance

func (*Gcloud) StopInstanceAsync

func (gcloud *Gcloud) StopInstanceAsync(nodeName string, zoneName string) error

StopInstanceAsync Shutdown GCP node/instance with async

func (*Gcloud) UpdateFirewallAllowPorts

func (gcloud *Gcloud) UpdateFirewallAllowPorts(ruleName string, ports string) error

UpdateFirewallAllowPorts updates the firewall allow ports

type GitRepo

type GitRepo struct {
	RepoPath string
	// contains filtered or unexported fields
}

func NewGitRepo

func NewGitRepo(repoName string) (GitRepo, error)

NewGitRepo creates temporary test directories with local and "remote" git repo

func (GitRepo) AddAndCommit

func (r GitRepo) AddAndCommit(file, content string) error

AddAndCommit commits a file with its content to local repo

func (GitRepo) Remove

func (r GitRepo) Remove()

Remove performs cleanup of no longer needed directories with local and "remote" git repo

type HostedClusterPlatformType

type HostedClusterPlatformType = string
const (
	// AWSPlatform represents Amazon Web Services infrastructure.
	AWSPlatform HostedClusterPlatformType = "AWS"

	// NonePlatform represents user supplied (e.g. bare metal) infrastructure.
	NonePlatform HostedClusterPlatformType = "None"

	// IBMCloudPlatform represents IBM Cloud infrastructure.
	IBMCloudPlatform HostedClusterPlatformType = "IBMCloud"

	// AgentPlatform represents user supplied insfrastructure booted with agents.
	AgentPlatform HostedClusterPlatformType = "Agent"

	// KubevirtPlatform represents Kubevirt infrastructure.
	KubevirtPlatform HostedClusterPlatformType = "KubeVirt"

	// AzurePlatform represents Azure infrastructure.
	AzurePlatform HostedClusterPlatformType = "Azure"

	// PowerVSPlatform represents PowerVS infrastructure.
	PowerVSPlatform HostedClusterPlatformType = "PowerVS"
)

func GetHostedClusterPlatformType

func GetHostedClusterPlatformType(oc *exutil.CLI, clusterName, clusterNamespace string) (HostedClusterPlatformType, error)

GetHostedClusterPlatformType returns a hosted cluster platform type oc is the management cluster client to query the hosted cluster platform type based on hostedcluster CR obj

type IAMClient

type IAMClient struct {
	// contains filtered or unexported fields
}

IAMClient struct for IAM operations

func NewDelegatingIAMClient

func NewDelegatingIAMClient(wrappedClient *iam.IAM) *IAMClient

NewDelegatingIAMClient creates an IAMClient which delegates calls to methods that are not implemented by itself to the wrapped iam.IAM client.

func NewIAMClient

func NewIAMClient() *IAMClient

NewIAMClient constructor to create IAM client with default credential and config Should use GetAwsCredentialFromCluster(oc) to set ENV first before using it

func NewIAMClientFromCredFile

func NewIAMClientFromCredFile(filename, region string) *IAMClient

NewIAMClientFromCredFile constructor to create IAM client with user's credential file

func (*IAMClient) AttachRolePolicy

func (iamClient *IAMClient) AttachRolePolicy(roleName, policyArn string) error

Attach role policy

func (*IAMClient) CreatePolicy

func (iamClient *IAMClient) CreatePolicy(policyDocument string, policyName string, description string, tagList map[string]string, path string) (string, error)

Create policy

func (*IAMClient) CreateRoleWithContext

func (iamClient *IAMClient) CreateRoleWithContext(ctx aws.Context, input *iam.CreateRoleInput, opts ...request.Option) (*iam.CreateRoleOutput, error)

func (*IAMClient) DeleteOpenIDConnectProviderByProviderName

func (iamClient *IAMClient) DeleteOpenIDConnectProviderByProviderName(providerName string) error

func (*IAMClient) DeletePolicy

func (iamClient *IAMClient) DeletePolicy(policyArn string) error

Delete policy

func (*IAMClient) DeleteRoleWithContext

func (iamClient *IAMClient) DeleteRoleWithContext(ctx aws.Context, input *iam.DeleteRoleInput, opts ...request.Option) (*iam.DeleteRoleOutput, error)

func (*IAMClient) DetachRolePolicy

func (iamClient *IAMClient) DetachRolePolicy(roleName, policyArn string) error

Detach role policy

func (*IAMClient) GetRolePolicy

func (iamClient *IAMClient) GetRolePolicy(roleName, policyName string) (string, error)

func (*IAMClient) ListOperatsorRolesByPrefix

func (iamClient *IAMClient) ListOperatsorRolesByPrefix(prefix string, version string) ([]*iam.Role, error)

func (*IAMClient) ListRoles

func (iamClient *IAMClient) ListRoles() ([]*iam.Role, error)

func (*IAMClient) UpdateRolePolicy

func (iamClient *IAMClient) UpdateRolePolicy(roleName, policyName, policyDocument string) error

type IBMPowerVsSession

type IBMPowerVsSession struct {
	// contains filtered or unexported fields
}

func LoginIBMPowerVsCloud

func LoginIBMPowerVsCloud(apiKey, zone, userAccount string, cloudId string) (*IBMPowerVsSession, error)

LoginIBMPowerVsCloud authenticates and returns a session for Powervs cloud

type IBMSession

type IBMSession struct {
	// contains filtered or unexported fields
}

IBMSession is an object representing an IBM session

func NewIBMSessionFromEnv

func NewIBMSessionFromEnv(ibmApiKey string) (*IBMSession, error)

NewIBMSessionFromEnv creates a new IBM session from environment credentials

type KMSClient

type KMSClient struct {
	// contains filtered or unexported fields
}

KMSClient struct.

func NewKMSClient

func NewKMSClient(region string) *KMSClient

Init the aws KMS client.

func (*KMSClient) CreateKey

func (kmsClient *KMSClient) CreateKey(description string) (string, error)

CreateKey create a key

func (*KMSClient) DeleteKey

func (kmsClient *KMSClient) DeleteKey(key string) error

DeleteKey delete a key

type LogDumperFunc

type LogDumperFunc func(oc *exutil.CLI, br *BuildResult) (string, error)

type MissingTagError

type MissingTagError struct {
	Tags []string
}

func (MissingTagError) Error

func (mte MissingTagError) Error() string

type Monitor

type Monitor struct {
	Token string
	// contains filtered or unexported fields
}

Monitor define a monitor object. It will query thanos

func NewMonitor

func NewMonitor(oc *exutil.CLI) (*Monitor, error)

NewMonitor create a monitor using thanos URL

func (*Monitor) GetAlertRules

func (mo *Monitor) GetAlertRules() (string, error)

GetAlertRules returns all alerting rules

func (*Monitor) GetAlerts

func (mo *Monitor) GetAlerts() (string, error)

GetAlerts returns all alerts. It doesn't use the alermanager, and it returns alerts in 'pending' state too

func (*Monitor) GetAllRules

func (mo *Monitor) GetAllRules() (string, error)

GetAllRules returns all rules

func (*Monitor) GetRecordRules

func (mo *Monitor) GetRecordRules() (string, error)

GetRecordRules returns all recording rules

func (*Monitor) InstantQuery

func (mo *Monitor) InstantQuery(queryParams MonitorInstantQueryParams) (string, error)

InstantQuery query executes a query in prometheus with time and timeout.

Example:  curl 'http://host:port/api/v1/query?query=up&time=2015-07-01T20:10:51.781Z'

func (*Monitor) InstantQueryWithRetry

func (mo *Monitor) InstantQueryWithRetry(queryParams MonitorInstantQueryParams, timeDurationSec int) string

InstantQueryWithRetry passes QueryParams to InstantQuery and polls it until it succeeds or times out.

func (*Monitor) RangeQuery

func (mo *Monitor) RangeQuery(queryParams MonitorRangeQueryParams) (string, error)

RangeQuery executes a query range in prometheus with start, end, step and timeout

Example: curl 'http://host:port/api/v1/query_range?query=metricname&start=2015-07-01T20:10:30.781Z&end=2015-07-01T20:11:00.781Z&step=15s'

func (*Monitor) SimpleQuery

func (mo *Monitor) SimpleQuery(query string) (string, error)

SimpleQuery query executes a query in prometheus. .../query?query=$query_to_execute

type MonitorInstantQueryParams

type MonitorInstantQueryParams struct {
	Query   string
	Time    string
	Timeout string
}

MonitorInstantQueryParams API doc query parameters:

query=<string>: Prometheus expression query string.
time=<rfc3339 | unix_timestamp>: Evaluation timestamp. Optional.
timeout=<duration>: Evaluation timeout. Optional. Defaults to and is capped by the value of the -query.timeout flag.

type MonitorRangeQueryParams

type MonitorRangeQueryParams struct {
	Query   string
	Start   string
	End     string
	Step    string
	Timeout string
}

MonitorRangeQueryParams API doc query range parameters

query=<string>: Prometheus expression query string.
start=<rfc3339 | unix_timestamp>: Start timestamp, inclusive.
end=<rfc3339 | unix_timestamp>: End timestamp, inclusive.
step=<duration | float>: Query resolution step width in duration format or float number of seconds.
timeout=<duration>: Evaluation timeout. Optional. Defaults to and is capped by the value of the -query.timeout flag.

type Monitorer

type Monitorer interface {
	SimpleQuery(query string) (string, error)
	InstantQuery(queryParams MonitorInstantQueryParams) (string, error)
	RangeQuery(queryParams MonitorRangeQueryParams) (string, error)

	GetAllRules() (string, error)
	GetAlertRules() (string, error)
	GetRecordRules() (string, error)
	// contains filtered or unexported methods
}

Monitorer interface represents all funcs of monitoring

type NodeResources

type NodeResources struct {
	CPU    int64
	Memory int64
}

NodeResources contains the resources of CPU and Memory in a node

type NutanixClient

type NutanixClient struct {
	// contains filtered or unexported fields
}

func InitNutanixClient

func InitNutanixClient(oc *exutil.CLI) (*NutanixClient, error)

Initial nutanix client by configuring coresponding parameters

func (*NutanixClient) ChangeNutanixVMState

func (nt *NutanixClient) ChangeNutanixVMState(vmUUID string, targeState string) error

Change NutanixVMstate, target state should be "ON" or "OFF"

func (*NutanixClient) GetNutanixVMState

func (nt *NutanixClient) GetNutanixVMState(vmUUID string) (string, error)

Get Nutanix VM state, general value would be "ON" or "OFF"

func (*NutanixClient) GetNutanixVMUUID

func (nt *NutanixClient) GetNutanixVMUUID(nodeName string) (string, error)

Get Nutanix VM UUID

type NutanixSession

type NutanixSession struct {
	Username string
	Password string
	Endpoint string
	// contains filtered or unexported fields
}

NutanixSession is an object representing an nutanix session

func NewNutanixSession

func NewNutanixSession(username, password, endpoint string) (*NutanixSession, error)

NewNutanixSession creates a new nutanix session from environment credentials

func (*NutanixSession) GetNutanixInstanceID

func (nutanixSess *NutanixSession) GetNutanixInstanceID(instanceName string) (string, error)

GetNutanixInstanceID get nutanix instance id

func (*NutanixSession) GetNutanixInstanceState

func (nutanixSess *NutanixSession) GetNutanixInstanceState(instanceID string) (string, error)

GetNutanixInstanceState get nutanix powerstate for e.g. ON or OFF

func (*NutanixSession) SetNutanixInstanceState

func (nutanixSess *NutanixSession) SetNutanixInstanceState(targetState string, instanceUUID string) error

SetNutanixInstanceState changes the Nutanix power state, e.g., ON or OFF

type OpenstackCredentials

type OpenstackCredentials struct {
	Clouds struct {
		Openstack struct {
			Auth struct {
				AuthURL                     string `yaml:"auth_url"`
				Password                    string `yaml:"password"`
				ProjectID                   string `yaml:"project_id"`
				ProjectName                 string `yaml:"project_name"`
				UserDomainName              string `yaml:"user_domain_name"`
				Username                    string `yaml:"username"`
				ApplicationCredentialID     string `yaml:"application_credential_id"`
				ApplicationCredentialSecret string `yaml:"application_credential_secret"`
			} `yaml:"auth"`
			EndpointType       string `yaml:"endpoint_type"`
			IdentityAPIVersion string `yaml:"identity_api_version"`
			RegionName         string `yaml:"region_name"`
			Verify             bool   `yaml:"verify"`
		} `yaml:"openstack"`
	} `yaml:"clouds"`
}

OpenstackCredentials the openstack credentials extracted from cluster

func GetOpenStackCredentials

func GetOpenStackCredentials(oc *exutil.CLI) (*OpenstackCredentials, error)

GetOpenStackCredentials gets credentials from cluster

type Osp

type Osp struct {
	// contains filtered or unexported fields
}

A Osp represents object ...

func (*Osp) GetOspInstance

func (osp *Osp) GetOspInstance(client *gophercloud.ServiceClient, instanceName string) (string, error)

GetOspInstance represents to list osp instance using SDK

func (*Osp) GetOspInstanceState

func (osp *Osp) GetOspInstanceState(client *gophercloud.ServiceClient, instanceName string) (string, error)

GetOspInstanceState represents to list osp instance state using SDK

func (*Osp) GetStartOspInstance

func (osp *Osp) GetStartOspInstance(client *gophercloud.ServiceClient, instanceName string) error

GetStartOspInstance represents to start osp instance using SDK

func (*Osp) GetStopOspInstance

func (osp *Osp) GetStopOspInstance(client *gophercloud.ServiceClient, instanceName string) error

GetStopOspInstance represents to stop osp instance using SDK

type Pod

type Pod struct {
	Name       string
	Namespace  string
	Template   string
	Parameters []string
}

Pod Parameters can be used to set the template parameters except PodName as PodName can be provided using pod.Name

func (*Pod) Create

func (pod *Pod) Create(oc *exutil.CLI)

Create creates a pod on the basis of Pod struct For Ex: pod := Pod{Name: "PodName", Namespace: "NSName", Template: "PodTemplateLocation", Parameters: []string{"HOSTNAME=NODE_IP"}} pod.Create(oc) The pod name parameter must be NAME in the template file

func (*Pod) Delete

func (pod *Pod) Delete(oc *exutil.CLI) error

Delete pod

type PrometheusMonitor

type PrometheusMonitor struct {
	Monitor
}

PrometheusMonitor define a monitor object. It will query prometheus directly instead of thanos

func NewPrometheusMonitor

func NewPrometheusMonitor(oc *exutil.CLI) (*PrometheusMonitor, error)

NewPrometheusMonitor create a monitor using prometheus url

type RDU2Host

type RDU2Host struct {
	Name             string `yaml:"name"`
	BmcAddress       string `yaml:"bmc_address"`
	BmcUser          string `yaml:"bmc_user"`
	BmcPassword      string `yaml:"bmc_pass"`
	BmcForwardedPort uint16 `yaml:"bmc_forwarded_port"`
	Host             string `yaml:"host"`
	JumpHost         string `yaml:"-"`
	MacAddress       string `yaml:"mac"`
	RedfishScheme    string `yaml:"redfish_scheme"`
	RedfishBaseURI   string `yaml:"redfish_base_uri"`
}

RDU2Host models the RDU2 host (partial representation)

func (*RDU2Host) GetMachinePowerStatus

func (h *RDU2Host) GetMachinePowerStatus() (string, error)

GetMachinePowerStatus returns the power status of the BM Machine

func (*RDU2Host) StartUPIbaremetalInstance

func (h *RDU2Host) StartUPIbaremetalInstance() error

StartUPIbaremetalInstance power on the BM machine

func (*RDU2Host) StopUPIbaremetalInstance

func (h *RDU2Host) StopUPIbaremetalInstance() error

StopUPIbaremetalInstance power off the BM machine

type RDU2Hosts

type RDU2Hosts struct {
	// contains filtered or unexported fields
}

RDU2Hosts holds the collection of RDU2 hosts and provides methods to manage them

type ReplicaSet

type ReplicaSet interface {
	// QueryPrimary queries the database on primary node as a regular user.
	QueryPrimary(oc *exutil.CLI, query string) (string, error)
}

ReplicaSet interface allows to interact with database on multiple nodes.

type Route53Client

type Route53Client struct {
	*route53.Route53
}

Route53Client extends the route53.Route53 client without overriding its existing methods.

func NewRoute53Client

func NewRoute53Client() *Route53Client

NewRoute53Client creates a new Route53Client. It is expected to be called after GetAwsCredentialFromCluster which sets AWS-specific environment variables.

func (*Route53Client) DeleteHostedZoneWithContextAndCheck

func (route53Client *Route53Client) DeleteHostedZoneWithContextAndCheck(ctx context.Context, input *route53.DeleteHostedZoneInput, opts ...request.Option) (*route53.DeleteHostedZoneOutput, error)

DeleteHostedZoneWithContextAndCheck deletes a hosted zone (delegate to the wrapped route53.Route53 client), then wait for the deletion to take effect.

func (*Route53Client) EmptyHostedZoneWithContext

func (route53Client *Route53Client) EmptyHostedZoneWithContext(ctx context.Context, hostedZoneId string) (*route53.ChangeResourceRecordSetsOutput, error)

EmptyHostedZoneWithContext removes all except NS/SOA records in a hosted zone, then wait until the changes to take effect.

type S3Client

type S3Client struct {
	// contains filtered or unexported fields
}

S3Client struct for S3 storage operations

func NewDelegatingS3Client

func NewDelegatingS3Client(wrappedClient *s3.S3) *S3Client

NewDelegatingS3Client creates an S3Client which delegates calls to methods that are not implemented by itself to the wrapped s3.S3 client.

func NewS3Client

func NewS3Client() *S3Client

NewS3Client constructor to create S3 client with default credential and config

func NewS3ClientFromCredFile

func NewS3ClientFromCredFile(filename, profile, region string) *S3Client

NewS3ClientFromCredFile constrctor to create S3 client with user's credential file and region param: filename crednetial file path param: profile config profile e.g. [default] param: region

func (*S3Client) CreateBucket

func (sc *S3Client) CreateBucket(name string) error

CreateBucket create S3 bucket param: bucket name from user input

func (*S3Client) DeleteBucket

func (sc *S3Client) DeleteBucket(name string) error

DeleteBucket delete S3 bucket param: name bucket name from user input

func (*S3Client) EmptyBucketWithContextAndCheck

func (sc *S3Client) EmptyBucketWithContextAndCheck(ctx context.Context, bucketName string) error

EmptyBucketWithContextAndCheck empties a bucket, then wait for the deletions to take effect.

func (*S3Client) HeadBucket

func (sc *S3Client) HeadBucket(name string) error

HeadBucket util func to check whether bucket exists or not param: name bucket name

func (*S3Client) IsBucketEmptyWithContext

func (sc *S3Client) IsBucketEmptyWithContext(ctx aws.Context, input *s3.ListObjectsV2Input, opts ...request.Option) (bool, error)

func (*S3Client) PutBucketPolicy

func (sc *S3Client) PutBucketPolicy(name, policy string) error

PutBucketPolicy configures a given bucket with a policy param: name bucket name param: policy policy that will be added the bucket

func (*S3Client) WaitForBucketEmptinessWithContext

func (sc *S3Client) WaitForBucketEmptinessWithContext(ctx context.Context, bucketName string,
	bucketEmptiness BucketEmptiness, interval, timeout time.Duration) error

WaitForBucketEmptinessWithContext waits for the expected bucket emptiness (i.e. empty/non-empty) to be fulfilled.

type Secret

type Secret struct {
	Data struct {
		Credentials string `json:"credentials"`
	} `json:"data"`
}

Secret is an object representing secrets

type SecureMatcher

type SecureMatcher struct {
	// contains filtered or unexported fields
}

SecureMatcher it will not print the compared values when the matcher fails

func (*SecureMatcher) FailureMessage

func (matcher *SecureMatcher) FailureMessage(actual interface{}) (message string)

FailureMessage returns the message in case of successful match

func (*SecureMatcher) Match

func (matcher *SecureMatcher) Match(actual interface{}) (success bool, err error)

Match checks it the condition with the given type has the right value in the given field.

func (*SecureMatcher) NegatedFailureMessage

func (matcher *SecureMatcher) NegatedFailureMessage(actual interface{}) (message string)

NegatedFailureMessage returns the message in case of failed match

type SshClient

type SshClient struct {
	User       string
	Host       string
	Port       int
	PrivateKey string
}

func (*SshClient) Run

func (sshClient *SshClient) Run(cmd string) error

Run runs cmd on the remote host.

func (*SshClient) RunOutput

func (sshClient *SshClient) RunOutput(cmd string) (string, error)

RunOutput runs cmd on the remote host and returns its combined standard output and standard error.

type StringPairs

type StringPairs struct {
	OldString string
	NewString string
}

The string pairs to update in a file

type StsClient

type StsClient struct {
	*sts.STS
}

StsClient extends the sts.STS client without overriding its existing methods.

func NewDelegatingStsClient

func NewDelegatingStsClient(wrappedClient *sts.STS) *StsClient

NewDelegatingStsClient creates an StsClient which delegates calls to methods that are not implemented by itself to the wrapped sts.STS client.

type SynchronizedBuffer

type SynchronizedBuffer struct {
	// contains filtered or unexported fields
}

SynchronizedBuffer wraps bytes.Buffer with a sync.Mutex for thread-safety.

func NewSynchronizedBuffer

func NewSynchronizedBuffer() *SynchronizedBuffer

NewSynchronizedBuffer initializes an empty SynchronizedBuffer which is ready to use

func (*SynchronizedBuffer) String

func (sb *SynchronizedBuffer) String() string

func (*SynchronizedBuffer) Write

func (sb *SynchronizedBuffer) Write(p []byte) (n int, err error)

type TerraformExec

type TerraformExec struct {
	// contains filtered or unexported fields
}

TerraformExec structure which stores all atributes about the Terraform installation and templates location.

func NewTerraform

func NewTerraform(workingDir string) (*TerraformExec, error)

NewTerraform function takes care of finding out the terraform binary to use or setting up and installing Terraform (if not already installed) in the system so that it can be used during the execution of the tfexec.Terraform struct. Inputs:

  • workingDir: Directory where the Terraform scripts are located

Returns:

  • A TerraformExec struct which can be used to invoke other Terraform methods.

func (*TerraformExec) TerraformApply

func (tf *TerraformExec) TerraformApply(vars ...string) error

TerraformApply executes terraform apply in the workingDir templates Inputs:

  • vars: []string including all the vars to be passed during the terraform apply execution. Format: ["host=master.ocp", "num_workers=3"]

func (*TerraformExec) TerraformDestroy

func (tf *TerraformExec) TerraformDestroy(vars ...string) error

TerraformDestroy runs terraform destroy in the workingDir templates directory. Inputs:

  • vars: []string A list of the vars passed to the terraform destroy commmand. In a similar way as in TerraformApply. Format: ["host=master.ocp", "num_workers=3"]

func (*TerraformExec) TerraformInit

func (tf *TerraformExec) TerraformInit() error

TerraformInit executes terraform init in the workingDir templates

func (*TerraformExec) TerraformInitWithUpgrade

func (tf *TerraformExec) TerraformInitWithUpgrade() error

TerraformInitWithUpgrade executes terraform init --upgrade in the workingDir templates

func (*TerraformExec) TerraformOutput

func (tf *TerraformExec) TerraformOutput() (map[string]string, error)

TerraformOutput executes terraform show command and returns a map of the output values Returns:

  • Map of key:string and value:string including the output var name and the corresponding value. For more information on output values check: https://www.terraform.io/language/values/outputs Example: { 'instance_ip': '10.0.176.10', 'instance_dns': 'cool.worker.internal.aws.com' }

func (*TerraformExec) TerraformShow

func (tf *TerraformExec) TerraformShow() (*tfjson.State, error)

TerraformShow executes the terraform show command Returns:

  • The Terraform state in a tfjson.State struct type
  • Any error which could occur

type TestEnv

type TestEnv struct {
	Type TestEnvType

	ArtifactDir        string
	PullSecretLocation string
}

func GetTestEnv

func GetTestEnv() *TestEnv

GetTestEnv gets a initialized *TestEnv in a thread-safe and lazy manner

func (*TestEnv) IsRunningInJenkins

func (t *TestEnv) IsRunningInJenkins() bool

func (*TestEnv) IsRunningInProw

func (t *TestEnv) IsRunningInProw() bool

func (*TestEnv) IsRunningLocally

func (t *TestEnv) IsRunningLocally() bool

type TestEnvType

type TestEnvType int

type Vmware

type Vmware struct {
	GovmomiURL string
}

Vmware is object

func (*Vmware) GetVsphereConnectionLogout

func (vmware *Vmware) GetVsphereConnectionLogout(c *govmomi.Client) error

GetVsphereConnectionLogout get connection logout

func (*Vmware) GetVspheresInstance

func (vmware *Vmware) GetVspheresInstance(c *govmomi.Client, vmInstance string) (string, error)

GetVspheresInstance represents to get vmware instance.

func (*Vmware) GetVspheresInstanceState

func (vmware *Vmware) GetVspheresInstanceState(c *govmomi.Client, vmInstance string) (string, error)

GetVspheresInstanceState represents get instance state.

func (*Vmware) Login

func (vmware *Vmware) Login() (*Vmware, *govmomi.Client)

Login represents connect and log in to ESX or vCenter ...

func (*Vmware) StartVsphereInstance

func (vmware *Vmware) StartVsphereInstance(c *govmomi.Client, vmInstance string) error

StartVsphereInstance represents starting instance ...

func (*Vmware) StopVsphereInstance

func (vmware *Vmware) StopVsphereInstance(c *govmomi.Client, vmInstance string) error

StopVsphereInstance represents stopping instance ...

type YamlReplace

type YamlReplace struct {
	Path  string // path to modify or create value
	Value string // a string literal or YAML string (ex. 'name: frontend') to be set under the given path
}

YamlReplace define a YAML modification given. Example:

YamlReplace {
	Path: 'spec.template.spec.imagePullSecrets',
	Value: '- name: notmatch-secret',
}

Directories

Path Synopsis
Package version supplies version information collected at build time to OpenShift and Kubernetes components.
Package version supplies version information collected at build time to OpenShift and Kubernetes components.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL