utils

package
v1.43.8 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: MIT Imports: 43 Imported by: 25

Documentation

Index

Constants

View Source
const AppNamespaceEnvName = "app"

AppNamespaceEnvName Name of environment for app namespace

Variables

This section is empty.

Functions

func BoolPtr added in v1.8.14

func BoolPtr(value bool) *bool

BoolPtr returns a pointer to the passed bool.

func BuildResourceRequirement added in v1.12.2

func BuildResourceRequirement(source *v1.ResourceRequirements) corev1.ResourceRequirements

func EqualPvcLists added in v1.13.7

func EqualPvcLists(pvcList1, pvcList2 *[]corev1.PersistentVolumeClaim, ignoreRandomPostfixInName bool) (bool, error)

EqualPvcLists Compare two PersistentVolumeClaim lists. When ignoreRandomPostfixInName=true - last 6 chars of the name (e.g.'-abc12') are ignored during comparison

func EqualPvcs added in v1.13.7

func EqualPvcs(pvc1 *corev1.PersistentVolumeClaim, pvc2 *corev1.PersistentVolumeClaim, ignoreRandomPostfixInName bool) (bool, error)

EqualPvcs Compare two PersistentVolumeClaim pointers

func EqualStorageClassLists added in v1.13.7

func EqualStorageClassLists(scList1, scList2 *[]storagev1.StorageClass) (bool, error)

EqualStorageClassLists Compare two StorageClass lists

func EqualStorageClasses added in v1.13.7

func EqualStorageClasses(sc1, sc2 *storagev1.StorageClass) (bool, error)

EqualStorageClasses Compare two StorageClass pointers

func EqualStringLists added in v1.13.7

func EqualStringLists(list1, list2 []string) bool

EqualStringLists Compare two string lists

func EqualStringMaps added in v1.13.7

func EqualStringMaps(map1, map2 map[string]string) bool

EqualStringMaps Compare two string maps

func EqualStringsAsPtr added in v1.13.7

func EqualStringsAsPtr(s1, s2 *string) bool

func GetAdGroups added in v1.36.2

func GetAdGroups(registration *v1.RadixRegistration) ([]string, error)

GetAdGroups Gets ad-groups from registration. If missing, gives default for cluster

func GetAppAndTagPairFromName

func GetAppAndTagPairFromName(name string) (string, string)

GetAppAndTagPairFromName Reverse engineer deployment name

func GetAppNamespace

func GetAppNamespace(appName string) string

GetAppNamespace Function to get namespace from app name

func GetAuxiliaryComponentDeploymentName added in v1.18.0

func GetAuxiliaryComponentDeploymentName(componentName string, auxSuffix string) string

GetAuxiliaryComponentDeploymentName returns deployment name for auxiliary component, e.g. the oauth proxy

func GetAuxiliaryComponentSecretName added in v1.18.0

func GetAuxiliaryComponentSecretName(componentName string, suffix string) string

GetAuxiliaryComponentSecretName Get secret name for AuxiliaryComponent

func GetAuxiliaryComponentServiceName added in v1.18.0

func GetAuxiliaryComponentServiceName(componentName string, auxSuffix string) string

GetAuxiliaryComponentServiceName returns service name for auxiliary component, e.g. the oauth proxy

func GetComponentClientCertificateSecretName added in v1.12.0

func GetComponentClientCertificateSecretName(componentame string) string

GetComponentClientCertificateSecretName Gets name of the component secret that holds the ca.crt public key for client certificate authentication

func GetComponentSecretName

func GetComponentSecretName(componentName string) string

GetComponentSecretName Gets unique name of the component secret

func GetComponentServiceAccountName added in v1.31.0

func GetComponentServiceAccountName(componentName string) string

GetComponentServiceAccountName Gets unique name for component or job service account

func GetDeploymentName

func GetDeploymentName(appName, env, tag string) string

GetDeploymentName Function to get deployment name

func GetEnvVarsFromAzureKeyVaultSecretRefs added in v1.23.4

func GetEnvVarsFromAzureKeyVaultSecretRefs(radixDeploymentName, componentName string, secretRefs radixv1.RadixSecretRefs) []corev1.EnvVar

GetEnvVarsFromAzureKeyVaultSecretRefs Get EnvVars from AzureKeyVaultSecretRefs

func GetEnvVarsFromSecrets added in v1.23.4

func GetEnvVarsFromSecrets(componentName string, secretNames []string) []corev1.EnvVar

GetEnvVarsFromSecrets Get EnvVars from secret names

func GetEnvironmentNamespace

func GetEnvironmentNamespace(appName, environment string) string

GetEnvironmentNamespace Function to get namespace from app name and environment

func GetGithubCloneURLFromRepo

func GetGithubCloneURLFromRepo(repo string) string

GetGithubCloneURLFromRepo Takes a https repo string as input and converts to a git clone url

func GetGithubRepositoryURLFromCloneURL

func GetGithubRepositoryURLFromCloneURL(cloneURL string) string

GetGithubRepositoryURLFromCloneURL Takes git clone url as input and converts to a https repo string

func GetHpaMetric added in v1.37.3

func GetHpaMetric(hpa *v2.HorizontalPodAutoscaler, resourceName v1.ResourceName) *v2.MetricSpec

GetHpaMetric returns the metric spec for the given resource name or nil if not found

func GetImagePath

func GetImagePath(containerRegistry, appName, componentName, imageTag string) string

GetImagePath Returns a container image path given container registry, app, component and tag

func GetKubernetesClient

GetKubernetesClient Gets clients to talk to the API

func GetPDBConfig added in v1.21.9

func GetPDBConfig(componentName string, namespace string) *v1.PodDisruptionBudget

GetPDBConfig returns a standard PodDisruptionBudget configuration

func GetPDBName added in v1.21.9

func GetPDBName(componentName string) string

GetPDBName returns a PodDisruptionBudget name

func GetPersistentVolumeClaimMap added in v1.13.7

func GetPersistentVolumeClaimMap(pvcList *[]corev1.PersistentVolumeClaim) map[string]*corev1.PersistentVolumeClaim

GetPersistentVolumeClaimMap Get map from PersistentVolumeClaim with name as key

