common

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DNSDomain string

DNSDomain is the DNS domain under which all services shall be exposed.

Functions

func EnsureAnnotation added in v0.7.0

func EnsureAnnotation(obj client.Object, key, value string)

EnsureAnnotation sets the annotation key to value on the object. if the value is an empty string, the annotation is removed.

func ExtractCluster

func ExtractCluster(host string) (cluster string, err error)

ExtractCluster extracts the cluster name from the host. The pattern shall be $cluster--$hash, where $hash = service--$namespace

func GetPluginDefinitionSpec added in v0.7.0

func GetPluginDefinitionSpec(ctx context.Context, c client.Client, pluginDefinitionRef greenhousev1alpha1.PluginDefinitionReference, resourceNamespace string) (*greenhousev1alpha1.PluginDefinitionSpec, error)

GetPluginDefinitionSpec resolves the (Cluster-)PluginDefinition reference and returns shared PluginDefinitionSpec

func URLForExposedServiceInPlugin

func URLForExposedServiceInPlugin(serviceName string, plugin *greenhousev1alpha1.Plugin) string

URLForExposedServiceInPlugin returns the URL that shall be used to expose a service centrally via Greenhouse. The pattern shall be $https://$cluster--$hash.$organisation.$basedomain, where $hash = $service--$namespace We know $cluster is no longer than 40 characters and does not contain "--"

Types

type Permission added in v0.6.0

type Permission struct {
	Name     string
	Verb     string
	APIGroup string
	Resource string
}

Permission defines a Kubernetes action on a resource.

func CheckClientClusterPermission added in v0.6.0

func CheckClientClusterPermission(ctx context.Context, kubeClient client.Client, user, namespace string) (missingPermission []Permission)

CheckClientClusterPermission returns names of missing client-cluster permissions.

func CheckGreenhousePermission added in v0.6.0

func CheckGreenhousePermission(ctx context.Context, kubeClient client.Client, user, namespace string) (missingPermission []Permission)

CheckGreenhousePermission returns names of missing greenhouse permissions for the user.

func (Permission) String added in v0.6.0

func (p Permission) String() string

type RegistryMirror added in v0.7.0

type RegistryMirror struct {
	BaseDomain string `yaml:"baseDomain"`
	SubPath    string `yaml:"subPath"`
}

RegistryMirror represents a single registry mirror configuration.

type RegistryMirrorConfig added in v0.7.0

type RegistryMirrorConfig struct {
	PrimaryMirror   string                    `yaml:"primaryMirror"`
	RegistryMirrors map[string]RegistryMirror `yaml:"registryMirrors"`
}

RegistryMirrorConfig represents the registry mirror configuration structure.

func GetRegistryMirrorConfig added in v0.7.0

func GetRegistryMirrorConfig(ctx context.Context, k8sClient client.Reader, orgName string) (*RegistryMirrorConfig, error)

GetRegistryMirrorConfig retrieves and parses the registry mirror configuration from the Organization's ConfigMap. Registry mirrors redirect image pulls from original registries to mirror registries.

Jump to

Keyboard shortcuts

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