util

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: Apache-2.0 Imports: 14 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 kubeclient.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 *kubeclient.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 kubeclient.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 kubeclient.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 kubeclient.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 kubeclient.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 kubeclient.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 kubeclient.Interface, service *corev1.Service) error

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

func NewNamespace

func NewNamespace(name string) *corev1.Namespace

NewNamespace generates a new Namespace by given name.

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