func GetPodSpecAffinity added in v1.11.2

func GetPodSpecAffinity(node *v1.RadixNode, appName string, componentName string, isScheduledJob bool, isPipelineJob bool) *corev1.Affinity

func GetPodSpecTolerations added in v1.19.1

func GetPodSpecTolerations(node *v1.RadixNode, isScheduledJob bool, isPipelineJob bool) []corev1.Toleration

GetPodSpecTolerations returns tolerations required to schedule the pod on nodes

func GetRadixApplicationFromFile added in v1.7.8

func GetRadixApplicationFromFile(filename string) (*v1.RadixApplication, error)

GetRadixApplicationFromFile Reads radix config from file

func GetRadixDeployFromFile added in v1.7.8

func GetRadixDeployFromFile(filename string) (*v1.RadixDeployment, error)

GetRadixDeployFromFile Reads radix deployment from file

func GetRadixEnvironmentFromFile added in v1.7.8

func GetRadixEnvironmentFromFile(filename string) (*v1.RadixEnvironment, error)

GetRadixEnvironmentFromFile reads RadixEnvironment configuration from a yaml file

func GetRadixRegistrationFromFile

func GetRadixRegistrationFromFile(filename string) (*v1.RadixRegistration, error)

GetRadixRegistrationFromFile Reads radix registration from file

func GetRepositoryName added in v1.23.5

func GetRepositoryName(appName, componentName string) string

GetRepositoryName Returns a container registry repository name given

func GetResourceRequirements added in v1.8.16

func GetResourceRequirements(deployComponent v1.RadixCommonDeployComponent) corev1.ResourceRequirements

func GetServicePorts added in v1.32.0

func GetServicePorts(componentPorts []radixv1.ComponentPort) []corev1.ServicePort

GetServicePorts transforms a Radix ComponentPort list toa ServicePort list for use with a Kubernetes Service

func GetStorageClassMap added in v1.13.7

func GetStorageClassMap(scList *[]storagev1.StorageClass) map[string]*storagev1.StorageClass

GetStorageClassMap Get map from StorageClassList with name as key

func GrantAppAdminAccessToSecret added in v1.36.2

func GrantAppAdminAccessToSecret(kubeutil *kube.Kube, registration *radixv1.RadixRegistration, roleName string, secretName string) error

GrantAppAdminAccessToSecret grants access to a secret for app-admin groups

func GrantAppReaderAccessToSecret added in v1.39.3

func GrantAppReaderAccessToSecret(kubeutil *kube.Kube, registration *radixv1.RadixRegistration, roleName string, secretName string) error

GrantAppReaderAccessToSecret grants access to a secret for app-reader groups

func IsRadixEnvVar added in v1.15.0

func IsRadixEnvVar(envVarName string) bool

IsRadixEnvVar Indicates if environment-variable is created by Radix

func NewEnvironmentVariablesSet added in v1.13.6

func NewEnvironmentVariablesSet() *environmentVariablesSet

NewEnvironmentVariablesSet Create new EnvironmentVariablesSet

func PollUntilRESTClientSuccessfulConnection added in v1.43.7

func PollUntilRESTClientSuccessfulConnection[T interface{ RESTClient() rest.Interface }](ctx context.Context, timeout time.Duration, interval time.Duration, clientFactory func() (T, error)) (T, error)

PollUntilRESTClientSuccessfulConnection tries a GET request to root with the RESTClient returned by clientFactory. clientFactory will be invoked on `interval` for each connection attempt until the request returns no error, the error is not `net/http: TLS handshake timeout` or `ctx` is cancelled or hits a deadline. Polling will terminate after `duration` defined in timeout.

func RandString

func RandString(length int) string

RandString Returns a random string of given length

func RandStringSeed

func RandStringSeed(length int, src rand.Source) string

RandStringSeed Returns a random string of given length from seed

func RandStringStrSeed

func RandStringStrSeed(length int, src string) string

RandStringStrSeed Returns a random string of given length from seed

func ShortenString added in v1.13.7

func ShortenString(s string, charsToCut int) string

func StringPtr added in v1.8.1

func StringPtr(s string) *string

StringPtr returns a pointer to the passed string.

func TernaryString added in v1.5.17

func TernaryString(condition bool, trueValue, falseValue string) string

TernaryString operator

Types

type ApplicationBuilder

type ApplicationBuilder interface {
	WithRadixRegistration(RegistrationBuilder) ApplicationBuilder
	WithAppName(string) ApplicationBuilder
	WithBuildSecrets(...string) ApplicationBuilder
	WithBuildKit(*bool) ApplicationBuilder
	WithEnvironment(string, string) ApplicationBuilder
	WithEnvironmentNoBranch(string) ApplicationBuilder
	WithComponent(RadixApplicationComponentBuilder) ApplicationBuilder
	WithComponents(...RadixApplicationComponentBuilder) ApplicationBuilder
	WithJobComponent(RadixApplicationJobComponentBuilder) ApplicationBuilder
	WithJobComponents(...RadixApplicationJobComponentBuilder) ApplicationBuilder
	WithDNSAppAlias(string, string) ApplicationBuilder
	WithDNSExternalAlias(string, string, string) ApplicationBuilder
	WithPrivateImageRegistry(string, string, string) ApplicationBuilder
	GetRegistrationBuilder() RegistrationBuilder
	BuildRA() *v1.RadixApplication
}

ApplicationBuilder Handles construction of RA

func ARadixApplication

func ARadixApplication() ApplicationBuilder

ARadixApplication Constructor for application builder containing test data

func NewRadixApplicationBuilder

func NewRadixApplicationBuilder() ApplicationBuilder

NewRadixApplicationBuilder Constructor for config builder

type ApplicationBuilderStruct

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

ApplicationBuilderStruct Instance variables

func (*ApplicationBuilderStruct) BuildRA

BuildRA Builds RA

func (*ApplicationBuilderStruct) GetRegistrationBuilder

func (ap *ApplicationBuilderStruct) GetRegistrationBuilder() RegistrationBuilder

GetRegistrationBuilder Gets associated registration builder

func (*ApplicationBuilderStruct) WithAppName

