util

package
v1.0.0-2021-10-07-22-5... Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2021 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const BMATemplate = `` /* 402-byte string literal not displayed */
View Source
const ManagedClusterActionCreateTemplate = `` /* 1186-byte string literal not displayed */

ManagedClusterActionCreateTemplate is json template for create action

View Source
const ManagedClusterActionDeleteTemplate = `` /* 419-byte string literal not displayed */

ManagedClusterActionDeleteTemplate is json template for delete action

View Source
const ManagedClusterActionUpdateTemplate = `` /* 1184-byte string literal not displayed */

ManagedClusterActionUpdateTemplate is json template for update action

View Source
const ManagedClusterViewTemplate = `` /* 408-byte string literal not displayed */

ManagedClusterViewTemplate is json template for namespace

Variables

View Source
var ClusterInfoGVR = schema.GroupVersionResource{
	Group:    "internal.open-cluster-management.io",
	Version:  "v1beta1",
	Resource: "managedclusterinfos",
}
View Source
var ManagedClusterGVR schema.GroupVersionResource = schema.GroupVersionResource{
	Group:    "cluster.open-cluster-management.io",
	Version:  "v1",
	Resource: "managedclusters",
}
View Source
var ManagedClusterSetGVR = schema.GroupVersionResource{
	Group:    "cluster.open-cluster-management.io",
	Version:  "v1beta1",
	Resource: "managedclustersets",
}

Functions

func AcceptManagedCluster

func AcceptManagedCluster(hubClient kubernetes.Interface, clusterClient clusterclient.Interface, clusterName string) error

func CheckClusterID

func CheckClusterID(obj *unstructured.Unstructured) error

func CheckDistributionInfo

func CheckDistributionInfo(obj *unstructured.Unstructured) error

func CheckJoinedManagedCluster

func CheckJoinedManagedCluster(client clusterclient.Interface, clusterName string) error

func CheckNodeList

func CheckNodeList(obj *unstructured.Unstructured) error

func ClaimCluster

func ClaimCluster(hiveClient hiveclient.Interface, cdName, cdNs, claimName string) error

func CleanManagedCluster

func CleanManagedCluster(client clusterclient.Interface, clusterName string) error

func CreateClusterClaim

func CreateClusterClaim(hiveClient hiveclient.Interface, name, namespace, clusterPool string) error

func CreateClusterDeployment

func CreateClusterDeployment(hiveClient hiveclient.Interface, name, namespace, clusterPoolName, clusterPoolNamespace string) error

func CreateClusterPool

func CreateClusterPool(hiveClient hiveclient.Interface, name, namespace string, labels map[string]string) error

func CreateClusterRole

func CreateClusterRole(kubeClient kubernetes.Interface, name string, rules []rbacv1.PolicyRule) error

func CreateClusterRoleBinding

func CreateClusterRoleBinding(kubeClient kubernetes.Interface, name, clusterRole, user string) error

func CreateClusterRoleBindingForUser

func CreateClusterRoleBindingForUser(kubeClient kubernetes.Interface, name, clusterRole, user string) error

func CreateFakeRootCaConfigMap

func CreateFakeRootCaConfigMap(kubeClient kubernetes.Interface, name, namespace string) (*corev1.ConfigMap, error)

func CreateFakeTlsSecret

func CreateFakeTlsSecret(kubeClient kubernetes.Interface, name, namespace string) (*corev1.Secret, error)

func CreateImageRegistry

func CreateImageRegistry(dynamicClient dynamic.Interface, namespace, name, placement, pullSecret, registry string) error

func CreateManagedCluster

func CreateManagedCluster(client clusterclient.Interface, cluster *clusterv1.ManagedCluster) error

func CreateManagedClusterSet

func CreateManagedClusterSet(client clusterclient.Interface, name string) error

func CreateManagedClusterSetBinding

func CreateManagedClusterSetBinding(client clusterclient.Interface, namespace, name, clusterSetName string) error

func CreateNamespace

func CreateNamespace(name string) error

func CreatePlacement

func CreatePlacement(client clusterclient.Interface, namespace, name string, clusterSets []string, selectedLabels map[string]string) error

func CreatePullSecret

func CreatePullSecret(kubeClient kubernetes.Interface, namespace, name string) error

func DeleteClusterResource

