Documentation
¶
Overview ¶
Copyright Contributors to the Open Cluster Management project
Copyright Contributors to the Open Cluster Management project ¶
Copyright Contributors to the Open Cluster Management project ¶
Copyright Contributors to the Open Cluster Management project ¶
Copyright Contributors to the Open Cluster Management project ¶
Copyright Contributors to the Open Cluster Management project ¶
Copyright Contributors to the Open Cluster Management project
Index ¶
- Constants
- func ConvertToPrintClusterPoolHostList(cphs *ClusterPoolHosts) *printclusterpoolv1alpha1.PrintClusterPoolHostList
- func CreateClusterClaimContext(configAPI *clientcmdapi.Config, token, contextName, user string, ...) error
- func CreateContextFronConfigAPI(configAPI *clientcmdapi.Config, ...) error
- func FuncMap() template.FuncMap
- func GenericFuncMap() map[string]interface{}
- func GetConfigAPI() (*clientcmdapi.Config, bool, error)
- func GetCurrentRestConfig() (*rest.Config, error)
- func GetGlobalConfigAPI() (*clientcmdapi.Config, bool, error)
- func GetGlobalCurrentRestConfig() (*rest.Config, error)
- func GetUser(f cmdutil.Factory) (string, error)
- func IsClusterPoolHost(contextName string) (bool, error)
- func IsContext(contextName string) (bool, error)
- func IsGlobalContext(contextName string) (bool, error)
- func IsSupported(cmFlags *genericclioptions.CMFlags) (isSupported bool, err error)
- func MoveContextToDefault(...) error
- func NormalizeName(name string) string
- func OpenClusterPoolHost(consoleUrl string) error
- func WhoAmI(restConfig *rest.Config) (*userv1.User, error)
- type ClusterPoolHost
- func (c *ClusterPoolHost) AddClusterPoolHost() error
- func (cph *ClusterPoolHost) ConvertToPrintClusterClaimList(ccl *hivev1.ClusterClaimList, current bool) *printclusterpoolv1alpha1.PrintClusterClaimList
- func (cph *ClusterPoolHost) ConvertToPrintClusterPoolList(cpl *hivev1.ClusterPoolList, specificClusterPool string) (*printclusterpoolv1alpha1.PrintClusterPoolList, error)
- func (cph *ClusterPoolHost) CreateClusterClaims(clusterClaimNames, clusterPoolName string, autoImport bool, timeout int, ...) error
- func (cph *ClusterPoolHost) CreateClusterPool(clusterPoolName, cloud string, values map[string]interface{}, dryRun bool, ...) error
- func (cph *ClusterPoolHost) CreateClusterPoolContext(token, serviceAccountName string, inGlobal bool) error
- func (cph *ClusterPoolHost) DeleteClusterClaims(clusterClaimNames string, dryRun bool) error
- func (c *ClusterPoolHost) DeleteClusterPoolHost() error
- func (cph *ClusterPoolHost) DeleteClusterPools(clusterPoolNames string, dryRun bool, outputFile string) error
- func (cph *ClusterPoolHost) GetClusterClaim(clusterName string, waitRunning bool, timeout int, dryRun bool, ...) (*hivev1.ClusterClaim, error)
- func (cph *ClusterPoolHost) GetClusterClaims(dryRun bool) (*hivev1.ClusterClaimList, error)
- func (cph *ClusterPoolHost) GetClusterContextName(clusterName string) string
- func (cph *ClusterPoolHost) GetClusterDeployment(cc *hivev1.ClusterClaim) (*hivev1.ClusterDeployment, error)
- func (cph *ClusterPoolHost) GetClusterPoolConfig(clusterPoolName string, withoutCredentials bool, beta bool, outputFile string) error
- func (cph *ClusterPoolHost) GetClusterPools(showCphName, dryRun bool) (*hivev1.ClusterPoolList, error)
- func (c *ClusterPoolHost) GetContextName() string
- func (cph *ClusterPoolHost) GetGlobalRestConfig() (*rest.Config, error)
- func (cph *ClusterPoolHost) GetPrintClusterClaimCredential(cc *hivev1.ClusterClaim, withCredentials bool) (*printclusterpoolv1alpha1.PrintClusterClaimCredential, error)
- func (cph *ClusterPoolHost) GetRestConfig() (*rest.Config, error)
- func (cph *ClusterPoolHost) HibernateClusterClaims(clusterClaimNames string, scheduleSkip string, dryRun bool) error
- func (c *ClusterPoolHost) IsActive() bool
- func (cph *ClusterPoolHost) OpenClusterClaim(clusterName string, timeout int, printFlags *get.PrintFlags) error
- func (cph *ClusterPoolHost) PrintClusterClaimCred(cc *hivev1.ClusterClaim, printFlags *get.PrintFlags, withCredentials bool) error
- func (cph *ClusterPoolHost) RunClusterClaims(clusterClaimNames string, scheduleSkip string, timeout int, dryRun bool, ...) error
- func (cph *ClusterPoolHost) SetClusterClaimContext(clusterName string, setAsCurrent bool, timeout int, dryRun bool, ...) error
- func (cph *ClusterPoolHost) SetHibernateScheduleClusterClaims(clusterClaimNames string, scheduleSkip string, dryRun bool) error
- func (cph *ClusterPoolHost) SizeClusterPool(clusterPoolName string, size int32, dryRun bool) error
- func (cph *ClusterPoolHost) VerifyClusterPoolContext(dryRun bool, outputFile string) error
- type ClusterPoolHosts
- func (cs *ClusterPoolHosts) ApplyClusterPoolHosts() error
- func (cs *ClusterPoolHosts) GetClusterPoolHost(name string) (*ClusterPoolHost, error)
- func (cs *ClusterPoolHosts) GetCurrentClusterPoolHost() (*ClusterPoolHost, error)
- func (cs *ClusterPoolHosts) SetActive(c *ClusterPoolHost) error
- func (cs *ClusterPoolHosts) UnActiveAll() error
- type ErrorType
Constants ¶
const ( KubeConfigIgnoredMessage = "WARNING: KUBECONFIG is set and is being ignored by context name=%s\n" KubeConfigSwitchMessage = "Switching to context %s\n" )
const (
ClusterPoolHostContextPrefix string = "clusterpoolhost"
)
const ClusterPoolHostsDir = ".kube"
const (
DefaultNamespace string = "default"
)
const ServiceAccountNameSpace = "default"
Variables ¶
This section is empty.
Functions ¶
func ConvertToPrintClusterPoolHostList ¶
func ConvertToPrintClusterPoolHostList(cphs *ClusterPoolHosts) *printclusterpoolv1alpha1.PrintClusterPoolHostList
func CreateClusterClaimContext ¶
func CreateClusterClaimContext(configAPI *clientcmdapi.Config, token, contextName, user string, setAsCurrent bool) error
func CreateContextFronConfigAPI ¶
func CreateContextFronConfigAPI(configAPI *clientcmdapi.Config, token, contextName, defaultNamespace, user string, setAsCurrent bool) error
CreateContextFronConfigAPI creates a new context in the global file
func GenericFuncMap ¶
func GenericFuncMap() map[string]interface{}
GenericFuncMap returns a copy of the basic function map as a map[string]interface{}.
func GetConfigAPI ¶
func GetConfigAPI() (*clientcmdapi.Config, bool, error)
GetConfigAPI returns the ConfigAPI and if the KUBECONFIG was set.
func GetCurrentRestConfig ¶
GetCurrentRestConfig gets the *rest.Config of the current context in the file specified by the env var if set.
func GetGlobalConfigAPI ¶
func GetGlobalConfigAPI() (*clientcmdapi.Config, bool, error)
GetGlobalConfigAPI returns the Global ConfigAPI without taking into account the KUBECONFIG envVar.
func GetGlobalCurrentRestConfig ¶
GetGlobalCurrentRestConfig gets the *rest.Config of the current context in the global file.
func IsClusterPoolHost ¶
IsClusterPoolHost checks if the provided context name is a clusterpoolhost context
func IsContext ¶
IsContext check if the context is in the file specified by the env var if set otherwise the global file
func IsGlobalContext ¶
IsGlobalContext checks if the context is in the global file
func IsSupported ¶
func IsSupported(cmFlags *genericclioptions.CMFlags) (isSupported bool, err error)
func MoveContextToDefault ¶
func MoveContextToDefault(currentContextName, clusterPoolContextName, defaultNamespace, user, token string) error
MoveContextToDefault Move the context from its current location to the global file.
func NormalizeName ¶
func OpenClusterPoolHost ¶
OpenClusterPoolHost opens a browzer on the clusterpoolhost console
Types ¶
type ClusterPoolHost ¶
type ClusterPoolHost struct { // Name of the cluster pool Name string `json:"name"` // true if this cluster pool is the Active one Active bool `json:"active"` // The API address of the cluster where your `ClusterPools` are defined. Also referred to as the "ClusterPool host" APIServer string `json:"apiServer"` // The URL of the OpenShift console for the ClusterPool host Console string `json:"console"` // Namespace where `ClusterPools` are defined Namespace string `json:"namespace"` // Name of a `Group` (`user.openshift.io/v1`) that should be added to each `ClusterClaim` for team access Group string `json:"group"` //ServerNamespace namespace where RHACM or MCE is installed ServerNamespace string `json:"serverNamespace"` }
func GetClusterPoolHost ¶
func GetClusterPoolHost(clusterPoolHostName string) (*ClusterPoolHost, error)
GetClusterPoolHost returns the clusterpoolhost corresponding to the provided name
func GetClusterPoolHostOrCurrent ¶
func GetClusterPoolHostOrCurrent(name string) (*ClusterPoolHost, error)
GetClusterPoolHostOrCurrent returns the clusterpoolhost and if
func GetCurrentClusterPoolHost ¶
func GetCurrentClusterPoolHost() (*ClusterPoolHost, error)
GetCurrentClusterPoolHost gets the current active clusterpoolhost
func (*ClusterPoolHost) AddClusterPoolHost ¶
func (c *ClusterPoolHost) AddClusterPoolHost() error
AddClusterPoolHost adds a clusterpoolhost
func (*ClusterPoolHost) ConvertToPrintClusterClaimList ¶
func (cph *ClusterPoolHost) ConvertToPrintClusterClaimList(ccl *hivev1.ClusterClaimList, current bool) *printclusterpoolv1alpha1.PrintClusterClaimList
func (*ClusterPoolHost) ConvertToPrintClusterPoolList ¶
func (cph *ClusterPoolHost) ConvertToPrintClusterPoolList(cpl *hivev1.ClusterPoolList, specificClusterPool string) (*printclusterpoolv1alpha1.PrintClusterPoolList, error)
func (*ClusterPoolHost) CreateClusterClaims ¶
func (cph *ClusterPoolHost) CreateClusterClaims(clusterClaimNames, clusterPoolName string, autoImport bool, timeout int, dryRun bool, outputFile string, printFlags *get.PrintFlags) error
func (*ClusterPoolHost) CreateClusterPool ¶
func (*ClusterPoolHost) CreateClusterPoolContext ¶
func (cph *ClusterPoolHost) CreateClusterPoolContext(token, serviceAccountName string, inGlobal bool) error
func (*ClusterPoolHost) DeleteClusterClaims ¶
func (cph *ClusterPoolHost) DeleteClusterClaims(clusterClaimNames string, dryRun bool) error
func (*ClusterPoolHost) DeleteClusterPoolHost ¶
func (c *ClusterPoolHost) DeleteClusterPoolHost() error
DeleteClusterPoolHost deletes a clusterpoolhost
func (*ClusterPoolHost) DeleteClusterPools ¶
func (cph *ClusterPoolHost) DeleteClusterPools(clusterPoolNames string, dryRun bool, outputFile string) error
func (*ClusterPoolHost) GetClusterClaim ¶
func (cph *ClusterPoolHost) GetClusterClaim(clusterName string, waitRunning bool, timeout int, dryRun bool, printFlags *get.PrintFlags) (*hivev1.ClusterClaim, error)
func (*ClusterPoolHost) GetClusterClaims ¶
func (cph *ClusterPoolHost) GetClusterClaims(dryRun bool) (*hivev1.ClusterClaimList, error)
func (*ClusterPoolHost) GetClusterContextName ¶
func (cph *ClusterPoolHost) GetClusterContextName(clusterName string) string
func (*ClusterPoolHost) GetClusterDeployment ¶ added in v1.0.9
func (cph *ClusterPoolHost) GetClusterDeployment(cc *hivev1.ClusterClaim) (*hivev1.ClusterDeployment, error)
func (*ClusterPoolHost) GetClusterPoolConfig ¶
func (*ClusterPoolHost) GetClusterPools ¶
func (cph *ClusterPoolHost) GetClusterPools(showCphName, dryRun bool) (*hivev1.ClusterPoolList, error)
func (*ClusterPoolHost) GetContextName ¶
func (c *ClusterPoolHost) GetContextName() string
GetContextName returns the context name for a given clusterpoolhost
func (*ClusterPoolHost) GetGlobalRestConfig ¶
func (cph *ClusterPoolHost) GetGlobalRestConfig() (*rest.Config, error)
GetGlobalRestConfig gets the *rest.Config of the current context in the global file.
func (*ClusterPoolHost) GetPrintClusterClaimCredential ¶
func (cph *ClusterPoolHost) GetPrintClusterClaimCredential(cc *hivev1.ClusterClaim, withCredentials bool) (*printclusterpoolv1alpha1.PrintClusterClaimCredential, error)
func (*ClusterPoolHost) GetRestConfig ¶
func (cph *ClusterPoolHost) GetRestConfig() (*rest.Config, error)
GetRestConfig gest the *rest.Config of the current context in the file specified by the env var if set.
func (*ClusterPoolHost) HibernateClusterClaims ¶
func (cph *ClusterPoolHost) HibernateClusterClaims(clusterClaimNames string, scheduleSkip string, dryRun bool) error
func (*ClusterPoolHost) IsActive ¶
func (c *ClusterPoolHost) IsActive() bool
IsActive checks if clusterpoolhost is active
func (*ClusterPoolHost) OpenClusterClaim ¶
func (cph *ClusterPoolHost) OpenClusterClaim(clusterName string, timeout int, printFlags *get.PrintFlags) error
func (*ClusterPoolHost) PrintClusterClaimCred ¶
func (cph *ClusterPoolHost) PrintClusterClaimCred(cc *hivev1.ClusterClaim, printFlags *get.PrintFlags, withCredentials bool) error
func (*ClusterPoolHost) RunClusterClaims ¶
func (cph *ClusterPoolHost) RunClusterClaims(clusterClaimNames string, scheduleSkip string, timeout int, dryRun bool, outputFile string, printFlags *get.PrintFlags) error
func (*ClusterPoolHost) SetClusterClaimContext ¶
func (cph *ClusterPoolHost) SetClusterClaimContext( clusterName string, setAsCurrent bool, timeout int, dryRun bool, outputFile string, printFlags *get.PrintFlags) error
func (*ClusterPoolHost) SetHibernateScheduleClusterClaims ¶ added in v1.0.10
func (cph *ClusterPoolHost) SetHibernateScheduleClusterClaims(clusterClaimNames string, scheduleSkip string, dryRun bool) error
func (*ClusterPoolHost) SizeClusterPool ¶
func (cph *ClusterPoolHost) SizeClusterPool(clusterPoolName string, size int32, dryRun bool) error
func (*ClusterPoolHost) VerifyClusterPoolContext ¶
func (cph *ClusterPoolHost) VerifyClusterPoolContext( dryRun bool, outputFile string) error
type ClusterPoolHosts ¶
type ClusterPoolHosts struct {
ClusterPoolHosts map[string]*ClusterPoolHost `json:"clusters"`
}
func GetClusterPoolHosts ¶
func GetClusterPoolHosts() (*ClusterPoolHosts, error)
GetClusterPoolHosts returns all clusterpoolhosts
func (*ClusterPoolHosts) ApplyClusterPoolHosts ¶
func (cs *ClusterPoolHosts) ApplyClusterPoolHosts() error
ApplyClusterPoolHosts saves the list of clusterpoolhost
func (*ClusterPoolHosts) GetClusterPoolHost ¶
func (cs *ClusterPoolHosts) GetClusterPoolHost(name string) (*ClusterPoolHost, error)
GetClusterPoolHost returns the clusterpoolhost
func (*ClusterPoolHosts) GetCurrentClusterPoolHost ¶
func (cs *ClusterPoolHosts) GetCurrentClusterPoolHost() (*ClusterPoolHost, error)
GetCurrentClusterPoolHost gets the current clusterpoolhost
func (*ClusterPoolHosts) SetActive ¶
func (cs *ClusterPoolHosts) SetActive(c *ClusterPoolHost) error
SetActive actives a specific clusterpoolhost
func (*ClusterPoolHosts) UnActiveAll ¶
func (cs *ClusterPoolHosts) UnActiveAll() error
UnActiveAll unactives all clusterpoolhosts