func (ap *ApplicationBuilderStruct) WithAppName(appName string) ApplicationBuilder

WithAppName Sets app name

func (*ApplicationBuilderStruct) WithBuildKit added in v1.28.0

func (ap *ApplicationBuilderStruct) WithBuildKit(useBuildKit *bool) ApplicationBuilder

func (*ApplicationBuilderStruct) WithBuildSecrets added in v1.3.0

func (ap *ApplicationBuilderStruct) WithBuildSecrets(buildSecrets ...string) ApplicationBuilder

WithBuildSecrets Appends to build secrets

func (*ApplicationBuilderStruct) WithComponent

WithComponent Appends application component to list of existing components

func (*ApplicationBuilderStruct) WithComponents

WithComponents Sets application components to application

func (*ApplicationBuilderStruct) WithDNSAppAlias

func (ap *ApplicationBuilderStruct) WithDNSAppAlias(env string, component string) ApplicationBuilder

WithDNSAppAlias Sets env + component to be the app alias

func (*ApplicationBuilderStruct) WithDNSExternalAlias

func (ap *ApplicationBuilderStruct) WithDNSExternalAlias(alias, env, component string) ApplicationBuilder

WithDNSExternalAlias Sets env + component to the external alias

func (*ApplicationBuilderStruct) WithEnvironment

func (ap *ApplicationBuilderStruct) WithEnvironment(environment, buildFrom string) ApplicationBuilder

WithEnvironment Appends to environment-build list

func (*ApplicationBuilderStruct) WithEnvironmentNoBranch

func (ap *ApplicationBuilderStruct) WithEnvironmentNoBranch(environment string) ApplicationBuilder

WithEnvironmentNoBranch Appends environment with no branch mapping to config

func (*ApplicationBuilderStruct) WithJobComponent added in v1.8.0

WithJobComponent Appends application job component to list of existing components

func (*ApplicationBuilderStruct) WithJobComponents added in v1.8.0

WithJobComponents Sets application job components to application

func (*ApplicationBuilderStruct) WithPrivateImageRegistry added in v1.0.1

func (ap *ApplicationBuilderStruct) WithPrivateImageRegistry(server, username, email string) ApplicationBuilder

WithPrivateImageRegistry adds a private image hub to application

func (*ApplicationBuilderStruct) WithRadixRegistration

func (ap *ApplicationBuilderStruct) WithRadixRegistration(registrationBuilder RegistrationBuilder) ApplicationBuilder

WithRadixRegistration Associates this builder with a registration builder

type DeployCommonComponentBuilder added in v1.13.7

type DeployCommonComponentBuilder interface {
	WithName(string) DeployCommonComponentBuilder
	WithVolumeMounts(...v1.RadixVolumeMount) DeployCommonComponentBuilder
	BuildComponent() v1.RadixCommonDeployComponent
}

DeployCommonComponentBuilder Handles construction of v1.RadixCommonDeployComponent builder

func NewDeployCommonComponentBuilder added in v1.13.7

func NewDeployCommonComponentBuilder(factory v1.RadixCommonDeployComponentFactory) DeployCommonComponentBuilder

NewDeployCommonComponentBuilder Constructor for component builder

type DeployComponentBuilder

type DeployComponentBuilder interface {
	WithName(string) DeployComponentBuilder
	WithImage(string) DeployComponentBuilder
	WithPort(string, int32) DeployComponentBuilder
	WithPorts([]v1.ComponentPort) DeployComponentBuilder
	WithEnvironmentVariable(string, string) DeployComponentBuilder
	WithEnvironmentVariables(map[string]string) DeployComponentBuilder
	WithPublic(bool) DeployComponentBuilder // Deprecated: For backwards compatibility WithPublic is still supported, new code should use WithPublicPort instead
	WithPublicPort(string) DeployComponentBuilder
	WithMonitoring(bool) DeployComponentBuilder
	WithMonitoringConfig(v1.MonitoringConfig) DeployComponentBuilder
	WithAlwaysPullImageOnDeploy(bool) DeployComponentBuilder
	WithReplicas(*int) DeployComponentBuilder
	WithResourceRequestsOnly(map[string]string) DeployComponentBuilder
	WithResource(map[string]string, map[string]string) DeployComponentBuilder
	WithVolumeMounts(...v1.RadixVolumeMount) DeployComponentBuilder
	WithNodeGpu(gpu string) DeployComponentBuilder
	WithNodeGpuCount(gpuCount string) DeployComponentBuilder
	WithIngressConfiguration(...string) DeployComponentBuilder
	WithSecrets([]string) DeployComponentBuilder
	WithSecretRefs(v1.RadixSecretRefs) DeployComponentBuilder
	WithDNSAppAlias(bool) DeployComponentBuilder
	WithDNSExternalAlias(string) DeployComponentBuilder
	WithHorizontalScaling(minReplicas *int32, maxReplicas int32, cpu *int32, memory *int32) DeployComponentBuilder
	WithRunAsNonRoot(bool) DeployComponentBuilder
	WithAuthentication(*v1.Authentication) DeployComponentBuilder
	WithIdentity(*v1.Identity) DeployComponentBuilder
	BuildComponent() v1.RadixDeployComponent
}

DeployComponentBuilder Handles construction of RD component

func NewDeployComponentBuilder

func NewDeployComponentBuilder() DeployComponentBuilder

NewDeployComponentBuilder Constructor for component builder

type DeployJobComponentBuilder added in v1.8.0

