cmd

package
v0.5.1-0...-8987e2d Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JsonOutput = "json"
	YamlOutput = "yaml"
)

Variables

View Source
var (
	// DefaultDockerRegistry specifies the default location for Linkerd's images.
	DefaultDockerRegistry = "cr.l5d.io/linkerd"
)

Functions

func ConfigureKubeContextFlagCompletion

func ConfigureKubeContextFlagCompletion(cmd *cobra.Command, kubeconfigPath string)

ConfigureKubeContextFlagCompletion sets up resource-aware completion for command flags based off of a kubeconfig

func ConfigureNamespaceFlagCompletion

func ConfigureNamespaceFlagCompletion(
	cmd *cobra.Command,
	flagNames []string,
	kubeconfigPath string,
	impersonate string,
	impersonateGroup []string,
	kubeContext string,
)

ConfigureNamespaceFlagCompletion sets up resource-aware completion for command flags that accept a namespace name

func ConfigureOutputFlagCompletion

func ConfigureOutputFlagCompletion(cmd *cobra.Command)

ConfigureOutputFlagCompletion sets up resource-aware completion for command flags that accept an output name.

func GetDefaultNamespace

func GetDefaultNamespace(kubeconfigPath, kubeContext string) string

GetDefaultNamespace fetches the default namespace used in the current KubeConfig context

func GetLabelSelector

func GetLabelSelector(labelKey string, labelValues ...string) (string, error)

GetLabelSelector creates a label selector as a string based on a label key whose value may be in the set provided as an argument to the function. If the value set is empty then the selector will match resources where the label key exists regardless of value.

func Prune

func Prune(ctx context.Context, k8sAPI *k8s.KubernetesAPI, expectedManifests string, selector string, format string) error

Prune takes an install manifest and prints all resources on the cluster which match the given label selector but are not in the given manifest. Users are expected to pipe these resources to `kubectl delete` to clean up resources left on the cluster which are no longer part of the install manifest.

func RegistryOverride

func RegistryOverride(image, newRegistry string) string

RegistryOverride replaces the registry-portion of the provided image with the provided registry.

func RenderYAMLAs

func RenderYAMLAs(buf *bytes.Buffer, writer io.Writer, format string) error

Given a buffer containing one or more YAML documents separated by `---`, render each document to the writer in the specified format: json or yaml. Json documents are separated by a newline character.

func Uninstall

func Uninstall(ctx context.Context, k8sAPI *k8s.KubernetesAPI, selector string, format string) error

Uninstall prints all cluster-scoped resources matching the given selector for the purposes of deleting them.

Types

This section is empty.

Jump to

Keyboard shortcuts

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