Documentation ¶
Index ¶
- func ChooseResource(typeName string, menuDescription string, nsr NsResourceMap) (core.ResourceRef, error)
- func ChooseResources(typeName string, menuDescription string, nsr NsResourceMap) ([]*core.ResourceRef, error)
- func EnsureCommonResource(typeName string, menuDescription string, resRef *core.ResourceRef, ...) error
- func EnsureCommonResources(typeName string, menuDescription string, resRefs *[]*core.ResourceRef, ...) error
- type NsResource
- type NsResourceMap
- type ResMap
- type ResSelect
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 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