type DeployJobComponentBuilder interface {
	WithName(string) DeployJobComponentBuilder
	WithImage(string) DeployJobComponentBuilder
	WithPort(string, int32) DeployJobComponentBuilder
	WithPorts([]v1.ComponentPort) DeployJobComponentBuilder
	WithEnvironmentVariable(string, string) DeployJobComponentBuilder
	WithEnvironmentVariables(map[string]string) DeployJobComponentBuilder
	WithMonitoring(bool) DeployJobComponentBuilder
	WithMonitoringConfig(v1.MonitoringConfig) DeployJobComponentBuilder
	WithAlwaysPullImageOnDeploy(bool) DeployJobComponentBuilder
	WithResourceRequestsOnly(map[string]string) DeployJobComponentBuilder
	WithResource(map[string]string, map[string]string) DeployJobComponentBuilder
	WithVolumeMounts(...v1.RadixVolumeMount) DeployJobComponentBuilder
	WithNodeGpu(gpu string) DeployJobComponentBuilder
	WithNodeGpuCount(gpuCount string) DeployJobComponentBuilder
	WithSecrets([]string) DeployJobComponentBuilder
	WithSecretRefs(v1.RadixSecretRefs) DeployJobComponentBuilder
	WithSchedulerPort(*int32) DeployJobComponentBuilder
	WithPayloadPath(*string) DeployJobComponentBuilder
	WithTimeLimitSeconds(*int64) DeployJobComponentBuilder
	WithIdentity(*v1.Identity) DeployJobComponentBuilder
	WithNotifications(*v1.Notifications) DeployJobComponentBuilder
	BuildJobComponent() v1.RadixDeployJobComponent
}

DeployJobComponentBuilder Handles construction of RD job component

func NewDeployJobComponentBuilder added in v1.8.0

func NewDeployJobComponentBuilder() DeployJobComponentBuilder

NewDeployJobComponentBuilder Constructor for jop component builder

type DeployKey added in v1.36.2

type DeployKey struct {
	PrivateKey string
	PublicKey  string
}

DeployKey Representation of a deploy key pair

func DeriveDeployKeyFromPrivateKey added in v1.36.2

func DeriveDeployKeyFromPrivateKey(privateKey string) (*DeployKey, error)

func GenerateDeployKey added in v1.36.2

func GenerateDeployKey() (*DeployKey, error)

GenerateDeployKey Generates a deploy key

type DeploymentBuilder

type DeploymentBuilder interface {
	WithRadixApplication(ApplicationBuilder) DeploymentBuilder
	WithRadixDeployment(*v1.RadixDeployment) DeploymentBuilder
	WithDeploymentName(string) DeploymentBuilder
	WithImageTag(string) DeploymentBuilder
	WithAppName(string) DeploymentBuilder
	WithLabel(label, value string) DeploymentBuilder
	WithEnvironment(string) DeploymentBuilder
	WithJobName(string) DeploymentBuilder
	WithCreated(time.Time) DeploymentBuilder
	WithUID(types.UID) DeploymentBuilder
	WithCondition(v1.RadixDeployCondition) DeploymentBuilder
	WithActiveFrom(time.Time) DeploymentBuilder
	WithActiveTo(time.Time) DeploymentBuilder
	WithEmptyStatus() DeploymentBuilder
	WithComponent(DeployComponentBuilder) DeploymentBuilder
	WithComponents(...DeployComponentBuilder) DeploymentBuilder
	WithJobComponent(DeployJobComponentBuilder) DeploymentBuilder
	WithJobComponents(...DeployJobComponentBuilder) DeploymentBuilder
	WithAnnotations(map[string]string) DeploymentBuilder
	GetApplicationBuilder() ApplicationBuilder
	BuildRD() *v1.RadixDeployment
}

DeploymentBuilder Handles construction of RD

func ARadixDeployment

func ARadixDeployment() DeploymentBuilder

ARadixDeployment Constructor for deployment builder containing test data

func NewDeploymentBuilder

func NewDeploymentBuilder() DeploymentBuilder

NewDeploymentBuilder Constructor for deployment builder

type DeploymentBuilderStruct

type DeploymentBuilderStruct struct {
	DeploymentName string
	AppName        string

	Labels          map[string]string
	ImageTag        string
	Environment     string
	Created         time.Time
	Condition       v1.RadixDeployCondition
	ActiveFrom      metav1.Time
	ActiveTo        metav1.Time
	ResourceVersion string
	UID             types.UID
	// contains filtered or unexported fields
}

DeploymentBuilderStruct Holds instance variables

func (*DeploymentBuilderStruct) BuildRD

BuildRD Builds RD structure based on set variables

func (*DeploymentBuilderStruct) GetApplicationBuilder

func (db *DeploymentBuilderStruct) GetApplicationBuilder() ApplicationBuilder

GetApplicationBuilder Obtains the builder for the corresponding RA, if exists (used for testing)

func (*DeploymentBuilderStruct) WithActiveFrom

func (db *DeploymentBuilderStruct) WithActiveFrom(activeFrom time.Time) DeploymentBuilder

WithActiveFrom Sets active from

func (*DeploymentBuilderStruct) WithActiveTo

func (db *DeploymentBuilderStruct) WithActiveTo(activeTo time.Time) DeploymentBuilder

WithActiveTo Sets active to

func (*DeploymentBuilderStruct) WithAnnotations added in v1.22.2

func (db *DeploymentBuilderStruct) WithAnnotations(annotations map[string]string) DeploymentBuilder

func (*DeploymentBuilderStruct) WithAppName

func (db *DeploymentBuilderStruct) WithAppName(appName string) DeploymentBuilder

WithAppName Sets app name

func (*DeploymentBuilderStruct) WithComponent

WithComponent Appends component to list of components

func (*DeploymentBuilderStruct) WithComponents

func (db *DeploymentBuilderStruct) WithComponents(components ...DeployComponentBuilder) DeploymentBuilder

WithComponents Sets list of components

func (*DeploymentBuilderStruct) WithCondition

WithCondition Sets the condition of the deployment

func (*DeploymentBuilderStruct) WithCreated

func (db *DeploymentBuilderStruct) WithCreated(created time.Time) DeploymentBuilder

WithCreated Sets timestamp

func (*DeploymentBuilderStruct) WithDeploymentName

func (db *DeploymentBuilderStruct) WithDeploymentName(name string) DeploymentBuilder

WithDeploymentName Sets name of the deployment

func (*DeploymentBuilderStruct) WithEmptyStatus

func (db *DeploymentBuilderStruct) WithEmptyStatus() DeploymentBuilder

WithEmptyStatus Indicates that the RD has no reconciled status

func (*DeploymentBuilderStruct) WithEnvironment

func (db *DeploymentBuilderStruct) WithEnvironment(environment string) DeploymentBuilder

WithEnvironment Sets environment name

