clusterpoolhost

package
v1.0.15 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2022 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Overview

Copyright Contributors to the Open Cluster Management project

Copyright Contributors to the Open Cluster Management project

Index

Constants

View Source
const (
	KubeConfigIgnoredMessage = "WARNING: KUBECONFIG is set and is being ignored by context name=%s\n"
	KubeConfigSwitchMessage  = "Switching to context %s\n"
)
View Source
const (
	ClusterPoolHostContextPrefix string = "clusterpoolhost"
)
View Source
const ClusterPoolHostsDir = ".kube"
View Source
const (
	DefaultNamespace string = "default"
)
View Source
const ServiceAccountNameSpace = "default"

Variables

This section is empty.

Functions

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 FuncMap

func FuncMap() template.FuncMap

ApplierFuncMap adds the function map

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

func GetCurrentRestConfig() (*rest.Config, error)

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

func GetGlobalCurrentRestConfig() (*rest.Config, error)

GetGlobalCurrentRestConfig gets the *rest.Config of the current context in the global file.

func GetUser

func GetUser(f cmdutil.Factory) (string, error)

func IsClusterPoolHost

func IsClusterPoolHost(contextName string) (bool, error)

IsClusterPoolHost checks if the provided context name is a clusterpoolhost context

func IsContext

func IsContext(contextName string) (bool, error)

IsContext check if the context is in the file specified by the env var if set otherwise the global file

func IsGlobalContext

func IsGlobalContext(contextName string) (bool, error)

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 NormalizeName(name string) string

func OpenClusterPoolHost

func OpenClusterPoolHost(consoleUrl string) error

OpenClusterPoolHost opens a browzer on the clusterpoolhost console

func WhoAmI

func WhoAmI(restConfig *rest.Config) (*userv1.User, error)

WhoAmI returns the current user

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 (cph *ClusterPoolHost) CreateClusterPool(clusterPoolName, cloud string, values map[string]interface{}, dryRun bool, outputFile string) error

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 (cph *ClusterPoolHost) GetClusterPoolConfig(clusterPoolName string, withoutCredentials bool, beta bool, outputFile string) error

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

type ErrorType

type ErrorType string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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