func DeleteClusterResource(dynamicClient dynamic.Interface, gvr schema.GroupVersionResource, name string) error

func DeleteClusterRole

func DeleteClusterRole(kubeClient kubernetes.Interface, name string) error

func DeleteClusterRoleBinding

func DeleteClusterRoleBinding(kubeClient kubernetes.Interface, name string) error

func DeleteImageRegistry

func DeleteImageRegistry(dynamicClient dynamic.Interface, namespace, name string) error

func DeleteManagedClusterSet

func DeleteManagedClusterSet(client clusterclient.Interface, name string) error

func DeleteManagedClusterSetBinding

func DeleteManagedClusterSetBinding(client clusterclient.Interface, namespace, name string) error

func DeleteNamespace

func DeleteNamespace(name string) error

func DeletePlacement

func DeletePlacement(client clusterclient.Interface, namespace, name string) error

func DeleteResource

func DeleteResource(dynamicClient dynamic.Interface, gvr schema.GroupVersionResource, namespace, name string) error

func GetClusterResource

func GetClusterResource(dynamicClient dynamic.Interface, gvr schema.GroupVersionResource, name string) (*unstructured.Unstructured, error)

func GetConditionFromStatus

func GetConditionFromStatus(obj *unstructured.Unstructured) (map[string]interface{}, error)

func GetConditionTypeFromStatus

func GetConditionTypeFromStatus(obj *unstructured.Unstructured, typeName string) bool

func GetImageRegistry

func GetImageRegistry(dynamicClient dynamic.Interface, namespace, name string) (*unstructured.Unstructured, error)

func GetResource

func GetResource(dynamicClient dynamic.Interface, gvr schema.GroupVersionResource, namespace, name string) (*unstructured.Unstructured, error)

func HasClusterResource

func HasClusterResource(dynamicClient dynamic.Interface, gvr schema.GroupVersionResource, name string) (bool, error)

func HasResource

func HasResource(dynamicClient dynamic.Interface, gvr schema.GroupVersionResource, namespace, name string) (bool, error)

func ImportManagedCluster

func ImportManagedCluster(client clusterclient.Interface, clusterName string) error

func IsOCP

func IsOCP(obj *unstructured.Unstructured) (bool, error)

Check if the current cluster is ocp by managedclusterinfo

func ListResource

func ListResource(dynamicClient dynamic.Interface, gvr schema.GroupVersionResource, namespace, labelSelector string) ([]*unstructured.Unstructured, error)

func LoadResourceFromJSON

func LoadResourceFromJSON(json string) (*unstructured.Unstructured, error)

func NewClusterClient

func NewClusterClient() (clusterclient.Interface, error)

func NewClusterClientWithImpersonate

func NewClusterClientWithImpersonate(user string, groups []string) (clusterclient.Interface, error)

func NewDynamicClient

func NewDynamicClient() (dynamic.Interface, error)

func NewDynamicClientWithImpersonate

func NewDynamicClientWithImpersonate(user string, groups []string) (dynamic.Interface, error)

func NewHiveClient

func NewHiveClient() (hiveclient.Interface, error)

func NewImageRegistryClient

func NewImageRegistryClient() (imageregistry.Client, error)

func NewKubeClient

func NewKubeClient() (kubernetes.Interface, error)

func NewKubeConfig

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

func NewManagedCluster

func NewManagedCluster(name string) *clusterv1.ManagedCluster

func NewManagedClusterSet

func NewManagedClusterSet(name string) *clusterv1beta1.ManagedClusterSet

func NewManagedClusterSetBinding

func NewManagedClusterSetBinding(namespace, name, clusterSetName string) *clusterv1beta1.ManagedClusterSetBinding

func NewNamespace

func NewNamespace(name string) *v1.Namespace

func NewOCPClient

func NewOCPClient() (openshiftclientset.Interface, error)

func RandomName

func RandomName() string

func UpdateClusterPoolLabel

func UpdateClusterPoolLabel(hiveClient hiveclient.Interface, name, namespace string, labels map[string]string) error

func UpdateClusterRole

func UpdateClusterRole(kubeClient kubernetes.Interface, name string, rules []rbacv1.PolicyRule) error

func UpdateManagedClusterLabels

func UpdateManagedClusterLabels(client clusterclient.Interface, clusterName string, labels map[string]string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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