func (*DeploymentBuilderStruct) WithImageTag

func (db *DeploymentBuilderStruct) WithImageTag(imageTag string) DeploymentBuilder

WithImageTag Sets deployment tag to be appended to name

func (*DeploymentBuilderStruct) WithJobComponent added in v1.8.0

WithJobComponent Appends job component to list of components

func (*DeploymentBuilderStruct) WithJobComponents added in v1.8.0

func (db *DeploymentBuilderStruct) WithJobComponents(components ...DeployJobComponentBuilder) DeploymentBuilder

WithJobComponents Sets list of job components

func (*DeploymentBuilderStruct) WithJobName added in v1.30.6

func (db *DeploymentBuilderStruct) WithJobName(name string) DeploymentBuilder

WithJobName Sets RadixJob name

func (*DeploymentBuilderStruct) WithLabel

func (db *DeploymentBuilderStruct) WithLabel(label, value string) DeploymentBuilder

WithLabel Appends label

func (*DeploymentBuilderStruct) WithRadixApplication

func (db *DeploymentBuilderStruct) WithRadixApplication(applicationBuilder ApplicationBuilder) DeploymentBuilder

WithRadixApplication Links to RA builder

func (*DeploymentBuilderStruct) WithRadixDeployment

func (db *DeploymentBuilderStruct) WithRadixDeployment(radixDeployment *v1.RadixDeployment) DeploymentBuilder

WithRadixDeployment Reverse engineers RD

func (*DeploymentBuilderStruct) WithUID

WithUID Sets UUID

type EnvironmentBuilder added in v1.5.5

type EnvironmentBuilder interface {
	WithEnvironmentName(string) EnvironmentBuilder
	WithAppName(string) EnvironmentBuilder
	WithLabel(label, value string) EnvironmentBuilder
	WithAppLabel() EnvironmentBuilder
	WithCreatedTime(time.Time) EnvironmentBuilder
	WithReconciledTime(time.Time) EnvironmentBuilder
	WithUID(types.UID) EnvironmentBuilder
	WithOwner(owner meta.OwnerReference) EnvironmentBuilder
	WithRegistrationOwner(registration *rx.RadixRegistration) EnvironmentBuilder
	WithRegistrationBuilder(builder RegistrationBuilder) EnvironmentBuilder
	WithOrphaned(isOrphan bool) EnvironmentBuilder
	WithEgressConfig(egressRules rx.EgressConfig) EnvironmentBuilder
	WithResourceVersion(version string) EnvironmentBuilder
	GetRegistrationBuilder() RegistrationBuilder
	BuildRE() *rx.RadixEnvironment
}

EnvironmentBuilder Handles construction of RE

func ARadixEnvironment added in v1.5.5

func ARadixEnvironment() EnvironmentBuilder

ARadixEnvironment constructor for environment builder containing test data

func NewEnvironmentBuilder added in v1.5.5

func NewEnvironmentBuilder() EnvironmentBuilder

NewEnvironmentBuilder constructor for environment builder

type EnvironmentBuilderStruct added in v1.5.5

type EnvironmentBuilderStruct struct {
	EnvironmentName string
	AppName         string
	EgressConfig    rx.EgressConfig
	Labels          map[string]string
	AppLabel        bool
	CreatedTime     *time.Time
	ReconciledTime  *time.Time
	Owners          []meta.OwnerReference
	ResourceVersion string
	IsOrphan        bool
	UID             types.UID
	// contains filtered or unexported fields
}

EnvironmentBuilderStruct Holds instance variables

func (*EnvironmentBuilderStruct) BuildRE added in v1.5.5

BuildRE builds RE structure based on set variables

func (*EnvironmentBuilderStruct) GetRegistrationBuilder added in v1.5.8

func (eb *EnvironmentBuilderStruct) GetRegistrationBuilder() RegistrationBuilder

GetRegistrationBuilder returns its RegistrationBuilder

func (*EnvironmentBuilderStruct) WithAppLabel added in v1.5.5

func (eb *EnvironmentBuilderStruct) WithAppLabel() EnvironmentBuilder

WithAppLabel appends "[radix-app]=$AppName" label

func (*EnvironmentBuilderStruct) WithAppName added in v1.5.5

func (eb *EnvironmentBuilderStruct) WithAppName(appName string) EnvironmentBuilder

WithAppName sets application name

func (*EnvironmentBuilderStruct) WithCreatedTime added in v1.5.5

func (eb *EnvironmentBuilderStruct) WithCreatedTime(created time.Time) EnvironmentBuilder

WithCreatedTime sets created objectmeta timestamp

func (*EnvironmentBuilderStruct) WithEgressConfig added in v1.20.0

func (eb *EnvironmentBuilderStruct) WithEgressConfig(egress rx.EgressConfig) EnvironmentBuilder

WithEgressConfig sets the egress configuration for this environment

func (*EnvironmentBuilderStruct) WithEnvironmentName added in v1.5.5

func (eb *EnvironmentBuilderStruct) WithEnvironmentName(name string) EnvironmentBuilder

WithEnvironmentName sets name of the environment

func (*EnvironmentBuilderStruct) WithLabel added in v1.5.5

func (eb *EnvironmentBuilderStruct) WithLabel(label, value string) EnvironmentBuilder

WithLabel appends label

func (*EnvironmentBuilderStruct) WithOrphaned added in v1.5.11

func (eb *EnvironmentBuilderStruct) WithOrphaned(isOrphan bool) EnvironmentBuilder

WithOrphaned sets the Orphaned status flag

func (*EnvironmentBuilderStruct) WithOwner added in v1.5.5

WithOwner appends OwnerReference

func (*EnvironmentBuilderStruct) WithReconciledTime added in v1.5.5

func (eb *EnvironmentBuilderStruct) WithReconciledTime(reconciled time.Time) EnvironmentBuilder

WithReconciledTime sets reconciled status timestamp

func (*EnvironmentBuilderStruct) WithRegistrationBuilder added in v1.5.8

func (eb *EnvironmentBuilderStruct) WithRegistrationBuilder(builder RegistrationBuilder) EnvironmentBuilder

WithRegistrationBuilder builds a RadixRegistration and appends new OwnerReference

