util

package
v2.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2021 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const BMATemplate = `` /* 402-byte string literal not displayed */
View Source
const ClusterRoleBindingTemplate = `` /* 433-byte string literal not displayed */
View Source
const ClusterRoleTemplate = `` /* 424-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 ManagedClusterSetRandomTemplate = `` /* 167-byte string literal not displayed */
View Source
const ManagedClusterSetTemplate = `` /* 143-byte string literal not displayed */
View Source
const ManagedClusterTemplate = `` /* 299-byte string literal not displayed */

ManagedClusterTemplate is json template for namespace

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

ManagedClusterViewTemplate is json template for namespace

View Source
const NamespaceTemplate = `` /* 155-byte string literal not displayed */

NamespaceTemplate is json template for namespace

Variables

View Source
var ClusterRoleBindingGVR = schema.GroupVersionResource{
	Group:    "rbac.authorization.k8s.io",
	Version:  "v1",
	Resource: "clusterrolebindings",
}
View Source
var ClusterRoleGVR = schema.GroupVersionResource{
	Group:    "rbac.authorization.k8s.io",
	Version:  "v1",
	Resource: "clusterroles",
}
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:  "v1alpha1",
	Resource: "managedclustersets",
}
View Source
var NamespaceGVR = schema.GroupVersionResource{
	Group:    "",
	Version:  "v1",
	Resource: "namespaces",
}

Functions

func AcceptManagedCluster

func AcceptManagedCluster(clusterName string) error

func AddLabels

func AddLabels(obj *unstructured.Unstructured, labels map[string]string) error

func CheckClusterID

func CheckClusterID(obj *unstructured.Unstructured) error

func CheckDistributionInfo

func CheckDistributionInfo(obj *unstructured.Unstructured) error

func CheckFoundationPodsReady

func CheckFoundationPodsReady() error

func CreateManagedCluster

func CreateManagedCluster(dynamicClient dynamic.Interface) (*unstructured.Unstructured, error)

func CreateManagedClusterSet

func CreateManagedClusterSet(dynamicClient dynamic.Interface) (*unstructured.Unstructured, error)

func DeleteClusterResource

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

func DeleteManagedCluster

func DeleteManagedCluster(dynamicClient dynamic.Interface, clusterName string) error

func DeleteManagedClusterSet

func DeleteManagedClusterSet(dynamicClient dynamic.Interface, clusterSetName string) error

func DeleteResource

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

func GenerateCSR

func GenerateCSR(clusterNamespace, clusterName string, key []byte) (string, error)

func GeneratePrivateKey

func GeneratePrivateKey() ([]byte, 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 GetHostFromClientConfig

func GetHostFromClientConfig() (string, error)

func GetJoinedManagedClusters

func GetJoinedManagedClusters(dynamicClient dynamic.Interface) ([]*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 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 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 NewKubeClient

func NewKubeClient() (kubernetes.Interface, error)

func NewKubeConfig

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

func SetStatusType

func SetStatusType(obj *unstructured.Unstructured, statusType string) error

func SetSubjects

func SetSubjects(obj *unstructured.Unstructured, newSubject rbacv1.Subject) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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