Documentation ¶
Index ¶
- Constants
- func AddAnnotation(obj v1.Object, key, value string)
- func AddFinalizer(obj v1.Object, finalizer string)
- func AddLabels(obj v1.Object, key, value string)
- func CalculateRequeueDurationForPrematureRetry(lastOp *hubv1.LastOperation) (bool, *time.Duration)
- func CalculateRequeueTimeout(numberOfTries int32) time.Duration
- func ComputeSecretDeletionToken(secretDeletionKey []byte, secretName string) ([]byte, error)
- func ContainsString(s string, stringSlice []string) bool
- func ContainsValue(value interface{}, values []interface{}) bool
- func CreateDeployItemName(clusterBomName, appID string) string
- func CreateInitialLastOperation() *hubv1.LastOperation
- func CreateInstallationName(clusterBomName, appID string) string
- func CreateRawExtension(data map[string]interface{}) (*runtime.RawExtension, error)
- func CreateRawExtensionOrPanic(data map[string]interface{}) *runtime.RawExtension
- func CreateSecretName(clusterBomName, appConfigID string) string
- func DecodeBasicAuthCredentials(base64EncodedBasicAuthCredentials string) (string, string, error)
- func Decrypt(ciphertext, key []byte) ([]byte, error)
- func Encrypt(plaintext, key []byte) ([]byte, error)
- func EnrichContextAndLogger(ctx context.Context, keysAndValues ...interface{}) (context.Context, logr.Logger)
- func Example()
- func GetAnnotation(obj v1.Object, key string) (string, bool)
- func GetAppCondition(app *kapp.App, conditionType kapp.AppConditionType) *kapp.AppCondition
- func GetAppConditionStatus(app *kapp.App, conditionType kapp.AppConditionType) v1.ConditionStatus
- func GetAppConfigIDFromDeployItem(deployItem *v1alpha1.DeployItem) string
- func GetAppConfigIDFromInstallation(installation *v1alpha1.Installation) string
- func GetAppConfigIDFromInstallationKey(installationKey *types.NamespacedName) string
- func GetApprepoNamespace() string
- func GetClusterBomCondition(clusterbom *hubv1.ClusterBom, conditionType hubv1.ClusterBomConditionType) *hubv1.ClusterBomCondition
- func GetClusterBomConditionFromStatus(clusterbomStatus *hubv1.ClusterBomStatus, ...) *hubv1.ClusterBomCondition
- func GetClusterBomKeyFromClusterBomOrDeployItem(clusterBom *hubv1.ClusterBom, deployItem *v1alpha1.DeployItem) *types.NamespacedName
- func GetClusterBomKeyFromDeployItem(deployItem *v1alpha1.DeployItem) *types.NamespacedName
- func GetClusterBomKeyFromDeployItemKey(deployItemKey *types.NamespacedName) *types.NamespacedName
- func GetClusterBomKeyFromInstallationKey(installationKey *types.NamespacedName) *types.NamespacedName
- func GetDeployItemCondition(deployItem *v1alpha1.DeployItem, ...) *v1alpha1.Condition
- func GetDeployItemConditionStatus(c *v1alpha1.Condition) v1.ConditionStatus
- func GetEnvBool(name string, defaultValue bool, logger logr.Logger) bool
- func GetEnvInteger(name string, defaultValue int, logger logr.Logger) int
- func GetFieldsByJSONPath(obj map[string]interface{}, fieldPath string) ([][]reflect.Value, error)
- func GetGCloudAccessToken(gcloudServiceAccountJSON string) (string, error)
- func GetKey(obj metav1.Object) *types.NamespacedName
- func GetLabel(obj v1.Object, key string) (string, bool)
- func GetLoggerFromContext(ctx context.Context) logr.Logger
- func GetPodNamespace() string
- func GetSecretKeyFromClusterBom(clusterBom *hubv1.ClusterBom) *types.NamespacedName
- func HasAnnotation(obj v1.Object, key, value string) bool
- func HasFinalizer(obj v1.Object, finalizer string) bool
- func HasLabel(obj v1.Object, key, value string) bool
- func Hash256(phrase string) ([]byte, error)
- func HashObject256(obj interface{}) (string, error)
- func IsConcurrentModificationErr(err error) bool
- func IsEqualClusterBomCondition(c, d *hubv1.ClusterBomCondition) bool
- func IsEqualClusterBomConditionList(oldConditions, newConditions []hubv1.ClusterBomCondition) bool
- func IsEqualHdcConditionList(oldConditions, newConditions []hubv1.HubDeploymentCondition) bool
- func IsStatusErrorConflict(err error) bool
- func IsStatusErrorWithCode(err error, code int32) bool
- func MapToHdcCondition(conditions []v1alpha1.Condition) []hubv1.HubDeploymentCondition
- func NewContextAndLogger(logger logr.Logger, keysAndValues ...interface{}) (context.Context, logr.Logger)
- func ParseSuccessValues(successValues []runtime.RawExtension) ([]interface{}, error)
- func RemoveAnnotation(obj v1.Object, key string)
- func RemoveFinalizer(obj v1.Object, finalizer string)
- func RemoveLabel(obj v1.Object, key string)
- func Repeat(f func() bool, repetitions int, pause time.Duration) bool
- func WithBasicAuth(handler http.HandlerFunc, username, password string) http.HandlerFunc
- func WorseConditionStatus(status1, status2 v1.ConditionStatus) v1.ConditionStatus
- type AuditLogKey
- type CRAndSecretClientKey
- type Clock
- type LoggerKey
- type RealClock
- type ThreadCounterMap
Constants ¶
View Source
const ( StateOk = "ok" StatePending = "pending" StateFailed = "failed" StateUnknown = "unknown" StateNotRelevant = "notRelevant" StateFinallyFailed = "finallyFailed" // Log level constants. Larger numbers represent less important logs. LogLevelDebug = 1 LogLevelWarning = -1 // Strings for readable log levels LogLevelStringError = "error" LogLevelStringWarning = "warning" LogLevelStringInfo = "info" LogLevelStringDebug = "debug" // Keys for logging common fields LogKeyClusterBomName = "clusterbom-name" LogKeyDeployItemName = "deployitem-name" LogKeyInstallationName = "installation-name" LogKeyCorrelationID = "correlation-id" LogKeyInterval = "interval" LogKeyConfigmap = "configmap" LogKeyResponseBody = "response-body" LogKeySecretName = "secret-name" LogKeyKappAppNamespacedName = "kappapp-name" TextShootNotExisting = "shoot cluster does not exist" APIVersionExtensionsV1beta1 = "extensions/v1beta1" APIVersionAppsV1beta1 = "apps/v1beta1" APIVersionAppsV1beta2 = "apps/v1beta2" APIVersionAppsV1 = "apps/v1" APIVersionBatchV1 = "batch/v1" KindDaemonSet = "DaemonSet" KindDeployment = "Deployment" KindStatefulSet = "StatefulSet" KindJob = "Job" PurposeSecretValues = "secret-values" PurposeDiExportData = "di-export-data" // annotations AnnotationKeyReconcile = "hub.k8s.sap.com/reconcile" AnnotationValueReconcile = "reconcile" AnnotationKeyInstallationHash = "potter.gardener.cloud/installation-hash" // keys SecretValuesKey = "secretValues" KeyDeletionToken = "deletionToken" OperationInstall = "install" OperationRemove = "remove" ConfigTypeHelm = "helm" ConfigTypeKapp = "kapp" HubControllerFinalizer = "hub-controller" DeployItemConfigVersion = "potter.gardener.cloud/v1" DeployItemStatusVersion = "potter.gardener.cloud/v1" )
View Source
const ( Separator = "-" DoubleSeparator = "--" )
Variables ¶
This section is empty.
Functions ¶
func AddAnnotation ¶
func AddFinalizer ¶
func CalculateRequeueDurationForPrematureRetry ¶
func CalculateRequeueDurationForPrematureRetry(lastOp *hubv1.LastOperation) (bool, *time.Duration)
func CalculateRequeueTimeout ¶
func ContainsString ¶
func ContainsValue ¶
func ContainsValue(value interface{}, values []interface{}) bool
func CreateDeployItemName ¶
func CreateInitialLastOperation ¶
func CreateInitialLastOperation() *hubv1.LastOperation
func CreateInstallationName ¶
func CreateRawExtension ¶
func CreateRawExtension(data map[string]interface{}) (*runtime.RawExtension, error)
func CreateRawExtensionOrPanic ¶
func CreateRawExtensionOrPanic(data map[string]interface{}) *runtime.RawExtension
func CreateSecretName ¶
func DecodeBasicAuthCredentials ¶
DecodeBasicAuthCredentials Decodes basic auth credential string and returns username, password or an error
func EnrichContextAndLogger ¶
func GetAppCondition ¶
func GetAppCondition(app *kapp.App, conditionType kapp.AppConditionType) *kapp.AppCondition
func GetAppConditionStatus ¶
func GetAppConditionStatus(app *kapp.App, conditionType kapp.AppConditionType) v1.ConditionStatus
func GetAppConfigIDFromDeployItem ¶
func GetAppConfigIDFromDeployItem(deployItem *v1alpha1.DeployItem) string
func GetAppConfigIDFromInstallation ¶
func GetAppConfigIDFromInstallation(installation *v1alpha1.Installation) string
func GetAppConfigIDFromInstallationKey ¶
func GetAppConfigIDFromInstallationKey(installationKey *types.NamespacedName) string
func GetApprepoNamespace ¶
func GetApprepoNamespace() string
func GetClusterBomCondition ¶
func GetClusterBomCondition(clusterbom *hubv1.ClusterBom, conditionType hubv1.ClusterBomConditionType) *hubv1.ClusterBomCondition
func GetClusterBomConditionFromStatus ¶
func GetClusterBomConditionFromStatus(clusterbomStatus *hubv1.ClusterBomStatus, conditionType hubv1.ClusterBomConditionType) *hubv1.ClusterBomCondition
func GetClusterBomKeyFromClusterBomOrDeployItem ¶
func GetClusterBomKeyFromClusterBomOrDeployItem(clusterBom *hubv1.ClusterBom, deployItem *v1alpha1.DeployItem) *types.NamespacedName
func GetClusterBomKeyFromDeployItem ¶
func GetClusterBomKeyFromDeployItem(deployItem *v1alpha1.DeployItem) *types.NamespacedName
func GetClusterBomKeyFromDeployItemKey ¶
func GetClusterBomKeyFromDeployItemKey(deployItemKey *types.NamespacedName) *types.NamespacedName
func GetClusterBomKeyFromInstallationKey ¶
func GetClusterBomKeyFromInstallationKey(installationKey *types.NamespacedName) *types.NamespacedName
func GetDeployItemCondition ¶
func GetDeployItemCondition(deployItem *v1alpha1.DeployItem, conditionType hubv1.HubDeploymentConditionType) *v1alpha1.Condition
func GetDeployItemConditionStatus ¶
func GetDeployItemConditionStatus(c *v1alpha1.Condition) v1.ConditionStatus
func GetFieldsByJSONPath ¶
func GetGCloudAccessToken ¶
GetGCloudAccessToken returns an access token from a google service account json string. Returns the access token or error.
func GetPodNamespace ¶
func GetPodNamespace() string
func GetSecretKeyFromClusterBom ¶
func GetSecretKeyFromClusterBom(clusterBom *hubv1.ClusterBom) *types.NamespacedName
func Hash256 ¶
Hash256 computes the SHA256 hash of the given string. The resulting []byte has length 32.
func HashObject256 ¶
func IsEqualClusterBomCondition ¶
func IsEqualClusterBomCondition(c, d *hubv1.ClusterBomCondition) bool
func IsEqualClusterBomConditionList ¶
func IsEqualClusterBomConditionList(oldConditions, newConditions []hubv1.ClusterBomCondition) bool
func IsEqualHdcConditionList ¶
func IsEqualHdcConditionList(oldConditions, newConditions []hubv1.HubDeploymentCondition) bool
func IsStatusErrorConflict ¶
func IsStatusErrorWithCode ¶
func MapToHdcCondition ¶
func MapToHdcCondition(conditions []v1alpha1.Condition) []hubv1.HubDeploymentCondition
func NewContextAndLogger ¶
func ParseSuccessValues ¶
func ParseSuccessValues(successValues []runtime.RawExtension) ([]interface{}, error)
func RemoveAnnotation ¶
func RemoveFinalizer ¶
func RemoveLabel ¶
func WithBasicAuth ¶
func WithBasicAuth(handler http.HandlerFunc, username, password string) http.HandlerFunc
func WorseConditionStatus ¶
func WorseConditionStatus(status1, status2 v1.ConditionStatus) v1.ConditionStatus
Types ¶
type AuditLogKey ¶
type AuditLogKey struct{}
type CRAndSecretClientKey ¶
type CRAndSecretClientKey struct{}
type ThreadCounterMap ¶
type ThreadCounterMap struct {
// contains filtered or unexported fields
}
func NewThreadCounterMap ¶
func NewThreadCounterMap(l logr.Logger) *ThreadCounterMap
func (*ThreadCounterMap) IncreaseEntryAndLog ¶
func (r *ThreadCounterMap) IncreaseEntryAndLog(s string)
func (*ThreadCounterMap) ReduceEntry ¶
func (r *ThreadCounterMap) ReduceEntry(s string)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.