specs

package
v0.92.1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadFromCLIArgs

func LoadFromCLIArgs(ctx context.Context, client kubernetes.Interface, args []string, vp *viper.Viper) (*loader.TroubleshootKinds, error)

LoadFromCLIArgs loads troubleshoot specs from args passed to a CLI command. This loader function is meant for troubleshoot CLI commands only, hence not making it public. It will contain opinionated logic for CLI commands such as interpreting viper flags, supporting secret/ uri format, downloading from OCI registry and other URLs, etc.

func LoadFromCluster

func LoadFromCluster(ctx context.Context, client kubernetes.Interface, selectors []string, ns string) (*loader.TroubleshootKinds, error)

LoadFromCluster loads troubleshoot specs from the cluster based on the provided labels. By default this will be troubleshoot.io/kind=support-bundle and troubleshoot.sh/kind=support-bundle labels. We search for secrets and configmaps with the label selector and extract the raw data. We then load the specs from the raw data. If the user does not have sufficient permissions to list & read secrets and configmaps from all namespaces, we will fallback to trying each namespace individually, and eventually default to the configured kubeconfig namespace.

func LoadFromConfigMap

func LoadFromConfigMap(ctx context.Context, client kubernetes.Interface, ns string, name string) (map[string]string, error)

func LoadFromConfigMapMatchingLabel

func LoadFromConfigMapMatchingLabel(ctx context.Context, client kubernetes.Interface, label string, ns string, key string) ([]string, error)

func LoadFromSecret

func LoadFromSecret(ctx context.Context, client kubernetes.Interface, ns string, name string) (map[string][]byte, error)

func LoadFromSecretMatchingLabel

func LoadFromSecretMatchingLabel(ctx context.Context, client kubernetes.Interface, label string, ns string, key string) ([]string, error)

func SplitTroubleshootSecretLabelSelector

func SplitTroubleshootSecretLabelSelector(ctx context.Context, labelSelector labels.Selector) ([]string, error)

SplitTroubleshootSecretLabelSelector splits a label selector into two selectors, if applicable: 1. troubleshoot.io/kind=support-bundle and non-troubleshoot (if contains) labels selector. 2. troubleshoot.sh/kind=support-bundle and non-troubleshoot (if contains) labels selector.

Types

This section is empty.

Jump to

Keyboard shortcuts

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