common

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClusterSetJoinConfigAPIVersion = "multicluster.antrea.io/v1alpha1"
	ClusterSetJoinConfigKind       = "ClusterSetJoinConfig"

	CreateByAntctlAnnotation = "multicluster.antrea.io/created-by-antctl"

	DefaultMemberNamespace = "kube-system"
	DefaultLeaderNamespace = "antrea-multicluster"
)

Variables

This section is empty.

Functions

func Cleanup

func Cleanup(cmd *cobra.Command, cleanOpts *CleanOptions) error

func ConvertMemberTokenSecret added in v1.9.0

func ConvertMemberTokenSecret(secret *corev1.Secret) *corev1.Secret

ConvertMemberTokenSecret generates a token Secret manifest for creating the input Secret in a member cluster.

func CreateClusterClaim

func CreateClusterClaim(cmd *cobra.Command, k8sClient client.Client, namespace string, clusterset string, clusterID string, createdRes *[]map[string]interface{}) error

func CreateClusterSet

func CreateClusterSet(cmd *cobra.Command, k8sClient client.Client, namespace string, clusterset string,
	leaderServer string, secret string, memberClusterID string, leaderClusterID string, leaderClusterNamespace string, createdRes *[]map[string]interface{}) error

func CreateMemberToken

func CreateMemberToken(cmd *cobra.Command, k8sClient client.Client, name string, namespace string, createdRes *[]map[string]interface{}) error

func DeleteMemberToken added in v1.9.0

func DeleteMemberToken(cmd *cobra.Command, k8sClient client.Client, name string, namespace string) error

func NewClient

func NewClient(cmd *cobra.Command) (client.Client, error)

func OutputJoinConfig added in v1.9.0

func OutputJoinConfig(cmd *cobra.Command, writer io.Writer, clusterSetID, leaderClusterID, leaderNamespace string, tokenSecret *corev1.Secret) error

func OutputMemberTokenSecret added in v1.10.0

func OutputMemberTokenSecret(tokenSecret *corev1.Secret, writer io.Writer) error

func Rollback

func Rollback(cmd *cobra.Command, k8sClient client.Client, res []map[string]interface{}) error

Types

type CleanOptions

type CleanOptions struct {
	Namespace  string
	ClusterSet string
	K8sClient  client.Client
}

type ClusterSetJoinConfig added in v1.9.0

type ClusterSetJoinConfig struct {
	APIVersion      string `yaml:"apiVersion"`
	Kind            string `yaml:"kind"`
	ClusterSetID    string `yaml:"clusterSetID"`
	ClusterID       string `yaml:"clusterID,omitempty"`
	Namespace       string `yaml:"namespace,omitempty"`
	LeaderClusterID string `yaml:"leaderClusterID"`
	LeaderNamespace string `yaml:"leaderNamespace"`
	LeaderAPIServer string `yaml:"leaderAPIServer"`
	TokenSecretName string `yaml:"tokenSecretName,omitempty"`
	TokenSecretFile string `yaml:"tokenSecretFile,omitempty"`
}

"omitempty" fields (clusterID, namespace, tokenSecretName, tokenSecretFile) can be populated by the corresponding command line options if not set in the config file.

type FakeCtrlRuntimeClient added in v1.9.0

type FakeCtrlRuntimeClient struct {
	client.Client
	ShouldError bool
}

func (FakeCtrlRuntimeClient) Create added in v1.9.0

func (FakeCtrlRuntimeClient) Delete added in v1.9.0

func (FakeCtrlRuntimeClient) Update added in v1.9.0

Jump to

Keyboard shortcuts

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