Documentation
¶
Index ¶
- Constants
- func AddVolsyncAnnontationOnManagedClusters(ctx types.Context, namespace string) error
- func CreateNamespace(ctx types.Context, cluster *types.Cluster, name string) error
- func CreateNamespaceOnMangedClusters(ctx types.Context, namespace string) error
- func DeleteNamespace(ctx types.Context, cluster *types.Cluster, name string) error
- func DeleteNamespaceOnManagedClusters(ctx types.Context, namespace string) error
- func EnsureChannel(ctx types.Context) error
- func EnsureChannelDeleted(ctx types.Context) error
- func GetCurrentCluster(ctx types.Context, namespace string, placementName string) (*types.Cluster, error)
- func GetDRPolicy(ctx types.Context, cluster *types.Cluster, name string) (*ramen.DRPolicy, error)
- func GetPlacement(ctx types.Context, namespace, name string) (*v1beta1.Placement, error)
- func RunCommand(ctx context.Context, command string, args ...string) error
- func Sleep(ctx context.Context, d time.Duration) error
- func WaitForApplicationSetDelete(ctx types.Context, cluster *types.Cluster, name, namespace string) error
- func WaitForConfigMapDelete(ctx types.Context, cluster *types.Cluster, name, namespace string) error
- func WaitForDRPCDelete(ctx types.Context, cluster *types.Cluster, name, namespace string) error
- func WaitForManagedClusterSetBindingDelete(ctx types.Context, cluster *types.Cluster, name, namespace string) error
- func WaitForNamespaceDelete(ctx types.Context, cluster *types.Cluster, name string) error
- func WaitForNamespaceDeleteOnManagedClusters(ctx types.Context, name string) error
- func WaitForPlacementDelete(ctx types.Context, cluster *types.Cluster, name, namespace string) error
- func WaitForRecipeDelete(ctx types.Context, cluster *types.Cluster, name, namespace string) error
- func WaitForRecipeDeleteOnManagedClusters(ctx types.Context, name, namespace string) error
Constants ¶
const ( DeployTimeout = 5 * time.Minute UndeployTimeout = 5 * time.Minute EnableTimeout = 5 * time.Minute // Typically less than 90 seconds, but in some cases it can take more than 5 minutes. DisableTimeout = 10 * time.Minute PurgeTimeout = 10 * time.Minute // With appset deployment may need 2m30s after failover and relocate. FailoverTimeout = 15 * time.Minute RelocateTimeout = 15 * time.Minute // Polling internal during wait. RetryInterval = 5 * time.Second )
const PlacementDecisionReasonFailoverRetained = "RetainedForFailover"
TODO: Carried over from internal/controllers, this is not part of API, may need a better way to reference it!
Variables ¶
This section is empty.
Functions ¶
func AddVolsyncAnnontationOnManagedClusters ¶
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: add volsync annotation on app namespaces on both drclusters
func CreateNamespace ¶
CreateNamespace creates a namespace in the specified cluster with the ramen-e2e managed label. If the namespace already exists, it checks whether it's managed by ramen-e2e and logs a warning if not.
func CreateNamespaceOnMangedClusters ¶
CreateNamespaceOnMangedClusters creates a namespace on both drclusters with ramen-e2e label.
func DeleteNamespace ¶
DeleteNamespace safely deletes a namespace from the specified cluster. Only deletes namespaces that are managed by ramen-e2e.
func DeleteNamespaceOnManagedClusters ¶
DeleteNamespaceOnManagedClusters safely deletes a namespace from both drclusters. Only deletes namespaces that were created by ramen-e2e (have the management label). This provides protection against accidentally deleting user or system namespaces.
func EnsureChannel ¶
func EnsureChannelDeleted ¶
func GetCurrentCluster ¶
func GetCurrentCluster(ctx types.Context, namespace string, placementName string) (*types.Cluster, error)
GetCurrentCluster retrieves the cluster object where the workload is currently placed by looking up the cluster name from the PlacementDecision and returning the corresponding cluster from the environment. Requires an existing PlacementDecision with a valid decision. Not applicable for discovered apps before enabling protection, as no Placement exists.
func GetDRPolicy ¶
nolint:unparam
func GetPlacement ¶
func RunCommand ¶
RunCommand runs a command and return the error. The command will be killed when the context is canceled or the deadline is exceeded.
func Sleep ¶
Sleep pauses the current goroutine for at least the duration d. If the context was canceled or its deadline has exceeded it will return early with a context.Canceled or a context.DeadlineExceeded error.
func WaitForConfigMapDelete ¶
func WaitForDRPCDelete ¶
func WaitForNamespaceDelete ¶
func WaitForNamespaceDeleteOnManagedClusters ¶
WaitForNamespaceDeleteOnManagedClusters waits for namespaces on both drclusters with ramen-e2e label.
func WaitForPlacementDelete ¶
func WaitForRecipeDelete ¶
Types ¶
This section is empty.