Documentation ¶
Index ¶
- Constants
- func ClusterFromNamespace(ctx context.Context, client ctrlruntimeclient.Client, namespace string) (*kubermaticv1.Cluster, error)
- func CreateOrUpdateCredentialSecretForCluster(ctx context.Context, seedClient ctrlruntimeclient.Client, ...) error
- func CreateOrUpdateSecretForCluster(ctx context.Context, client ctrlruntimeclient.Client, ...) (*kubermaticv1.GlobalSecretKeySelector, error)
- func DatacenterGetterFactory(client ctrlruntimeclient.Reader) (provider.DatacenterGetter, error)
- func DatacentersGetterFactory(client ctrlruntimeclient.Client) (provider.DatacentersGetter, error)
- func DynamicKubermaticConfigurationGetterFactory(client ctrlruntimeclient.Reader, namespace string) (provider.KubermaticConfigurationGetter, error)
- func GetRawKubermaticConfiguration(ctx context.Context, client ctrlruntimeclient.Reader, namespace string) (*kubermaticv1.KubermaticConfiguration, error)
- func NamespaceName(clusterName string) string
- func StaticKubermaticConfigurationGetterFactory(config *kubermaticv1.KubermaticConfiguration) (provider.KubermaticConfigurationGetter, error)
- type DefaultImpersonationClient
- type ImpersonationClient
Constants ¶
const (
// NamespacePrefix is the prefix for the cluster namespace.
NamespacePrefix = "cluster-"
)
Variables ¶
This section is empty.
Functions ¶
func ClusterFromNamespace ¶
func ClusterFromNamespace(ctx context.Context, client ctrlruntimeclient.Client, namespace string) (*kubermaticv1.Cluster, error)
ClusterFromNamespace filters all Cluster objects and returns the one where status.namespaceName matches the given namespace. If no such cluster exists, nil is returned (no error).
func CreateOrUpdateCredentialSecretForCluster ¶
func CreateOrUpdateCredentialSecretForCluster(ctx context.Context, seedClient ctrlruntimeclient.Client, cluster *kubermaticv1.Cluster) error
CreateOrUpdateCredentialSecretForCluster creates a new secret for a credential.
func CreateOrUpdateSecretForCluster ¶
func CreateOrUpdateSecretForCluster(ctx context.Context, client ctrlruntimeclient.Client, externalcluster *kubermaticv1.ExternalCluster, secretData map[string][]byte, secretName, secretNamespace string) (*kubermaticv1.GlobalSecretKeySelector, error)
func DatacenterGetterFactory ¶
func DatacenterGetterFactory(client ctrlruntimeclient.Reader) (provider.DatacenterGetter, error)
DatacenterGetterFactory returns a DatacenterGetter. It has validation of all its arguments.
func DatacentersGetterFactory ¶
func DatacentersGetterFactory(client ctrlruntimeclient.Client) (provider.DatacentersGetter, error)
func DynamicKubermaticConfigurationGetterFactory ¶
func DynamicKubermaticConfigurationGetterFactory(client ctrlruntimeclient.Reader, namespace string) (provider.KubermaticConfigurationGetter, error)
DynamicKubermaticConfigurationGetterFactory returns a dynamic KubermaticConfigurationGetter, which will list all Configurations in the given namespace and return the found config or an error if 0 or more Configurations where found.
func GetRawKubermaticConfiguration ¶
func GetRawKubermaticConfiguration(ctx context.Context, client ctrlruntimeclient.Reader, namespace string) (*kubermaticv1.KubermaticConfiguration, error)
GetRawKubermaticConfiguration will list all Configurations in the given namespace and return the found config or an error if 0 or more Configurations where found. Most code should use a KubermaticConfigurationGetter instead of calling this function directly. This function does not apply the default values.
func NamespaceName ¶
NamespaceName returns the namespace name for a cluster.
func StaticKubermaticConfigurationGetterFactory ¶
func StaticKubermaticConfigurationGetterFactory(config *kubermaticv1.KubermaticConfiguration) (provider.KubermaticConfigurationGetter, error)
StaticKubermaticConfigurationGetterFactory returns a KubermaticConfigurationGetter that returns the same Configuration on every call. This is mostly used for local development in order to provide an easy to modify configuration file. Actual production use will use the dynamic getter instead.
Types ¶
type DefaultImpersonationClient ¶
type DefaultImpersonationClient struct {
// contains filtered or unexported fields
}
DefaultImpersonationClient knows how to create impersonated client set.
func NewImpersonationClient ¶
func NewImpersonationClient(cfg *restclient.Config, restMapper meta.RESTMapper) *DefaultImpersonationClient
NewImpersonationClient creates a new default impersonation client that knows how to create Interface client for a impersonated user.
func (*DefaultImpersonationClient) CreateImpersonatedClient ¶
func (d *DefaultImpersonationClient) CreateImpersonatedClient(impCfg restclient.ImpersonationConfig) (ctrlruntimeclient.Client, error)
CreateImpersonatedClient actually creates impersonated client set for the given user.
type ImpersonationClient ¶
type ImpersonationClient func(impCfg restclient.ImpersonationConfig) (ctrlruntimeclient.Client, error)
ImpersonationClient gives runtime controller client that uses user impersonation.