utils

package
v0.0.0-...-95bd1b6 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 30 Imported by: 1

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func CheckBuildConfigs

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

func CheckDeploymentConfigs

func CheckDeploymentConfigs(namespace string, deploymentConfigs []string, config *rest.Config, 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 CheckResources

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

func CheckServices

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

func FindBuildConfig

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

func FindClusterRoleBinding

func FindClusterRoleBinding(roleBindings *v1.ClusterRoleBindingList, subjectName string, subjectType string, subjectNamespace string, roleName 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 *v1.RoleBindingList, subjectName string, subjectType string, subjectNamespace string, roleName 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 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 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 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
	Services          []string
	ImageStreams      []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