func (*EnvironmentBuilderStruct) WithRegistrationOwner added in v1.5.5

func (eb *EnvironmentBuilderStruct) WithRegistrationOwner(registration *rx.RadixRegistration) EnvironmentBuilder

WithRegistrationOwner appends new OwnerReference to a RadixRegistration

func (*EnvironmentBuilderStruct) WithResourceVersion added in v1.5.11

func (eb *EnvironmentBuilderStruct) WithResourceVersion(version string) EnvironmentBuilder

WithResourceVersion sets ResourceVersion objectmeta

func (*EnvironmentBuilderStruct) WithUID added in v1.5.5

WithUID sets UID

type JobBuilder

type JobBuilder interface {
	WithRadixApplication(ApplicationBuilder) JobBuilder
	WithJobName(string) JobBuilder
	WithAppName(string) JobBuilder
	WithPipelineImageTag(string) JobBuilder
	WithPipelineType(v1.RadixPipelineType) JobBuilder
	WithBranch(string) JobBuilder
	WithCommitID(string) JobBuilder
	WithPushImage(bool) JobBuilder
	WithImageTag(string) JobBuilder
	WithDeploymentName(string) JobBuilder
	WithStatusOnAnnotation(JobStatusBuilder) JobBuilder
	WithEmptyStatus() JobBuilder
	WithStatus(JobStatusBuilder) JobBuilder
	WithCreated(time.Time) JobBuilder
	GetApplicationBuilder() ApplicationBuilder
	BuildRJ() *v1.RadixJob
}

JobBuilder Handles construction of RJ

func ARadixBuildDeployJob

func ARadixBuildDeployJob() JobBuilder

ARadixBuildDeployJob Constructor for radix job builder containing test data

func ARadixBuildDeployJobWithAppBuilder added in v1.41.9

func ARadixBuildDeployJobWithAppBuilder(builderModifier func(builder ApplicationBuilder)) JobBuilder

ARadixBuildDeployJobWithAppBuilder Constructor for radix job builder with ApplicationBuilder modifier, containing test data

func AStartedBuildDeployJob

func AStartedBuildDeployJob() JobBuilder

AStartedBuildDeployJob Constructor for radix job builder containing test data

func NewJobBuilder

func NewJobBuilder() JobBuilder

NewJobBuilder Constructor for radixjob builder

type JobBuilderStruct

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

JobBuilderStruct Holds instance variables

func (*JobBuilderStruct) BuildRJ

func (jb *JobBuilderStruct) BuildRJ() *v1.RadixJob

BuildRJ Builds RJ structure based on set variables

func (*JobBuilderStruct) GetApplicationBuilder

func (jb *JobBuilderStruct) GetApplicationBuilder() ApplicationBuilder

GetApplicationBuilder Obtains the builder for the corresponding RA, if exists (used for testing)

func (*JobBuilderStruct) WithAppName

func (jb *JobBuilderStruct) WithAppName(name string) JobBuilder

WithAppName Sets name of the application

func (*JobBuilderStruct) WithBranch

func (jb *JobBuilderStruct) WithBranch(branch string) JobBuilder

WithBranch Sets branch

func (*JobBuilderStruct) WithCommitID added in v1.43.5

func (jb *JobBuilderStruct) WithCommitID(commitID string) JobBuilder

WithCommitID Sets commit ID

func (*JobBuilderStruct) WithCreated

func (jb *JobBuilderStruct) WithCreated(created time.Time) JobBuilder

WithCreated Sets timestamp

func (*JobBuilderStruct) WithDeploymentName

func (jb *JobBuilderStruct) WithDeploymentName(deploymentName string) JobBuilder

WithDeploymentName Sets deployment name

func (*JobBuilderStruct) WithEmptyStatus

func (jb *JobBuilderStruct) WithEmptyStatus() JobBuilder

WithEmptyStatus Indicates that the RJ has no reconciled status

func (*JobBuilderStruct) WithImageTag added in v1.43.5

func (jb *JobBuilderStruct) WithImageTag(imageTag string) JobBuilder

WithImageTag Sets image tag

func (*JobBuilderStruct) WithJobName

func (jb *JobBuilderStruct) WithJobName(name string) JobBuilder

WithJobName Sets name of the radix job

func (*JobBuilderStruct) WithPipelineImageTag added in v1.43.5

func (jb *JobBuilderStruct) WithPipelineImageTag(imageTag string) JobBuilder

WithPipelineImageTag Sets the pipeline image tag

func (*JobBuilderStruct) WithPipelineType added in v1.43.5

func (jb *JobBuilderStruct) WithPipelineType(pipeline v1.RadixPipelineType) JobBuilder

WithPipelineType Sets pipeline

func (*JobBuilderStruct) WithPushImage added in v1.43.5

func (jb *JobBuilderStruct) WithPushImage(push bool) JobBuilder

WithPushImage Sets push image

func (*JobBuilderStruct) WithRadixApplication

func (jb *JobBuilderStruct) WithRadixApplication(applicationBuilder ApplicationBuilder) JobBuilder

WithRadixApplication Links to RA builder

func (*JobBuilderStruct) WithStatus

func (jb *JobBuilderStruct) WithStatus(jobStatus JobStatusBuilder) JobBuilder

WithStatus Sets status on job

func (*JobBuilderStruct) WithStatusOnAnnotation

func (jb *JobBuilderStruct) WithStatusOnAnnotation(jobStatus JobStatusBuilder) JobBuilder

WithStatusOnAnnotation Emulates velero plugin

type JobStatusBuilder

type JobStatusBuilder interface {
	WithCondition(v1.RadixJobCondition) JobStatusBuilder
	WithStarted(time.Time) JobStatusBuilder
	WithEnded(time.Time) JobStatusBuilder
	WithSteps(...JobStepBuilder) JobStatusBuilder
	WithStep(JobStepBuilder) JobStatusBuilder
	Build() v1.RadixJobStatus
}

JobStatusBuilder Handles construction of job status

func ACompletedJobStatus added in v1.4.0

func ACompletedJobStatus() JobStatusBuilder

ACompletedJobStatus Constructor for a completed job

func AStartedJobStatus

