utils

package
v0.0.0-...-75c2fbf Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: Apache-2.0 Imports: 34 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PROJECT_ENV_VAR = "PROJECT_ID=" + PROJECT_NAME
View Source
var PROJECT_NAME = "unitt"
View Source
var PROJECT_NAME_CD = PROJECT_NAME + "-cd"
View Source
var PROJECT_NAME_DEV = PROJECT_NAME + "-dev"
View Source
var PROJECT_NAME_TEST = PROJECT_NAME + "-test"

Functions

func CheckBuildConfigs

func CheckBuildConfigs(namespace string, buildConfigs []string, config *rest.Config, t *testing.T)

func CheckConfigMaps

func CheckConfigMaps(namespace string, configMaps []string, dyn dynamic.Interface, t *testing.T)

func CheckCronJobs

func CheckCronJobs(namespace string, cronJobs []string, dyn dynamic.Interface, t *testing.T)

func CheckDaemonSets

func CheckDaemonSets(namespace string, daemonSets []string, dyn dynamic.Interface, t *testing.T)

func CheckDeploymentConfigs

func CheckDeploymentConfigs(namespace string, deploymentConfigs []string, config *rest.Config, t *testing.T)

func CheckDeployments

func CheckDeployments(namespace string, deployments []string, dyn dynamic.Interface, t *testing.T)

func CheckHorizontalPodAutoscalers

func CheckHorizontalPodAutoscalers(namespace string, hpas []string, dyn dynamic.Interface, t *testing.T)

func CheckImageStreams

func CheckImageStreams(namespace string, imageStreams []string, config *rest.Config, t *testing.T)

func CheckImageTags

func CheckImageTags(namespace string, imageTags []ImageTag, config *rest.Config, t *testing.T)

func CheckIngresses

func CheckIngresses(namespace string, ingresses []string, dyn dynamic.Interface, t *testing.T)

func CheckJobs

func CheckJobs(namespace string, jobs []string, dyn dynamic.Interface, t *testing.T)

func CheckNetworkPolicies

func CheckNetworkPolicies(namespace string, networkPolicies []string, dyn dynamic.Interface, t *testing.T)

func CheckPersistentVolumeClaims

func CheckPersistentVolumeClaims(namespace string, pvcs []string, dyn dynamic.Interface, t *testing.T)

func CheckPods

func CheckPods(namespace string, pods []string, dyn dynamic.Interface, t *testing.T)

func CheckReplicaSets

func CheckReplicaSets(namespace string, replicaSets []string, dyn dynamic.Interface, t *testing.T)

func CheckResources

func CheckResources(resources Resources, t *testing.T)

func CheckRoleBindings

func CheckRoleBindings(namespace string, roleBindings []string, dyn dynamic.Interface, t *testing.T)

func CheckRoles

func CheckRoles(namespace string, roles []string, dyn dynamic.Interface, t *testing.T)

func CheckRoutes

func CheckRoutes(namespace string, routes []string, config *rest.Config, t *testing.T)

func CheckSecrets

func CheckSecrets(namespace string, secrets []string, dyn dynamic.Interface, t *testing.T)

func CheckServiceAccounts

func CheckServiceAccounts(namespace string, serviceAccounts []string, dyn dynamic.Interface, t *testing.T)

func CheckServices

func CheckServices(namespace string, services []string, dyn dynamic.Interface, t *testing.T)

func CheckStatefulSets

func CheckStatefulSets(namespace string, statefulSets []string, dyn dynamic.Interface, t *testing.T)

func FindBuildConfig

func FindBuildConfig(buildConfigs *v1.BuildConfigList, buildConfigName string) error

func FindConfigMap

func FindConfigMap(configMaps *v1.ConfigMapList, configMapName string) error

func FindDeploymentConfig

func FindDeploymentConfig(depoymentConfigs *v1.DeploymentConfigList, depoymentConfigName string) error

func FindImageStream

func FindImageStream(imageStreamList *v1.ImageStreamList, imageStreamName string) error

func FindImageTag

func FindImageTag(imageStreamList *v1.ImageStreamList, imageTag ImageTag) error

func FindProject

func FindProject(projects *v1.ProjectList, projectName string) error

func FindRoleBinding

func FindRoleBinding(roleBindings *rbacv1.RoleBindingList, subjectName, subjectType, namespace, roleName string) error

func FindRoute

