Documentation
¶
Index ¶
- Variables
- func ApplyBootstrapToken(ctx context.Context, kubeCli kubernetes.Interface, fieldManager string, ...) error
- func ApplyConfigMap(ctx context.Context, kubeCli kubernetes.Interface, ...) error
- func ApplyManifests(ctx context.Context, logger *slog.Logger, k8sClient client.Client, ...) error
- func ApplyManifestsInDirectory(ctx context.Context, logger *slog.Logger, k8sClient client.Client, ...) error
- func ApplySecret(ctx context.Context, kubeCli kubernetes.Interface, ...) error
- func CheckKubectlAvailable() error
- func ClientAndConfigFromFile(filePath string) (*kubernetes.Clientset, *rest.Config, error)
- func KubectlCmd(ctx context.Context, logger *slog.Logger, kubectl KubectlFunc, args ...string) error
- func SanitizeK8sName(raw string) string
- type BootstrapToken
- type KubectlFunc
Constants ¶
This section is empty.
Variables ¶
var ErrBootstrapTokenNotFound = errors.New("bootstrap token not found")
ErrBootstrapTokenNotFound is returned by GetBootstrapToken when no matching bootstrap token secret exists in the cluster.
Functions ¶
func ApplyBootstrapToken ¶
func ApplyBootstrapToken(ctx context.Context, kubeCli kubernetes.Interface, fieldManager string, token *BootstrapToken) error
func ApplyConfigMap ¶
func ApplyConfigMap(ctx context.Context, kubeCli kubernetes.Interface, s *v1.ConfigMapApplyConfiguration, opts metav1.ApplyOptions, ) error
func ApplyManifests ¶
func ApplyManifests(ctx context.Context, logger *slog.Logger, k8sClient client.Client, fieldManager string, data []byte) error
ApplyManifests decodes one or more YAML/JSON resources from data and applies each one to the cluster using server-side apply.
func ApplyManifestsInDirectory ¶
func ApplyManifestsInDirectory(ctx context.Context, logger *slog.Logger, k8sClient client.Client, fieldManager, manifestDir string, skipPaths []string) error
ApplyManifestsInDirectory walks manifestDir recursively and applies every .yaml/.yml file it finds using server-side apply via the controller-runtime client. Any file whose path relative to manifestDir appears in skipPaths is skipped.
func ApplySecret ¶
func ApplySecret(ctx context.Context, kubeCli kubernetes.Interface, s *v1.SecretApplyConfiguration, opts metav1.ApplyOptions, ) error
func CheckKubectlAvailable ¶
func CheckKubectlAvailable() error
func ClientAndConfigFromFile ¶
func KubectlCmd ¶
func SanitizeK8sName ¶
SanitizeK8sName converts a raw string into a valid Kubernetes object name. Kubernetes names must be lowercase RFC-1123 subdomains: lowercase alphanumeric characters, '-' or '.', must start and end with an alphanumeric character, and be at most 253 characters.
Types ¶
type BootstrapToken ¶
func GetBootstrapTokenForSite ¶
func GetBootstrapTokenForSite(ctx context.Context, kubeCli kubernetes.Interface, siteName string) (*BootstrapToken, error)
func NewBootstrapToken ¶
func NewBootstrapToken() (*BootstrapToken, error)
func (*BootstrapToken) String ¶
func (t *BootstrapToken) String() string
func (*BootstrapToken) WithLabel ¶
func (t *BootstrapToken) WithLabel(key, value string) *BootstrapToken