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: 8 Imported by: 18

Documentation

Index

Constants

View Source
const (
	UserServiceAccountPrefix = "serviceaccount-"
)

Variables

This section is empty.

Functions

func CloudProviderToMachineController

func CloudProviderToMachineController(provider kubermaticv1.CloudProvider) (machinecontroller.CloudProvider, error)

func ClusterCloudProviderName

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

ClusterCloudProviderName returns the provider name for the given CloudSpec.

func DatacenterCloudProviderName

func DatacenterCloudProviderName(spec *kubermaticv1.DatacenterProviderSpec) (kubermaticv1.CloudProvider, error)

DatacenterCloudProviderName returns the provider name for the given Datacenter.

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 ExternalClusterCloudProviderName

func ExternalClusterCloudProviderName(spec kubermaticv1.ExternalClusterCloudSpec) (kubermaticv1.ExternalClusterProvider, error)

ExternalClusterCloudProviderName returns the provider name for the given ExternalClusterCloudSpec.

func IsIPv6EnabledDatacenter

func IsIPv6EnabledDatacenter(dc *kubermaticv1.Datacenter) bool

IsIPv6EnabledDatacenter returns true if IPv6 is enabled for the datacenter.

func IsIPv6KnownProvider

func IsIPv6KnownProvider(provider kubermaticv1.CloudProvider) bool

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 *kubermaticv1.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.

Types

This section is empty.

Jump to

Keyboard shortcuts

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