api

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2020 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// KubeConfig represents kubeconfig
	KubeConfig *clientcmdapi.Config
	// SrcRESTMapper is Source REST Mapper
	SrcRESTMapper meta.RESTMapper
	// DstRESTMapper is destination REST Mapper
	DstRESTMapper meta.RESTMapper
	// ClusterNames contains names of contexts and cluster
	ClusterNames = make(map[string]string)
	// CtrlClient k8s controller client for migration cluster
	CtrlClient client.Client
	// K8sSrcClient k8s api client for source cluster
	K8sSrcClient *kubernetes.Clientset
	// K8sSrcDynClient k8s api client for source cluster
	K8sSrcDynClient dynamic.Interface
	// K8sDstClient k8s api client for target cluster
	K8sDstClient *kubernetes.Clientset
)

Functions

func CreateCtrlClient

func CreateCtrlClient(contextCluster string) error

CreateCtrlClient creates a k8s runtime-controller client for given context

func CreateK8sDstClient

func CreateK8sDstClient(contextCluster string) error

CreateK8sDstClient create api client using cluster from kubeconfig context

func CreateK8sSrcClient

func CreateK8sSrcClient(contextCluster string) error

CreateK8sSrcClient create api client using cluster from kubeconfig context

func CreateK8sSrcDynClient

func CreateK8sSrcDynClient(contextCluster string) error

CreateK8sSrcDynClient create api client using cluster from kubeconfig context

func GetKindsFor

func GetKindsFor(restMapper meta.RESTMapper, resource string) []schema.GroupVersionKind

GetKindsFor lists all GVKs for a resource

func GetMigCluster

func GetMigCluster(client ctrlclient.Client, name string) migv1alpha1.MigCluster

GetMigCluster get MigrationCluster

func GetMigPlan

func GetMigPlan(client ctrlclient.Client, name string) (migv1alpha1.MigPlan, error)

GetMigPlan get MigrationPlan

func GetNamespace

func GetNamespace(client *kubernetes.Clientset, name string) *corev1.Namespace

GetNamespace get namespace

func ListDaemonSets

func ListDaemonSets(client *kubernetes.Clientset, namespace string) *extv1beta1.DaemonSetList

ListDaemonSets will collect all DS from specific namespace

func ListDeployments

func ListDeployments(client *kubernetes.Clientset, namespace string) *v1beta1.DeploymentList

ListDeployments will list all deployments seeding in the selected namespace

func ListGroupVersions

func ListGroupVersions(client *kubernetes.Clientset) *metav1.APIGroupList

ListGroupVersions list all GV

func ListHPAv1

ListHPAv1 gets Horizontal Pod Autoscaler v1 objects

func ListHPAv2beta1

func ListHPAv2beta1(client *kubernetes.Clientset, namespace string) *autoscalingv2beta1.HorizontalPodAutoscalerList

ListHPAv2beta1 gets Horizontal Pod Autoscaler v2beta1 objects

func ListHPAv2beta2

func ListHPAv2beta2(client *kubernetes.Clientset, namespace string) *autoscalingv2beta2.HorizontalPodAutoscalerList

ListHPAv2beta2 gets Horizontal Pod Autoscaler v2beta2 objects

func ListNamespaces

func ListNamespaces(client *kubernetes.Clientset, ch chan<- *corev1.NamespaceList)

ListNamespaces list all namespaces, wrapper around client-go

func ListNodes

func ListNodes(client *kubernetes.Clientset, ch chan<- *corev1.NodeList)

ListNodes list all nodes, wrapper around client-go

func ListPVCs

func ListPVCs(client *kubernetes.Clientset, namespace string) *corev1.PersistentVolumeClaimList

ListPVCs list all PVs, wrapper around client-go

func ListPVs

func ListPVs(client *kubernetes.Clientset, ch chan<- *corev1.PersistentVolumeList)

ListPVs list all PVs, wrapper around client-go

func ListPods

func ListPods(client *kubernetes.Clientset, namespace string) *corev1.PodList

ListPods list all pods in namespace, wrapper around client-go

func ListResourceQuotas

func ListResourceQuotas(client *kubernetes.Clientset, namespace string) *corev1.ResourceQuotaList

ListResourceQuotas list all quotas classes, wrapper around client-go

func ListServerResources

func ListServerResources(client *kubernetes.Clientset) []*metav1.APIResourceList

ListServerResources list all resources

func ListSrvResForGV

func ListSrvResForGV(gv string)

func ListStorageClasses

func ListStorageClasses(client *kubernetes.Clientset, ch chan<- *storagev1.StorageClassList)

ListStorageClasses list all storage classes, wrapper around client-go

func NewCtrlClientorDie

func NewCtrlClientorDie(config *rest.Config, options client.Options) client.Client

NewCtrlClientorDie gets a controller client or die

func NewK8SDynClientOrDie

func NewK8SDynClientOrDie(config *rest.Config) dynamic.Interface

NewK8SDynClientOrDie init k8s client or panic

func NewK8SOrDie

func NewK8SOrDie(config *rest.Config) *kubernetes.Clientset

NewK8SOrDie init k8s client or panic

func ParseKubeConfig

func ParseKubeConfig() error

ParseKubeConfig parse kubeconfig

func RESTMapperGetGRs

func RESTMapperGetGRs(client *kubernetes.Clientset) meta.RESTMapper

RESTMapperGetGRs lists all GVKs for a resource

Types

type NamespaceResources

type NamespaceResources struct {
	Namespace *corev1.Namespace
}

NamespaceResources holds all resources that belong to a namespace

type OpenshiftClient

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

OpenshiftClient - Client to interact with openshift api

func NewO7tOrDie

func NewO7tOrDie(config *rest.Config) *OpenshiftClient

NewO7tOrDie - Create a new openshift client if needed, returns reference

type Resources

type Resources struct {
	NamespaceResources *NamespaceResources
	SrcOnlyGVKs        map[string]map[string][]schema.GroupVersionKind
	SrcGapGVKs         map[string]map[string][]schema.GroupVersionKind
	DstGapGVKs         map[string]map[string][]schema.GroupVersionKind
}

Resources represent api resources used in report

Jump to

Keyboard shortcuts

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