func FindRoute(routes *v1.RouteList, routeName string) error

func FindSecret

func FindSecret(secrets *v1.SecretList, secretName string) error

func FindServiceAccount

func FindServiceAccount(serviceAccounts *v1.ServiceAccountList, serviceAccountName string) error

func FindServiceHasPods

func FindServiceHasPods(services *v1.ServiceList, serviceName string) error

FindServiceHasPods returns an error if no pod is assigned to given service or if at least one pod is not "Running" or at least one of its containers is not "ready".

func GetEnv

func GetEnv(key, fallback string) string

func GetOCClient

func GetOCClient() (*rest.Config, error)

func ReadConfiguration

func ReadConfiguration() (map[string]string, error)

func RemoveAllOpenshiftNamespacesForProject

func RemoveAllOpenshiftNamespacesForProject(project string) error

func RemoveAllTestOCProjects

func RemoveAllTestOCProjects() error

func RemoveBuildConfigs

func RemoveBuildConfigs(projectName string, buildConfigName string) error

func RemoveExcludedQuickstarters

func RemoveExcludedQuickstarters(t *testing.T, dir string, quickstarterPaths []string) []string

func RemoveProject

func RemoveProject(projectName string) error

func RemoveProjectWait

func RemoveProjectWait(projectName string) (string, string, error)

func RetrieveJenkinsBuildStagesForBuild

func RetrieveJenkinsBuildStagesForBuild(jenkinsNamespace string, buildName string) (string, error)

func RunCommand

func RunCommand(command string, args []string, envVars []string) (string, string, error)

func RunCommandWithWorkDir

func RunCommandWithWorkDir(command string, args []string, workDir string, envVars []string) (string, string, error)

func RunJenkinsPipeline

func RunJenkinsPipeline(jenkinsFile string, req RequestBuild, pipelineComponentPart string) (string, error)

func RunScriptFromBaseDir

func RunScriptFromBaseDir(command string, args []string, envVars []string) (string, string, error)

func Set_project_name

func Set_project_name(project string)

func SortTestableQuickstarters

func SortTestableQuickstarters(t *testing.T, dir string, quickstarterPaths []string) []string

func VerifyJenkinsRunAttachments

func VerifyJenkinsRunAttachments(projectName string, buildName string, artifactsToVerify []string) error

func VerifyJenkinsStages

func VerifyJenkinsStages(goldenFile string, gotStages string) error

Types

type EnvPair

type EnvPair struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type ImageTag

type ImageTag struct {
	Name string
	Tag  string
}

type ProvisionAPI

type ProvisionAPI struct {
	ProjectName string
	Config      map[string]string
}

ProvisionAPI represents the provisioning app.

func (*ProvisionAPI) CreateComponent

func (api *ProvisionAPI) CreateComponent() ([]byte, error)

CreateComponent creates a component via the provisioning app.

func (*ProvisionAPI) CreateProject

func (api *ProvisionAPI) CreateProject() ([]byte, error)

CreateProject creates a project via the provisioning app.

func (*ProvisionAPI) DeleteComponent

func (api *ProvisionAPI) DeleteComponent() error

DeleteComponent deletes a component via the provisioning app.

func (*ProvisionAPI) DeleteProject

func (api *ProvisionAPI) DeleteProject() error

DeleteProject deletes a project via the provisioning app.

type RequestBuild

type RequestBuild struct {
	Branch     string    `json:"branch"`
	Repository string    `json:"repository"`
	Env        []EnvPair `json:"env"`
	Project    string    `json:"project"`
}

type Resources

type Resources struct {
	Namespace                string
	ImageTags                []ImageTag
	BuildConfigs             []string
	DeploymentConfigs        []string
	Deployments              []string
	StatefulSets             []string
	DaemonSets               []string
	ReplicaSets              []string
	Services                 []string
	ImageStreams             []string
	Routes                   []string
	Ingresses                []string
	ConfigMaps               []string
	Secrets                  []string
	PersistentVolumeClaims   []string
	ServiceAccounts          []string
	Roles                    []string
	RoleBindings             []string
	NetworkPolicies          []string
	Jobs                     []string
	CronJobs                 []string
	Pods                     []string
	HorizontalPodAutoscalers []string
}

type RoleBinding

type RoleBinding struct {
	SubjectName string
	SubjectType string
	Namespace   string
	RoleName    string
}

Jump to

Keyboard shortcuts

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