Documentation ¶
Index ¶
- Constants
- func ApplyClientConnectionConfigurationToRESTConfig(clientConnection *componentbaseconfig.ClientConnectionConfiguration, ...)
- func BoolPtr(b bool) *bool
- func ComputeChecksum(data interface{}) string
- func ContextFromStopChannel(stopCh <-chan struct{}) context.Context
- func Decode(decoder runtime.Decoder, data []byte, into runtime.Object) error
- func GetOrCreateShootKubeconfig(ctx context.Context, c client.Client, ...) (*corev1.Secret, error)
- func Int32Ptr(i int32) *int32
- func NewChartRendererForShoot(version string) (chartrenderer.Interface, error)
- func NewClientForShoot(ctx context.Context, c client.Client, namespace string, opts client.Options) (*rest.Config, client.Client, error)
- func NewRESTConfigFromKubeconfig(kubeconfig []byte) (*rest.Config, error)
- func ObjectName(obj runtime.Object) string
- func QuantityPtr(q resource.Quantity) *resource.Quantity
- func ScaleDeployment(ctx context.Context, client client.Client, deployment *appsv1.Deployment, ...) error
- func StringPtr(s string) *string
- func Use(_ ...interface{})
- func VersionInfo(vs string) (*version.Info, error)
- func VersionMajorMinor(version string) (string, error)
- type Chart
- type Secrets
- type ShootClients
Constants ¶
const CAChecksumAnnotation = "checksum/ca"
CAChecksumAnnotation is a resource annotation used to store the checksum of a certificate authority.
Variables ¶
This section is empty.
Functions ¶
func ApplyClientConnectionConfigurationToRESTConfig ¶
func ApplyClientConnectionConfigurationToRESTConfig(clientConnection *componentbaseconfig.ClientConnectionConfiguration, rest *rest.Config)
ApplyClientConnectionConfigurationToRESTConfig applies the given client connection configurations to the given REST config.
func ComputeChecksum ¶
func ComputeChecksum(data interface{}) string
ComputeChecksum computes a SHA256 checksum for the give map.
func ContextFromStopChannel ¶
ContextFromStopChannel creates a new context from a given stop channel.
func Decode ¶
Decode takes a `decoder` and decodes the provided `data` into the provided object. The underlying `into` address is used to assign the decoded object.
func GetOrCreateShootKubeconfig ¶
func GetOrCreateShootKubeconfig(ctx context.Context, c client.Client, certificateConfig secrets.CertificateSecretConfig, namespace string) (*corev1.Secret, error)
GetOrCreateShootKubeconfig gets or creates a Kubeconfig for a Shoot cluster which has a running control plane in the given `namespace`. If the CA of an existing Kubeconfig has changed, it creates a new Kubeconfig. Newly generated Kubeconfigs are applied with the given `client` to the given `namespace`.
func NewChartRendererForShoot ¶
func NewChartRendererForShoot(version string) (chartrenderer.Interface, error)
NewChartRendererForShoot creates a new chartrenderer.Interface for the shoot cluster.
func NewClientForShoot ¶
func NewClientForShoot(ctx context.Context, c client.Client, namespace string, opts client.Options) (*rest.Config, client.Client, error)
NewClientForShoot returns the rest config and the client for the given shoot namespace.
func NewRESTConfigFromKubeconfig ¶
NewRESTConfigFromKubeconfig creates a new REST config from a given Kubeconfig and returns it.
func ObjectName ¶
ObjectName returns the name of the given object in the format <namespace>/<name>
func QuantityPtr ¶
QuantityPtr returns a Quatity pointer to its argument
func ScaleDeployment ¶
func ScaleDeployment(ctx context.Context, client client.Client, deployment *appsv1.Deployment, replicas int32) error
ScaleDeployment scales the given deployment.
func Use ¶ added in v1.2.0
func Use(_ ...interface{})
Use can be used to mark go elements as used to temporaryly avoid compiler errors due to unused elements.
func VersionInfo ¶
VersionInfo converts the given version string to version.Info (input must be a semantic version).
func VersionMajorMinor ¶
VersionMajorMinor extracts and returns the major and the minor part of the given version (input must be a semantic version).
Types ¶
type Chart ¶
type Chart interface { // Apply applies this chart in the given namespace using the given ChartApplier. Before applying the chart, // it collects its values, injecting images and merging the given values as needed. Apply(context.Context, gardenerkubernetes.ChartApplier, string, imagevector.ImageVector, string, string, map[string]interface{}) error // Render renders this chart in the given namespace using the given chartRenderer. Before rendering the chart, // it collects its values, injecting images and merging the given values as needed. Render(chartrenderer.Interface, string, imagevector.ImageVector, string, string, map[string]interface{}) (string, []byte, error) // Delete deletes this chart's objects from the given namespace. Delete(context.Context, client.Client, string) error }
Chart represents a Helm chart that can be applied and deleted.
type Secrets ¶
type Secrets interface { // Deploy generates and deploys the secrets into the given namespace, taking into account existing secrets. Deploy(context.Context, kubernetes.Interface, gardenerkubernetes.Interface, string) (map[string]*corev1.Secret, error) // Delete deletes the secrets from the given namespace. Delete(kubernetes.Interface, string) error }
Secrets represents a set of secrets that can be deployed and deleted.
type ShootClients ¶
type ShootClients interface { Client() client.Client Clientset() kubernetes.Interface GardenerClientset() gardenerkubernetes.Interface ChartApplier() gardener.ChartApplier Version() *version.Info }
ShootClients bundles together several clients for the shoot cluster.
func NewClientsForShoot ¶
func NewClientsForShoot(ctx context.Context, c client.Client, namespace string, opts client.Options) (ShootClients, error)
NewClientsForShoot is a utility function that creates a new clientset and a chart applier for the shoot cluster. It uses the 'gardener' secret in the given shoot namespace. It also returns the Kubernetes version of the cluster.
func NewShootClients ¶
func NewShootClients(c client.Client, clientset kubernetes.Interface, gardenerClientset gardenerkubernetes.Interface, chartApplier gardener.ChartApplier, version *version.Info) ShootClients
NewShootClients creates a new shoot client interface based on the given clients.