func AStartedJobStatus() JobStatusBuilder

AStartedJobStatus Constructor build-app

func NewJobStatusBuilder

func NewJobStatusBuilder() JobStatusBuilder

NewJobStatusBuilder Constructor for job status builder

type JobStepBuilder

type JobStepBuilder interface {
	WithCondition(v1.RadixJobCondition) JobStepBuilder
	WithName(string) JobStepBuilder
	WithStarted(time.Time) JobStepBuilder
	WithEnded(time.Time) JobStepBuilder
	WithComponents(...string) JobStepBuilder
	Build() v1.RadixJobStep
}

JobStepBuilder Handles construction of job status step

func ABuildAppStep

func ABuildAppStep() JobStepBuilder

ABuildAppStep Constructor build-app

func ACloneConfigStep

func ACloneConfigStep() JobStepBuilder

ACloneConfigStep Constructor clone-config

func ACloneStep

func ACloneStep() JobStepBuilder

ACloneStep Constructor radix-pipeline

func ARadixPipelineStep

func ARadixPipelineStep() JobStepBuilder

ARadixPipelineStep Constructor radix-pipeline

func NewJobStepBuilder

func NewJobStepBuilder() JobStepBuilder

NewJobStepBuilder Constructor for job step builder

type KubernetesClientConfigOption added in v1.21.6

type KubernetesClientConfigOption func(*rest.Config)

func WithKubernetesClientRateLimiter added in v1.21.6

func WithKubernetesClientRateLimiter(rateLimiter flowcontrol.RateLimiter) KubernetesClientConfigOption

type RadixApplicationComponentBuilder

type RadixApplicationComponentBuilder interface {
	WithName(string) RadixApplicationComponentBuilder
	WithAlwaysPullImageOnDeploy(bool) RadixApplicationComponentBuilder
	WithSourceFolder(string) RadixApplicationComponentBuilder
	WithDockerfileName(string) RadixApplicationComponentBuilder
	WithImage(string) RadixApplicationComponentBuilder
	WithPublic(bool) RadixApplicationComponentBuilder // Deprecated: For backwards comptibility WithPublic is still supported, new code should use WithPublicPort instead
	WithPublicPort(string) RadixApplicationComponentBuilder
	WithPort(string, int32) RadixApplicationComponentBuilder
	WithPorts([]v1.ComponentPort) RadixApplicationComponentBuilder
	WithSecrets(...string) RadixApplicationComponentBuilder
	WithSecretRefs(v1.RadixSecretRefs) RadixApplicationComponentBuilder
	WithMonitoringConfig(v1.MonitoringConfig) RadixApplicationComponentBuilder
	WithIngressConfiguration(...string) RadixApplicationComponentBuilder
	WithEnvironmentConfig(RadixEnvironmentConfigBuilder) RadixApplicationComponentBuilder
	WithEnvironmentConfigs(...RadixEnvironmentConfigBuilder) RadixApplicationComponentBuilder
	WithCommonEnvironmentVariable(string, string) RadixApplicationComponentBuilder
	WithCommonResource(map[string]string, map[string]string) RadixApplicationComponentBuilder
	WithNode(v1.RadixNode) RadixApplicationComponentBuilder
	WithAuthentication(*v1.Authentication) RadixApplicationComponentBuilder
	WithVolumeMounts([]v1.RadixVolumeMount) RadixApplicationComponentBuilder
	WithEnabled(bool) RadixApplicationComponentBuilder
	WithIdentity(*v1.Identity) RadixApplicationComponentBuilder
	BuildComponent() v1.RadixComponent
}

RadixApplicationComponentBuilder Handles construction of RA component

func AnApplicationComponent

func AnApplicationComponent() RadixApplicationComponentBuilder

AnApplicationComponent Constructor for component builder builder containing test data

func NewApplicationComponentBuilder

func NewApplicationComponentBuilder() RadixApplicationComponentBuilder

NewApplicationComponentBuilder Constructor for component builder

type RadixApplicationJobComponentBuilder added in v1.8.0

type RadixApplicationJobComponentBuilder interface {
	WithName(string) RadixApplicationJobComponentBuilder
	WithSourceFolder(string) RadixApplicationJobComponentBuilder
	WithDockerfileName(string) RadixApplicationJobComponentBuilder
	WithImage(string) RadixApplicationJobComponentBuilder
	WithPort(string, int32) RadixApplicationJobComponentBuilder
	WithSecrets(...string) RadixApplicationJobComponentBuilder
	WithSecretRefs(v1.RadixSecretRefs) RadixApplicationJobComponentBuilder
	WithMonitoringConfig(v1.MonitoringConfig) RadixApplicationJobComponentBuilder
	WithEnvironmentConfig(RadixJobComponentEnvironmentConfigBuilder) RadixApplicationJobComponentBuilder
	WithEnvironmentConfigs(...RadixJobComponentEnvironmentConfigBuilder) RadixApplicationJobComponentBuilder
	WithCommonEnvironmentVariable(string, string) RadixApplicationJobComponentBuilder
	WithCommonResource(map[string]string, map[string]string) RadixApplicationJobComponentBuilder
	WithSchedulerPort(*int32) RadixApplicationJobComponentBuilder
	WithPayloadPath(*string) RadixApplicationJobComponentBuilder
	WithNode(node v1.RadixNode) RadixApplicationJobComponentBuilder
	WithVolumeMounts(volumeMounts []v1.RadixVolumeMount) RadixApplicationJobComponentBuilder
	WithTimeLimitSeconds(*int64) RadixApplicationJobComponentBuilder
	WithBackoffLimit(*int32) RadixApplicationJobComponentBuilder
	WithEnabled(bool) RadixApplicationJobComponentBuilder
	WithIdentity(*v1.Identity) RadixApplicationJobComponentBuilder
	WithNotifications(*v1.Notifications) RadixApplicationJobComponentBuilder
	BuildJobComponent() v1.RadixJobComponent
}

RadixApplicationJobComponentBuilder Handles construction of RA job component

func AnApplicationJobComponent added in v1.8.0

func AnApplicationJobComponent() RadixApplicationJobComponentBuilder

AnApplicationJobComponent Constructor for job component builder containing test data

