internal

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstructClusterResourceTree

func ConstructClusterResourceTree(defaultClient client.Client, dcOptions client.DescribeClusterOptions) (*ClusterResourceNode, *HTTPError)

Note: ObjectReferenceObjects do not have the virtual annotation so we can assume that all virtual objects are collapsible

func ConstructInClusterKubeconfig

func ConstructInClusterKubeconfig(restConfig *rest.Config, namespace string) (*clientcmdapi.Config, error)

func ConstructMultiClusterTree

func ConstructMultiClusterTree(ctrlClient ctrlclient.Client, k8sConfigClient *api.Config) (*MultiClusterTreeNode, *HTTPError)

ConstructMultiClusterTree returns a tree representing the workload cluster discovered in the management cluster.

func GetKubeadmClusterName

func GetKubeadmClusterName(restConfig *rest.Config, namespace string, name string) (string, error)

func WriteKubeconfigToFile

func WriteKubeconfigToFile(filePath string, clientConfig clientcmdapi.Config) error

Types

type ClusterResourceNode

type ClusterResourceNode struct {
	Name        string                 `json:"name"`
	Namespace   string                 `json:"namespace"`
	DisplayName string                 `json:"displayName"`
	Kind        string                 `json:"kind"`
	Group       string                 `json:"group"`
	Version     string                 `json:"version"`
	Provider    string                 `json:"provider"`
	UID         string                 `json:"uid"`
	Collapsible bool                   `json:"collapsible"`
	Collapsed   bool                   `json:"collapsed"`
	Ready       bool                   `json:"ready"`
	Severity    string                 `json:"severity"`
	HasReady    bool                   `json:"hasReady"`
	Children    []*ClusterResourceNode `json:"children"`
}

type ClusterResourceTreeOptions

type ClusterResourceTreeOptions struct {
	GroupMachines                bool
	AddControlPlaneVirtualNode   bool
	KindsToCollapse              map[string]struct{}
	VNodesToInheritChildProvider map[string]struct{}
}

type HTTPError

type HTTPError struct {
	Status  int
	Message string
}

func GetCustomResource

func GetCustomResource(runtimeClient ctrlclient.Client, kind string, apiVersion string, namespace string, name string) (*unstructured.Unstructured, *HTTPError)

func NewInternalError

func NewInternalError(err error) *HTTPError

func (*HTTPError) Error

func (e *HTTPError) Error() string

type MultiClusterTreeNode

type MultiClusterTreeNode struct {
	Name                   string                  `json:"name"`
	Namespace              string                  `json:"namespace"`
	InfrastructureProvider string                  `json:"infrastructureProvider"`
	IsManagement           bool                    `json:"isManagement"`
	Phase                  string                  `json:"phase"`
	Ready                  bool                    `json:"ready"`
	Children               []*MultiClusterTreeNode `json:"children"`
}

Jump to

Keyboard shortcuts

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