helper

package
v3.0.0-...-b0a9388 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserServiceAccountPrefix = "serviceaccount-"
)

Variables

This section is empty.

Functions

func ClusterCloudProviderName

func ClusterCloudProviderName(spec kubermaticv1.CloudSpec) (kubermaticeev1.CloudProvider, error)

ClusterCloudProviderName returns the provider name for the given CloudSpec.

func EnsureProjectServiceAccountPrefix

func EnsureProjectServiceAccountPrefix(str string) string

EnsureProjectServiceAccountPrefix adds "serviceaccount-" prefix to a SA's ID, for example given "7d4b5695vb" it returns "serviceaccount-7d4b5695vb".

func IsProjectServiceAccount

func IsProjectServiceAccount(nameOrEmail string) bool

IsProjectServiceAccount determines whether the given email address or user object name belongs to a project service account. For a service account, they must have the UserServiceAccountPrefix.

func RemoveProjectServiceAccountPrefix

func RemoveProjectServiceAccountPrefix(str string) string

RemoveProjectServiceAccountPrefix removes "serviceaccount-" from a SA's ID, for example given "serviceaccount-7d4b5695vb" it returns "7d4b5695vb".

func SetClusterCondition

func SetClusterCondition(
	c *kubermaticeev1.Cluster,
	kkpVersion string,
	conditionType kubermaticv1.ClusterConditionType,
	status corev1.ConditionStatus,
	reason string,
	message string,
)

SetClusterCondition sets a condition on the given cluster using the provided type, status, reason and message. It also adds the Kubermatic version and timestamps.

func SetSeedCondition

func SetSeedCondition(seed *kubermaticeev1.Seed, conditionType kubermaticeev1.SeedConditionType, status corev1.ConditionStatus, reason string, message string)

SetSeedCondition sets a condition on the given seed using the provided type, status, reason and message.

Types

This section is empty.

Jump to

Keyboard shortcuts

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