func NewApplicationJobComponentBuilder added in v1.8.0

func NewApplicationJobComponentBuilder() RadixApplicationJobComponentBuilder

NewApplicationJobComponentBuilder Constructor for job component builder

type RadixEnvironmentConfigBuilder

RadixEnvironmentConfigBuilder Handles construction of RA component environment

func AnEnvironmentConfig

func AnEnvironmentConfig() RadixEnvironmentConfigBuilder

AnEnvironmentConfig Constructor for component environment builder containing test data

func NewComponentEnvironmentBuilder

func NewComponentEnvironmentBuilder() RadixEnvironmentConfigBuilder

NewComponentEnvironmentBuilder Constructor for component environment builder

type RadixJobComponentEnvironmentConfigBuilder added in v1.8.0

RadixJobComponentEnvironmentConfigBuilder Handles construction of RA job component environment

func AJobComponentEnvironmentConfig added in v1.8.0

func AJobComponentEnvironmentConfig() RadixJobComponentEnvironmentConfigBuilder

AJobComponentEnvironmentConfig Constructor for job component environment builder containing test data

func NewJobComponentEnvironmentBuilder added in v1.8.0

func NewJobComponentEnvironmentBuilder() RadixJobComponentEnvironmentConfigBuilder

NewJobComponentEnvironmentBuilder Constructor for job component environment builder

type RegistrationBuilder

type RegistrationBuilder interface {
	WithUID(types.UID) RegistrationBuilder
	WithName(name string) RegistrationBuilder
	WithRepository(string) RegistrationBuilder
	WithSharedSecret(string) RegistrationBuilder
	WithAdGroups([]string) RegistrationBuilder
	WithPublicKey(string) RegistrationBuilder
	WithPrivateKey(string) RegistrationBuilder
	WithCloneURL(string) RegistrationBuilder
	WithOwner(string) RegistrationBuilder
	WithCreator(string) RegistrationBuilder
	WithEmptyStatus() RegistrationBuilder
	WithWBS(string) RegistrationBuilder
	WithConfigBranch(string) RegistrationBuilder
	WithRadixConfigFullName(string) RegistrationBuilder
	WithConfigurationItem(string) RegistrationBuilder
	WithRadixRegistration(*v1.RadixRegistration) RegistrationBuilder
	WithReaderAdGroups([]string) RegistrationBuilder
	BuildRR() *v1.RadixRegistration
}

RegistrationBuilder Handles construction of RR or applicationRegistration

func ARadixRegistration

func ARadixRegistration() RegistrationBuilder

ARadixRegistration Constructor for registration builder containing test data

func NewRegistrationBuilder

func NewRegistrationBuilder() RegistrationBuilder

NewRegistrationBuilder Constructor for registration builder

type RegistrationBuilderStruct

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

RegistrationBuilderStruct Instance variables

func (*RegistrationBuilderStruct) BuildRR

BuildRR Builds the radix registration

func (*RegistrationBuilderStruct) WithAdGroups

func (rb *RegistrationBuilderStruct) WithAdGroups(adGroups []string) RegistrationBuilder

WithAdGroups Sets ad group

func (*RegistrationBuilderStruct) WithCloneURL

func (rb *RegistrationBuilderStruct) WithCloneURL(cloneURL string) RegistrationBuilder

WithCloneURL Sets clone url

func (*RegistrationBuilderStruct) WithConfigBranch added in v1.6.0

func (rb *RegistrationBuilderStruct) WithConfigBranch(configBranch string) RegistrationBuilder

WithConfigBranch Sets ConfigBranch

func (*RegistrationBuilderStruct) WithConfigurationItem added in v1.26.3

func (rb *RegistrationBuilderStruct) WithConfigurationItem(ci string) RegistrationBuilder

WithConfigBranch Sets ApplicationId

func (*RegistrationBuilderStruct) WithCreator added in v1.3.2

func (rb *RegistrationBuilderStruct) WithCreator(creator string) RegistrationBuilder

WithCreator set creator

func (*RegistrationBuilderStruct) WithEmptyStatus added in v1.4.1

func (rb *RegistrationBuilderStruct) WithEmptyStatus() RegistrationBuilder

WithEmptyStatus Indicates that the RR has no reconciled status

func (*RegistrationBuilderStruct) WithName

WithName Sets name

func (*RegistrationBuilderStruct) WithOwner added in v1.3.2

WithOwner set owner

func (*RegistrationBuilderStruct) WithPrivateKey

func (rb *RegistrationBuilderStruct) WithPrivateKey(privateKey string) RegistrationBuilder

WithPrivateKey Sets private key

func (*RegistrationBuilderStruct) WithPublicKey

func (rb *RegistrationBuilderStruct) WithPublicKey(publicKey string) RegistrationBuilder

WithPublicKey Sets public key

func (*RegistrationBuilderStruct) WithRadixConfigFullName added in v1.27.0

func (rb *RegistrationBuilderStruct) WithRadixConfigFullName(fullName string) RegistrationBuilder

WithRadixConfigFullName Sets RadixConfigFullName

func (*RegistrationBuilderStruct) WithRadixRegistration

func (rb *RegistrationBuilderStruct) WithRadixRegistration(radixRegistration *v1.RadixRegistration) RegistrationBuilder

WithRadixRegistration Re-enginers a builder from a registration

func (*RegistrationBuilderStruct) WithReaderAdGroups added in v1.39.3

func (rb *RegistrationBuilderStruct) WithReaderAdGroups(readerAdGroups []string) RegistrationBuilder

WithReaderAdGroups Sets reader ad group

func (*RegistrationBuilderStruct) WithRepository

func (rb *RegistrationBuilderStruct) WithRepository(repository string) RegistrationBuilder

WithRepository Sets repository

func (*RegistrationBuilderStruct) WithSharedSecret

func (rb *RegistrationBuilderStruct) WithSharedSecret(sharedSecret string) RegistrationBuilder

WithSharedSecret Sets shared secret

func (*RegistrationBuilderStruct) WithUID

WithUID Sets UID

func (*RegistrationBuilderStruct) WithWBS added in v1.5.15

WithWBS Sets WBS

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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