util

package
v0.0.0-...-7bd45c9 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	RamenSystemNamespace = "ramen-system"

	Timeout       = 600 * time.Second
	RetryInterval = 5 * time.Second

	ArgocdNamespace = "argocd"
	RamenOpsNs      = "ramen-ops"
)
View Source
const DefaultDRPolicyName = "dr-policy"

Variables

View Source
var ConfigFile string

Functions

func AddNamespaceAnnotationForVolSync

func AddNamespaceAnnotationForVolSync(client client.Client, namespace string) error

func CreateNamespace

func CreateNamespace(client client.Client, namespace string) error

func CreateNamespaceAndAddAnnotation

func CreateNamespaceAndAddAnnotation(namespace string) error

Problem: currently we must manually add an annotation to application’s namespace to make volsync work. See this link https://volsync.readthedocs.io/en/stable/usage/permissionmodel.html#controlling-mover-permissions Workaround: create ns in both drclusters and add annotation

func DeleteNamespace

func DeleteNamespace(client client.Client, namespace string, log logr.Logger) error

func EnsureChannel

func EnsureChannel() error

func EnsureChannelDeleted

func EnsureChannelDeleted() error

func FindPod

func FindPod(client *kubernetes.Clientset, namespace, labelSelector, podIdentifier string) (
	*v1.Pod, error,
)

FindPod returns the first pod matching the label selector including the pod identifier in the namespace.

func GetChannelName

func GetChannelName() string

func GetChannelNamespace

func GetChannelNamespace() string

func GetDRPolicy

func GetDRPolicy(client client.Client, name string) (*ramen.DRPolicy, error)

nolint:unparam

func GetGitURL

func GetGitURL() string

func GetRamenNameSpace

func GetRamenNameSpace(k8sClient *kubernetes.Clientset) (string, error)

func IsOpenShiftCluster

func IsOpenShiftCluster(k8sClient *kubernetes.Clientset) (bool, error)

IsOpenShiftCluster checks if the given Kubernetes cluster is an OpenShift cluster. It returns true if the cluster is OpenShift, false otherwise, along with any error encountered.

func ReadConfig

func ReadConfig(log logr.Logger, configFile string) error

func ValidateRamenDRClusterOperator

func ValidateRamenDRClusterOperator(k8sClient *kubernetes.Clientset, clusterName string) error

func ValidateRamenHubOperator

func ValidateRamenHubOperator(k8sClient *kubernetes.Clientset) error

Types

type Cluster

type Cluster struct {
	K8sClientSet *kubernetes.Clientset
	CtrlClient   client.Client
}

type Context

type Context struct {
	Log logr.Logger
	Hub Cluster
	C1  Cluster
	C2  Cluster
}
var Ctx *Context

func NewContext

func NewContext(log logr.Logger, configFile string) (*Context, error)

type PVCSpec

type PVCSpec struct {
	StorageClassName string
	AccessModes      string
}

func GetPVCSpecs

func GetPVCSpecs() []PVCSpec

type TestConfig

type TestConfig struct {
	ChannelName      string
	ChannelNamespace string
	GitURL           string
	Clusters         map[string]struct {
		KubeconfigPath string
	}
	PVCSpecs []PVCSpec
}

Jump to

Keyboard shortcuts

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