util

package
v0.0.0-...-4563fb3 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RamenSystemNamespace = "ramen-system"

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

	ArgocdNamespace   = "argocd"
	RamenOpsNamespace = "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 *zap.SugaredLogger) error

func EnsureChannel

func EnsureChannel() error

func EnsureChannelDeleted

func EnsureChannelDeleted() error

func FindPod

func FindPod(k8sClient client.Client, 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 client.Client) (string, error)

func IsOpenShiftCluster

func IsOpenShiftCluster(k8sClient client.Client) (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 *zap.SugaredLogger, configFile string) error

func ValidateRamenDRClusterOperator

func ValidateRamenDRClusterOperator(k8sClient client.Client, clusterName string) error

func ValidateRamenHubOperator

func ValidateRamenHubOperator(k8sClient client.Client) error

Types

type Cluster

type Cluster struct {
	Client ctrlClient.Client
}

type Context

type Context struct {
	Log *zap.SugaredLogger
	Hub Cluster
	C1  Cluster
	C2  Cluster
}
var Ctx *Context

func NewContext

func NewContext(log *zap.SugaredLogger, configFile string) (*Context, error)

type PVCSpec

type PVCSpec struct {
	Name                 string
	StorageClassName     string
	AccessModes          string
	UnsupportedDeployers []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