common

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package common contains reusable helped functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClusterClient

func ClusterClient(kubeconfig []byte) (*clusterapi.Clientset, error)

ClusterClient creates an OCM cluster v1 client.

func GetManagedCluster

func GetManagedCluster(ctx context.Context, client *clusterapi.Clientset, name string) (*clusterv1.ManagedCluster, error)

GetManagedCluster retrieves a ManagedCluster resource from the Hub cluster for a particular Spoke cluster.

func OperatorClient

func OperatorClient(kubeconfig []byte) (*operatorapi.Clientset, error)

OperatorClient creates an OCM operator v1 client.

func PrepareKubeconfig

func PrepareKubeconfig(ctx context.Context, kClient client.Client, kubeconfig *v1alpha1.Kubeconfig, args []string) ([]string, func(), error)

PrepareKubeconfig parses a kubeconfig spec and returns updated clusteradm args. The '--kubeconfig' flag is added and a cleanup function is returned to remove the temp kubeconfig file.

func PrepareResources

func PrepareResources(resources v1alpha1.ResourceSpec) []string

PrepareResources returns resource-related flags

func UpdateManagedCluster

func UpdateManagedCluster(ctx context.Context, client *clusterapi.Clientset, managedCluster *clusterv1.ManagedCluster) error

UpdateManagedCluster updates the ManagedCluster resource for a particular Spoke cluster.

func WorkClient

func WorkClient(kubeconfig []byte) (*workapi.Clientset, error)

WorkClient creates an OCM work v1 client.

Types

This section is empty.

Jump to

Keyboard shortcuts

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