nsselect

package
v1.18.0-beta19 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChooseResource

func ChooseResource(typeName string, menuDescription string, nsr NsResourceMap) (core.ResourceRef, error)

func ChooseResources

func ChooseResources(typeName string, menuDescription string, nsr NsResourceMap) ([]*core.ResourceRef, error)

TODO(mitchdraft) merge with ChooseResource

func EnsureCommonResource

func EnsureCommonResource(typeName string, menuDescription string, resRef *core.ResourceRef, nsrm NsResourceMap, static bool) error

EnsureCommonResource validates a resRef relative to static vs. interactive mode If in interactive mode (non-static mode) and a resourceRef is not given, it will prompt the user to choose one This function works for multiple types of resources. Specify the resource type via typeName menuDescription - the string that the user will see when the prompt menu appears

func EnsureCommonResources

func EnsureCommonResources(typeName string, menuDescription string, resRefs *[]*core.ResourceRef, nsrm NsResourceMap, static bool) error

Static mode not supported ATM TODO(mitchdraft) integrate with static mode

Types

type NsResource

type NsResource struct {
	// keyed by namespace containing the CRD
	Secrets   []string
	Upstreams []string
}

NsResource contains lists of the resources needed by the cli associated* with given namespace. *the association is by the namespace in which the CRD is installed, unless otherwise noted.

type NsResourceMap

type NsResourceMap map[string]*NsResource

All the cli-relevant resources keyed by namespace

type ResMap

type ResMap map[string]ResSelect

type ResSelect

type ResSelect struct {
	// contains filtered or unexported fields
}

If we are selecting resources by their name and the namespace in which they are installed, displayName and displayNamespace are identical to the resourceRef. However, meshes are selected by the ns in which they were installed, so we need both representations NOTE: if we add select helper utils for other resources we should make a general "select by resource ref" util

Jump to

Keyboard shortcuts

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