util

package
v0.0.0-...-9940484 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Log level constants. Larger numbers represent less important logs.
	LogLevelDebug   = 1
	LogLevelWarning = -1

	LabelClusterBomName = "hub.kubernetes.sap.com/bom-name"

	ConfigTypeHelm = "helm"
	ConfigTypeKapp = "kapp"
)

Variables

This section is empty.

Functions

func CheckClusterBomCondition

func CheckClusterBomCondition(ctx context.Context, clusterBom *hubv1.ClusterBom, cl *ClusterBomClient)

func CheckClusterBomGeneric

func CheckClusterBomGeneric(ctx context.Context, clusterBom *hubv1.ClusterBom, cl *ClusterBomClient,
	op func(*hubv1.ClusterBom, *hubv1.ClusterBom) bool) *hubv1.ClusterBom

func CheckClusterReconcileAnnotation

func CheckClusterReconcileAnnotation(ctx context.Context, clusterBom *hubv1.ClusterBom, cl *ClusterBomClient)

func CheckDeployedValue

func CheckDeployedValue(deployedValues, expectedValues map[string]interface{})

func CheckFailedApplication

func CheckFailedApplication(ctx context.Context, clusterBom *hubv1.ClusterBom, appConfigID string, gardenClient client.Client)

func CheckFailedClusterBom

func CheckFailedClusterBom(ctx context.Context, clusterBom *hubv1.ClusterBom, gardenClient client.Client)

func CheckKappAppDoesNotExist

func CheckKappAppDoesNotExist(ctx context.Context, clusterBomKey types.NamespacedName, configID string, gardenClient client.Client)

func CheckLastOperationTimeIncreased

func CheckLastOperationTimeIncreased(ctx context.Context, clusterbomKey types.NamespacedName,
	diListBefore *external.DeployItemList, cl *ClusterBomClient)

func CheckPauseStatus

func CheckPauseStatus(paused bool, pausedSince time.Time, problem bool, problemSince time.Time,
	pauseStatus *kapp.PauseStatus)

func CheckReconcileTimestampIncreased

func CheckReconcileTimestampIncreased(diListBefore, diListAfter *external.DeployItemList)

func CreateEchoServerInstallationName

func CreateEchoServerInstallationName(config *IntegrationTestConfig) string

func CreateEchoServerInstallationNameWithSuffix

func CreateEchoServerInstallationNameWithSuffix(config *IntegrationTestConfig, suffix string) string

func CreateJobNameWithSuffix

func CreateJobNameWithSuffix(config *IntegrationTestConfig, suffix string) string

func GetAppKey

func GetAppKey(clusterBomKey types.NamespacedName, configID string) types.NamespacedName

func GetAppWithNewPausedSince

func GetAppWithNewPausedSince(ctx context.Context, gardenClient client.Client,
	appKey types.NamespacedName, oldPausedSince time.Time) *v1alpha1.App

func GetAppWithPaused

func GetAppWithPaused(ctx context.Context, gardenClient client.Client,
	appKey types.NamespacedName, paused bool) *v1alpha1.App

func GetAppWithProblem

func GetAppWithProblem(ctx context.Context, gardenClient client.Client,
	appKey types.NamespacedName, problem bool) *v1alpha1.App

func GetDeployItems

func GetDeployItems(ctx context.Context, gardenClient client.Client,
	clusterBomKey types.NamespacedName, numOfDeployItems int) *landscaper.DeployItemList

func GetPauseStatus

func GetPauseStatus(ctx context.Context, app *v1alpha1.App) *kapp.PauseStatus

func GetTargetKubeConfig

func GetTargetKubeConfig(ctx context.Context, gardenClient client.Client, config *IntegrationTestConfig) string

func Parallel

func Parallel(fs ...func())

func Repeat

func Repeat(f func() bool, repetitions int, pause time.Duration) bool

func UpdatePauseStatus

func UpdatePauseStatus(ctx context.Context, gardenClient client.Client, appKey types.NamespacedName,
	paused bool, pausedSince time.Time, problem bool, problemSince time.Time)

func Write

func Write(args ...interface{})

func WriteAddAppConfig

func WriteAddAppConfig(appConfigID string, helmData *apitypes.HelmSpecificData)

func WriteClusterBom

func WriteClusterBom(clusterbom *hubv1.ClusterBom)

func WriteSectionHeader

func WriteSectionHeader(title string, landscaperManaged bool)

func WriteSubSectionHeader

func WriteSubSectionHeader(title string)

func WriteUpgradeAppConfig

func WriteUpgradeAppConfig(appConfigID string, helmData *apitypes.HelmSpecificData)

Types

type ClusterBomClient

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

func NewClusterBomClient

func NewClusterBomClient(gardenClient client.Client) *ClusterBomClient

func (*ClusterBomClient) AddReconcileAnnotationInClusterBom

func (c *ClusterBomClient) AddReconcileAnnotationInClusterBom(ctx context.Context, clusterBom *hubv1.ClusterBom) metav1.Time

func (*ClusterBomClient) CreateClusterBom

func (c *ClusterBomClient) CreateClusterBom(ctx context.Context, clusterBom *hubv1.ClusterBom)

func (*ClusterBomClient) DeleteClusterBom

func (c *ClusterBomClient) DeleteClusterBom(ctx context.Context, clusterBomKey types.NamespacedName)

func (*ClusterBomClient) DeleteClusterBomAsync

func (c *ClusterBomClient) DeleteClusterBomAsync(ctx context.Context, clusterBomKey types.NamespacedName) chan bool

func (*ClusterBomClient) GetClusterBom

func (c *ClusterBomClient) GetClusterBom(ctx context.Context, clusterBomKey types.NamespacedName) *hubv1.ClusterBom

func (*ClusterBomClient) ListDIs

ListHDCs lists all deploy items associated with a clusterbom

func (*ClusterBomClient) UpdateAppConfigsInClusterBom

func (c *ClusterBomClient) UpdateAppConfigsInClusterBom(ctx context.Context, clusterBom *hubv1.ClusterBom) metav1.Time

type IntegrationTestConfig

type IntegrationTestConfig struct {
	GardenKubeconfigPath    string
	GardenNamespace         string
	TargetClusterName       string
	TargetClusterNamespace1 string
	TargetClusterNamespace2 string
	TestPrefix              string
	TestLandscaper          bool
}

func (*IntegrationTestConfig) GetTestClusterBomKey

func (c *IntegrationTestConfig) GetTestClusterBomKey(suffix string) types.NamespacedName

Jump to

Keyboard shortcuts

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