util

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// GroupBasic means the command belongs to Group "Basic Commands"
	GroupBasic = "Basic Commands"

	// GroupClusterRegistration means the command belongs to Group "Cluster Registration Commands"
	GroupClusterRegistration = "Cluster Registration Commands"

	// GroupClusterManagement means the command belongs to Group "Cluster Management Commands"
	GroupClusterManagement = "Cluster Management Commands"

	// GroupClusterTroubleshootingAndDebugging means the command belongs to Group "Troubleshooting and Debugging Commands"
	GroupClusterTroubleshootingAndDebugging = "Troubleshooting and Debugging Commands"

	// GroupAdvancedCommands means the command belongs to Group "Advanced Commands"
	GroupAdvancedCommands = "Advanced Commands"
)
View Source
const (
	// TagCommandGroup used for tag the group of the command
	TagCommandGroup = "commandGroup"
)

Variables

This section is empty.

Functions

func CreateOrUpdateAPIService

func CreateOrUpdateAPIService(apiRegistrationClient *aggregator.Clientset, apiservice *apiregistrationv1.APIService) error

CreateOrUpdateAPIService creates a ApiService if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.

func CreateOrUpdateClusterRole

func CreateOrUpdateClusterRole(client kubernetes.Interface, clusterRole *rbacv1.ClusterRole) error

CreateOrUpdateClusterRole creates a ClusterRole if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.

func CreateOrUpdateClusterRoleBinding

func CreateOrUpdateClusterRoleBinding(client kubernetes.Interface, clusterRoleBinding *rbacv1.ClusterRoleBinding) error

CreateOrUpdateClusterRoleBinding creates a ClusterRoleBinding if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.

func CreateOrUpdateConfigMap

func CreateOrUpdateConfigMap(client *kubernetes.Clientset, cm *corev1.ConfigMap) error

CreateOrUpdateConfigMap creates a ConfigMap if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.

func CreateOrUpdateDeployment

func CreateOrUpdateDeployment(client kubernetes.Interface, deploy *appsv1.Deployment) error

CreateOrUpdateDeployment creates a Deployment if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.

func CreateOrUpdateNamespace

func CreateOrUpdateNamespace(client kubernetes.Interface, ns *corev1.Namespace) error

CreateOrUpdateNamespace creates a Namespaces if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.

func CreateOrUpdateRole

func CreateOrUpdateRole(client kubernetes.Interface, role *rbacv1.Role) error

CreateOrUpdateRole creates a Role if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.

func CreateOrUpdateRoleBinding

func CreateOrUpdateRoleBinding(client kubernetes.Interface, roleBinding *rbacv1.RoleBinding) error

CreateOrUpdateRoleBinding creates a RoleBinding if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.

func CreateOrUpdateSecret

func CreateOrUpdateSecret(client kubernetes.Interface, secret *corev1.Secret) error

CreateOrUpdateSecret creates a Secret if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.

func CreateOrUpdateService

func CreateOrUpdateService(client kubernetes.Interface, svc *corev1.Service) error

CreateOrUpdateService creates a Service if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.

func CreateService

func CreateService(client kubernetes.Interface, service *corev1.Service) error

CreateService creates a Service if the target resource doesn't exist. If the resource exists already, return directly

func DeleteConfirmation added in v1.6.0

func DeleteConfirmation() bool

DeleteConfirmation delete karmada resource confirmation

func NewNamespace

func NewNamespace(name string) *corev1.Namespace

NewNamespace generates a new Namespace by given name.

func VerifyClustersExist added in v1.8.0

func VerifyClustersExist(input []string, clusters *clusterv1alpha1.ClusterList) error

VerifyClustersExist verifies the clusters exist.

func WaitForDeploymentRollout added in v1.6.0

func WaitForDeploymentRollout(c kubernetes.Interface, dep *appsv1.Deployment, timeoutSeconds int) error

WaitForDeploymentRollout wait for Deployment reaches the ready state or timeout.

func WaitForStatefulSetRollout added in v1.6.0

func WaitForStatefulSetRollout(c kubernetes.Interface, sts *appsv1.StatefulSet, timeoutSeconds int) error

WaitForStatefulSetRollout wait for StatefulSet reaches the ready state or timeout.

Types

type Factory

type Factory interface {
	cmdutil.Factory

	// KarmadaClientSet returns a karmada clientset
	KarmadaClientSet() (karmadaclientset.Interface, error)
	// FactoryForMemberCluster returns a cmdutil.Factory for the member cluster
	FactoryForMemberCluster(clusterName string) (cmdutil.Factory, error)
}

The Factory interface provides 2 major features compared to the cmdutil.Factory: 1. provides a method to get a karmada clientset 2. provides a method to get a cmdutil.Factory for the member cluster

func NewFactory

func NewFactory(kubeConfigFlags *genericclioptions.ConfigFlags) Factory

NewFactory returns a new factory

Directories

Path Synopsis
Package genericresource is modified from "k8s.io/cli-runtime/pkg/resource".
Package genericresource is modified from "k8s.io/cli-runtime/pkg/resource".

Jump to

Keyboard shortcuts

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