Documentation ¶
Overview ¶
NOTE: Added to skip creating shadow manifests for localSecret struct +kubebuilder:skip
Index ¶
- Constants
- func AddAnnotation(obj client.Object, key, value string) bool
- func AddFinalizer(obj client.Object, finalizer string) bool
- func AddLabel(obj client.Object, key, value string) bool
- func AddOwnerReference(obj, owner metav1.Object, scheme *runtime.Scheme) (bool, error)
- func BuildManagedClusterViewName(resourceName, resourceNamespace, resource string) string
- func ClusterScopedResourceNameFromMCVName(mcvName string) string
- func ConditionAppend(object metav1.Object, conditions *[]metav1.Condition, conditionType string, ...)
- func ConditionUpdate(object metav1.Object, condition *metav1.Condition, ...)
- func CreateNamespaceIfNotExists(ctx context.Context, k8sClient client.Client, namespace string) error
- func CreateRamenOpsNamespace(ctx context.Context, k8sClient client.Client, ramenconfig *rmn.RamenConfig) error
- func DRPolicyClusterNames(drpolicy *rmn.DRPolicy) []string
- func DRPolicyClusterNamesAsASet(drpolicy *rmn.DRPolicy) sets.String
- func DRPolicyS3Profiles(drpolicy *rmn.DRPolicy, drclusters []rmn.DRCluster) sets.String
- func DeletePVC(ctx context.Context, k8sClient client.Client, pvcName, namespace string, ...) error
- func DrpolicyContainsDrcluster(drpolicy *rmn.DRPolicy, drcluster string) bool
- func DrpolicyRegionNames(drpolicy *rmn.DRPolicy, drClusters []rmn.DRCluster) []string
- func DrpolicyRegionNamesAsASet(drpolicy *rmn.DRPolicy, drClusters []rmn.DRCluster) sets.String
- func DrpolicyValidated(drpolicy *rmn.DRPolicy) error
- func ExtractMModeFromManifestWork(mw *ocmworkv1.ManifestWork) (*rmn.MaintenanceMode, error)
- func ExtractVRGFromManifestWork(mw *ocmworkv1.ManifestWork) (*rmn.VolumeReplicationGroup, error)
- func GeneratePolicyName(name string, maxLen int) string
- func GeneratePolicyResourceNames(secret string) (policyName, plBindingName, plRuleName, configPolicyName string)
- func GenericStatusConditionSet(object client.Object, conditions *[]metav1.Condition, conditionType string, ...) bool
- func GetAllDRPolicies(ctx context.Context, client client.Reader) (rmn.DRPolicyList, error)
- func GetRawExtension(manifests []ocmworkv1.Manifest, gvk schema.GroupVersionKind) (*runtime.RawExtension, error)
- func GetSecondsFromSchedulingInterval(drpolicy *rmn.DRPolicy) (float64, error)
- func HasLabel(obj client.Object, key string) bool
- func HasLabelWithValue(obj client.Object, key string, value string) bool
- func IndexFieldsForVSHandler(ctx context.Context, fieldIndexer client.FieldIndexer) error
- func IsManifestInAppliedState(mw *ocmworkv1.ManifestWork) bool
- func IsPVAttachedToNode(ctx context.Context, k8sClient client.Client, log logr.Logger, ...) (bool, error)
- func IsPVCInUseByPod(ctx context.Context, k8sClient client.Client, log logr.Logger, ...) (bool, error)
- func ListPVCsByPVCSelector(ctx context.Context, k8sClient client.Client, logger logr.Logger, ...) (*corev1.PersistentVolumeClaimList, error)
- func ManifestWorkName(name, namespace, mwType string) string
- func MapCopy[M ~map[K]V, K, V comparable](src M, dst *M) bool
- func MapCopyF[M ~map[K]V, K, V comparable](src M, dstGet func() M, dstSet func(M)) bool
- func MapDelete[M ~map[K]V, K, V comparable](src M, dst *M) bool
- func MapDeleteF[M ~map[K]V, K, V comparable](src M, dstGet func() M, dstSet func(M)) bool
- func MapDoF[M ~map[K]V, K, V comparable, R any](src M, dstGet func() M, dstSet func(M), mapDo func(M, *M) R) R
- func MergeConditions(conditionSet func(*[]metav1.Condition, metav1.Condition), ...)
- func Namespace(name string) *corev1.Namespace
- func ObjectLabelsDelete(object metav1.Object, labels map[string]string) bool
- func ObjectLabelsDo[T any](object metav1.Object, labels map[string]string, ...) T
- func ObjectLabelsSet(object metav1.Object, labels map[string]string) bool
- func ObjectMetaEmbedded(objectMeta *metav1.ObjectMeta) metav1.ObjectMeta
- func ObjectOwnerSet(object, owner metav1.Object) bool
- func ObjectOwnerUnsetIfSet(object, owner metav1.Object) bool
- func ObjectsMap[ObjectType any, ClientObject interface{ ... }](objects ...ObjectType) map[client.ObjectKey]ObjectType
- func OptionalEqual(a, b string) bool
- func OwnerNamespaceNameAndName(labels Labels) (string, string, bool)
- func OwnerNamespacedName(owner metav1.Object) types.NamespacedName
- func OwnsAcrossNamespaces(builder *builder.Builder, scheme *runtime.Scheme, object client.Object, ...) *builder.Builder
- func ProtectedPVCNamespacedName(pvc ramen.ProtectedPVC) types.NamespacedName
- func ReportIfNotPresent(recorder *EventReporter, instance runtime.Object, ...)
- func ResourceIsDeleted(obj client.Object) bool
- func UpdateStringMap(dst *map[string]string, src map[string]string)
- type Comparison
- func MapInsertOnlyAll[M ~map[K]V, K, V comparable](src M, dst *M) Comparison
- func MapInsertOnlyAllF[M ~map[K]V, K, V comparable](src M, dstGet func() M, dstSet func(M)) Comparison
- func ObjectLabelInsertOnlyAll(object metav1.Object, labels map[string]string) Comparison
- func ObjectOwnerSetIfNotAlready(object, owner metav1.Object) Comparison
- type CreateOrDeleteOrResourceVersionUpdatePredicate
- func (CreateOrDeleteOrResourceVersionUpdatePredicate) Create(e event.CreateEvent) bool
- func (CreateOrDeleteOrResourceVersionUpdatePredicate) Delete(e event.DeleteEvent) bool
- func (CreateOrDeleteOrResourceVersionUpdatePredicate) Generic(e event.GenericEvent) bool
- func (CreateOrDeleteOrResourceVersionUpdatePredicate) Update(e event.UpdateEvent) bool
- type CreateOrResourceVersionUpdatePredicate
- func (CreateOrResourceVersionUpdatePredicate) Create(event.CreateEvent) bool
- func (CreateOrResourceVersionUpdatePredicate) Delete(event.DeleteEvent) bool
- func (CreateOrResourceVersionUpdatePredicate) Generic(event.GenericEvent) bool
- func (CreateOrResourceVersionUpdatePredicate) Update(e event.UpdateEvent) bool
- type EventReporter
- type Labels
- type MWUtil
- func (mwu *MWUtil) BuildManifestWorkName(mwType string) string
- func (mwu *MWUtil) CreateOrUpdateDrClusterManifestWork(clusterName string, objectsToAppend []interface{}, ...) error
- func (mwu *MWUtil) CreateOrUpdateMModeManifestWork(name, cluster string, mMode rmn.MaintenanceMode, annotations map[string]string) error
- func (mwu *MWUtil) CreateOrUpdateNFManifestWork(name, namespace, homeCluster string, nf csiaddonsv1alpha1.NetworkFence, ...) error
- func (mwu *MWUtil) CreateOrUpdateNamespaceManifest(name string, namespaceName string, managedClusterNamespace string, ...) error
- func (mwu *MWUtil) CreateOrUpdateVRGManifestWork(name, namespace, homeCluster string, vrg rmn.VolumeReplicationGroup, ...) error
- func (mwu *MWUtil) DeleteManifestWork(mwName, mwNamespace string) error
- func (mwu *MWUtil) DeleteManifestWorksForCluster(clusterName string) error
- func (mwu *MWUtil) FindManifestWork(mwName, managedCluster string) (*ocmworkv1.ManifestWork, error)
- func (mwu *MWUtil) FindManifestWorkByType(mwType, managedCluster string) (*ocmworkv1.ManifestWork, error)
- func (mwu *MWUtil) GenerateManifest(obj interface{}) (*ocmworkv1.Manifest, error)
- func (mwu *MWUtil) GetDrClusterManifestWork(clusterName string) (*ocmworkv1.ManifestWork, error)
- func (mwu *MWUtil) GetVRGManifestWorkCount(drClusters []string) int
- func (mwu *MWUtil) ListMModeManifests(cluster string) (*ocmworkv1.ManifestWorkList, error)
- type ManagedClusterViewGetter
- type ManagedClusterViewGetterImpl
- func (m ManagedClusterViewGetterImpl) DeleteManagedClusterView(clusterName, mcvName string, logger logr.Logger) error
- func (m ManagedClusterViewGetterImpl) DeleteNFManagedClusterView(resourceName, resourceNamespace, clusterName, resourceType string) error
- func (m ManagedClusterViewGetterImpl) DeleteNamespaceManagedClusterView(resourceName, resourceNamespace, clusterName, resourceType string) error
- func (m ManagedClusterViewGetterImpl) DeleteVRGManagedClusterView(resourceName, resourceNamespace, clusterName, resourceType string) error
- func (m ManagedClusterViewGetterImpl) GetMModeFromManagedCluster(resourceName, managedCluster string, annotations map[string]string) (*rmn.MaintenanceMode, error)
- func (m ManagedClusterViewGetterImpl) GetNFFromManagedCluster(resourceName, resourceNamespace, managedCluster string, ...) (*csiaddonsv1alpha1.NetworkFence, error)
- func (m ManagedClusterViewGetterImpl) GetNamespaceFromManagedCluster(resourceName, managedCluster, namespaceString string, ...) (*corev1.Namespace, error)
- func (m ManagedClusterViewGetterImpl) GetResource(mcv *viewv1beta1.ManagedClusterView, resource interface{}) error
- func (m ManagedClusterViewGetterImpl) GetVRGFromManagedCluster(resourceName, resourceNamespace, managedCluster string, ...) (*rmn.VolumeReplicationGroup, error)
- func (m ManagedClusterViewGetterImpl) ListMModesMCVs(cluster string) (*viewv1beta1.ManagedClusterViewList, error)
- type ResourceUpdater
- func (u *ResourceUpdater) AddFinalizer(finalizerName string) *ResourceUpdater
- func (u *ResourceUpdater) AddLabel(key, value string) *ResourceUpdater
- func (u *ResourceUpdater) AddOwner(owner metav1.Object, scheme *runtime.Scheme) *ResourceUpdater
- func (u *ResourceUpdater) RemoveFinalizer(finalizerName string) *ResourceUpdater
- func (u *ResourceUpdater) Update(ctx context.Context, client client.Client) error
- type ResourceVersionUpdatePredicate
- type SecretsUtil
Constants ¶
const ( // EventReasonValidationFailed is used when VolumeReplicationGroup validation fails EventReasonValidationFailed = "FailedValidation" // EventReasonPVCListFailed is used when VRG fails to get the list of PVCs EventReasonPVCListFailed = "PVCListFailed" // EventReasonVRCreateFailed is used when VRG fails to create VolRep resource EventReasonVRCreateFailed = "VRCreateFailed" // EventReasonVRCreateFailed is used when VRG fails to update VolRep resource EventReasonVRUpdateFailed = "VRUpdateFailed" // EventReasonProtectPVCFailed is used when VRG fails to protect PVC EventReasonProtectPVCFailed = "ProtectPVCFailed" // EventReasonUploadFailed is used when VRG fails to upload PV cluster data EventReasonUploadFailed = "UploadFailed" // EventReasonVrgUploadFailed is used when VRG fails to upload VRG object EventReasonVrgUploadFailed = "VrgUploadFailed" // EventReasonPrimarySuccess is an event generated when VRG is successfully // processed as Primary. EventReasonPrimarySuccess = "PrimaryVRGProcessSuccess" // EventReasonSecondarySuccess is an event generated when VRG is successfully // processed as Primary. EventReasonSecondarySuccess = "SecondaryVRGProcessSuccess" // EventReasonSecondarySuccess is an event generated when VRG is successfully // processed as Primary. EventReasonDeleteSuccess = "VRGDeleteSuccess" // EventReasonDeploying is generated when DRPC begins to deploy ramen manged cluster // component(s) and the application EventReasonDeploying = "DRPCDeploying" // EventReasonDeployFail is an event generated when DRPC fails to do // a successful initial deployment of the application and ramen managed // cluster component(s) EventReasonDeployFail = "DRPCDeployFailed" // EventReasonDeploySuccess is an event generated when DRPC successfully // deploys ramen and the application in the managed cluster initially EventReasonDeploySuccess = "DRPCDeploySuccess" // EventReasonFailingOver is an event generated when DRPC starts the failover // process EventReasonFailingOver = "DRPCFailingOver" // EventReasonFailoverSuccess is an evenet generated when DRPC does a successful // failover EventReasonFailoverSuccess = "DRPCFailoverSuccess" // EventReasonRelocating is an event generated when DRPC starts relocating EventReasonRelocating = "DRPCRelocating" // EventReasonRelocationSuccess is an event generated when DRPC successfully // relocates an application along with ramen managed cluster component(s) EventReasonRelocationSuccess = "DRPCRelocationSuccess" // EventReasonSwitchFailed is generated when DRPC fails to switch the cluster // where the app is placed EventReasonSwitchFailed = "DRPCClusterSwitchFailed" )
const ( OCMBackupLabelKey string = "cluster.open-cluster-management.io/backup" OCMBackupLabelValue string = "ramen" )
const ( DrClusterManifestWorkName = "ramen-dr-cluster" // ManifestWorkNameFormat is a formated a string used to generate the manifest name // The format is name-namespace-type-mw where: // - name is the DRPC name // - namespace is the DRPC namespace // - type is "vrg" ManifestWorkNameFormat string = "%s-%s-%s-mw" ManifestWorkNameFormatClusterScope string = "%s-%s-mw" // ManifestWork Types MWTypeVRG string = "vrg" MWTypeNS string = "ns" MWTypeNF string = "nf" MWTypeMMode string = "mmode" )
const ( CreatedByLabelKey = "app.kubernetes.io/created-by" CreatedByLabelValueVolSync = "volsync" PodVolumePVCClaimIndexName string = "spec.volumes.persistentVolumeClaim.claimName" VolumeAttachmentToPVIndexName string = "spec.source.persistentVolumeName" )
const ( //nolint:lll // See: https://github.com/stolostron/rhacm-docs/blob/2.4_stage/governance/custom_template.adoc#special-annotation-for-reprocessing PolicyTriggerAnnotation = "policy.open-cluster-management.io/trigger-update" // Finalizer on the secret SecretPolicyFinalizer string = "drpolicies.ramendr.openshift.io/policy-protection" )
const (
LastEventValidDuration = 10
)
This implementation of events infrastructure is mainly based on the way events is handled in the ocs-operator. https://github.com/openshift/ocs-operator/blob/master/controllers/util/events.go
const (
MModesLabel = "ramendr.openshift.io/maintenancemodes"
)
Variables ¶
This section is empty.
Functions ¶
func AddOwnerReference ¶
func BuildManagedClusterViewName ¶
outputs a string for use in creating a ManagedClusterView name example: when looking for a vrg with name 'demo' in the namespace 'ramen', input: ("demo", "ramen", "vrg") this will give output "demo-ramen-vrg-mcv"
func ConditionAppend ¶
func ConditionUpdate ¶
func CreateRamenOpsNamespace ¶
func DRPolicyClusterNames ¶
func DRPolicyS3Profiles ¶
func DrpolicyRegionNames ¶
func DrpolicyValidated ¶
func ExtractMModeFromManifestWork ¶
func ExtractMModeFromManifestWork(mw *ocmworkv1.ManifestWork) (*rmn.MaintenanceMode, error)
func ExtractVRGFromManifestWork ¶
func ExtractVRGFromManifestWork(mw *ocmworkv1.ManifestWork) (*rmn.VolumeReplicationGroup, error)
func GeneratePolicyName ¶
GeneratePolicyName generates a policy name by combining the word "vs-secret-" with the name. However, if the length of the passed-in name is less than or equal to the 'maxLen', the passed-in name is returned as-is.
If the passed-in name and the namespace length exceeds 'maxLen', a unique hash of the passed-in name is computed using MD5 prepended to it "vs-secret-". If this combined name still exceeds 'maxLen', it is trimmed to fit within the limit by removing characters from the end of the hash up to maxLen.
Parameters:
potentialPolicyName: The preferred name of the policy. namespace: The namespace associated with the policy. maxLen: The maximum length of the generated name
Returns:
"vs-secret" + the generated name, which is either the passed-in name or a modified version that fits within the allowed length.
func GetAllDRPolicies ¶
func GetRawExtension ¶
func GetRawExtension( manifests []ocmworkv1.Manifest, gvk schema.GroupVersionKind, ) (*runtime.RawExtension, error)
func IndexFieldsForVSHandler ¶
func IndexFieldsForVSHandler(ctx context.Context, fieldIndexer client.FieldIndexer) error
VSHandler will either look at VolumeAttachments or pods to determine if a PVC is mounted To do this, it requires an index on pods and volumeattachments to keep track of persistent volume claims mounted
func IsManifestInAppliedState ¶
func IsManifestInAppliedState(mw *ocmworkv1.ManifestWork) bool
func IsPVAttachedToNode ¶
func IsPVAttachedToNode(ctx context.Context, k8sClient client.Client, log logr.Logger, pvc *corev1.PersistentVolumeClaim, ) (bool, error)
For CSI drivers that support it, volume attachments will be created for the PV to indicate which node they are attached to. If a volume attachment exists, then we know the PV may not be ready to have a final replication sync performed (I/Os may still not be completely written out). This is a best-effort, as some CSI drivers may not support volume attachments (CSI driver Spec.AttachRequired: false) in this case, we won't find a volumeattachment and will just assume the PV is not in use anymore.
func IsPVCInUseByPod ¶
func IsPVCInUseByPod(ctx context.Context, k8sClient client.Client, log logr.Logger, pvcNamespacedName types.NamespacedName, inUsePodMustBeReady bool, ) (bool, error)
IsPVCInUseByPod determines if there are any pod resources that reference the pvcName in the current pvcNamespace and returns true if found. Further if inUsePodMustBeReady is true, returns true only if the pod is in Ready state. TODO: Should we trust the cached list here, or fetch it from the API server?
func ListPVCsByPVCSelector ¶
func ManifestWorkName ¶
func MapCopy ¶
func MapCopy[M ~map[K]V, K, V comparable](src M, dst *M) bool
Copies src's key-value pairs into dst. Or, if dst is nil, assigns src to dst. Returns whether dst changes.
func MapCopyF ¶
func MapCopyF[M ~map[K]V, K, V comparable](src M, dstGet func() M, dstSet func(M)) bool
func MapDelete ¶
func MapDelete[M ~map[K]V, K, V comparable](src M, dst *M) bool
Deletes any key-value pairs from dst that are in src. Returns whether dst changes.
func MapDeleteF ¶
func MapDeleteF[M ~map[K]V, K, V comparable](src M, dstGet func() M, dstSet func(M)) bool
func MapDoF ¶
func MapDoF[M ~map[K]V, K, V comparable, R any](src M, dstGet func() M, dstSet func(M), mapDo func(M, *M) R) R
func MergeConditions ¶
func MergeConditions( conditionSet func(*[]metav1.Condition, metav1.Condition), conditions *[]metav1.Condition, ignoreReasons []string, subConditions ...*metav1.Condition, )
MergeConditions merges VRG conditions of the same type to generate a single condition for the Type
func ObjectLabelsDelete ¶
func ObjectLabelsDo ¶
func ObjectMetaEmbedded ¶
func ObjectMetaEmbedded(objectMeta *metav1.ObjectMeta) metav1.ObjectMeta
func ObjectOwnerSet ¶
func ObjectOwnerUnsetIfSet ¶
func ObjectsMap ¶
func OptionalEqual ¶
OptionalEqual returns True if optional field values are equal, or one of them is unset.
func OwnerNamespacedName ¶
func OwnerNamespacedName(owner metav1.Object) types.NamespacedName
func OwnsAcrossNamespaces ¶
func ProtectedPVCNamespacedName ¶
func ProtectedPVCNamespacedName(pvc ramen.ProtectedPVC) types.NamespacedName
func ReportIfNotPresent ¶
func ReportIfNotPresent(recorder *EventReporter, instance runtime.Object, eventType, eventReason, msg string, )
ReportIfNotPresent will report event if lastReportedEvent is not the same in last 10 minutes TODO: The duration 10 minutes can be changed to some other value if necessary
func ResourceIsDeleted ¶
Return true if resource was marked for deletion.
func UpdateStringMap ¶
UpdateStringMap copies all key/value pairs in src adding them to map referenced by the dst pointer. When a key in src is already present in dst, the value in dst will be overwritten by the value associated with the key in src. The dst map is created if needed.
Types ¶
type Comparison ¶
type Comparison int
const ( Different Comparison = iota Same Absent )
func MapInsertOnlyAll ¶
func MapInsertOnlyAll[M ~map[K]V, K, V comparable](src M, dst *M) Comparison
Copies src's key-value pairs into dst only if src's keys are all absent from dst. Or, if dst is nil, assigns src to dst. Returns state of src's key-value pairs in dst before any changes.
func MapInsertOnlyAllF ¶
func MapInsertOnlyAllF[M ~map[K]V, K, V comparable](src M, dstGet func() M, dstSet func(M)) Comparison
func ObjectLabelInsertOnlyAll ¶
func ObjectLabelInsertOnlyAll(object metav1.Object, labels map[string]string) Comparison
func ObjectOwnerSetIfNotAlready ¶
func ObjectOwnerSetIfNotAlready(object, owner metav1.Object) Comparison
type CreateOrDeleteOrResourceVersionUpdatePredicate ¶
type CreateOrDeleteOrResourceVersionUpdatePredicate struct{}
func (CreateOrDeleteOrResourceVersionUpdatePredicate) Create ¶
func (CreateOrDeleteOrResourceVersionUpdatePredicate) Create(e event.CreateEvent) bool
func (CreateOrDeleteOrResourceVersionUpdatePredicate) Delete ¶
func (CreateOrDeleteOrResourceVersionUpdatePredicate) Delete(e event.DeleteEvent) bool
func (CreateOrDeleteOrResourceVersionUpdatePredicate) Generic ¶
func (CreateOrDeleteOrResourceVersionUpdatePredicate) Generic(e event.GenericEvent) bool
func (CreateOrDeleteOrResourceVersionUpdatePredicate) Update ¶
func (CreateOrDeleteOrResourceVersionUpdatePredicate) Update(e event.UpdateEvent) bool
type CreateOrResourceVersionUpdatePredicate ¶
type CreateOrResourceVersionUpdatePredicate struct{}
func (CreateOrResourceVersionUpdatePredicate) Create ¶
func (CreateOrResourceVersionUpdatePredicate) Create(event.CreateEvent) bool
func (CreateOrResourceVersionUpdatePredicate) Delete ¶
func (CreateOrResourceVersionUpdatePredicate) Delete(event.DeleteEvent) bool
func (CreateOrResourceVersionUpdatePredicate) Generic ¶
func (CreateOrResourceVersionUpdatePredicate) Generic(event.GenericEvent) bool
func (CreateOrResourceVersionUpdatePredicate) Update ¶
func (CreateOrResourceVersionUpdatePredicate) Update(e event.UpdateEvent) bool
type EventReporter ¶
type EventReporter struct {
// contains filtered or unexported fields
}
EventReporter is custom events reporter type which allows user to limit the events
func NewEventReporter ¶
func NewEventReporter(recorder record.EventRecorder) *EventReporter
NewEventReporter returns EventReporter object
type Labels ¶
func OwnerLabels ¶
type MWUtil ¶
type MWUtil struct { client.Client APIReader client.Reader Ctx context.Context Log logr.Logger InstName string TargetNamespace string }
func (*MWUtil) BuildManifestWorkName ¶
func (*MWUtil) CreateOrUpdateDrClusterManifestWork ¶
func (*MWUtil) CreateOrUpdateMModeManifestWork ¶
func (mwu *MWUtil) CreateOrUpdateMModeManifestWork( name, cluster string, mMode rmn.MaintenanceMode, annotations map[string]string, ) error
MaintenanceMode ManifestWork creation
func (*MWUtil) CreateOrUpdateNFManifestWork ¶
func (mwu *MWUtil) CreateOrUpdateNFManifestWork( name, namespace, homeCluster string, nf csiaddonsv1alpha1.NetworkFence, annotations map[string]string, ) error
NetworkFence MW creation
func (*MWUtil) CreateOrUpdateNamespaceManifest ¶
func (*MWUtil) CreateOrUpdateVRGManifestWork ¶
func (*MWUtil) DeleteManifestWork ¶
func (*MWUtil) DeleteManifestWorksForCluster ¶
func (*MWUtil) FindManifestWork ¶
func (mwu *MWUtil) FindManifestWork(mwName, managedCluster string) (*ocmworkv1.ManifestWork, error)
func (*MWUtil) FindManifestWorkByType ¶
func (mwu *MWUtil) FindManifestWorkByType(mwType, managedCluster string) (*ocmworkv1.ManifestWork, error)
func (*MWUtil) GenerateManifest ¶
func (*MWUtil) GetDrClusterManifestWork ¶
func (mwu *MWUtil) GetDrClusterManifestWork(clusterName string) (*ocmworkv1.ManifestWork, error)
func (*MWUtil) GetVRGManifestWorkCount ¶
func (*MWUtil) ListMModeManifests ¶
func (mwu *MWUtil) ListMModeManifests(cluster string) (*ocmworkv1.ManifestWorkList, error)
type ManagedClusterViewGetter ¶
type ManagedClusterViewGetter interface { GetVRGFromManagedCluster( resourceName, resourceNamespace, managedCluster string, annotations map[string]string) (*rmn.VolumeReplicationGroup, error) GetNFFromManagedCluster( resourceName, resourceNamespace, managedCluster string, annotations map[string]string) (*csiaddonsv1alpha1.NetworkFence, error) GetMModeFromManagedCluster( resourceName, managedCluster string, annotations map[string]string) (*rmn.MaintenanceMode, error) ListMModesMCVs(managedCluster string) (*viewv1beta1.ManagedClusterViewList, error) GetResource(mcv *viewv1beta1.ManagedClusterView, resource interface{}) error DeleteManagedClusterView(clusterName, mcvName string, logger logr.Logger) error GetNamespaceFromManagedCluster(resourceName, resourceNamespace, managedCluster string, annotations map[string]string) (*corev1.Namespace, error) DeleteVRGManagedClusterView(resourceName, resourceNamespace, clusterName, resourceType string) error DeleteNamespaceManagedClusterView(resourceName, resourceNamespace, clusterName, resourceType string) error DeleteNFManagedClusterView(resourceName, resourceNamespace, clusterName, resourceType string) error }
begin MCV code
type ManagedClusterViewGetterImpl ¶
func (ManagedClusterViewGetterImpl) DeleteManagedClusterView ¶
func (m ManagedClusterViewGetterImpl) DeleteManagedClusterView(clusterName, mcvName string, logger logr.Logger) error
func (ManagedClusterViewGetterImpl) DeleteNFManagedClusterView ¶
func (m ManagedClusterViewGetterImpl) DeleteNFManagedClusterView( resourceName, resourceNamespace, clusterName, resourceType string, ) error
func (ManagedClusterViewGetterImpl) DeleteNamespaceManagedClusterView ¶
func (m ManagedClusterViewGetterImpl) DeleteNamespaceManagedClusterView( resourceName, resourceNamespace, clusterName, resourceType string, ) error
func (ManagedClusterViewGetterImpl) DeleteVRGManagedClusterView ¶
func (m ManagedClusterViewGetterImpl) DeleteVRGManagedClusterView( resourceName, resourceNamespace, clusterName, resourceType string, ) error
func (ManagedClusterViewGetterImpl) GetMModeFromManagedCluster ¶
func (m ManagedClusterViewGetterImpl) GetMModeFromManagedCluster(resourceName, managedCluster string, annotations map[string]string, ) (*rmn.MaintenanceMode, error)
func (ManagedClusterViewGetterImpl) GetNFFromManagedCluster ¶
func (m ManagedClusterViewGetterImpl) GetNFFromManagedCluster(resourceName, resourceNamespace, managedCluster string, annotations map[string]string, ) (*csiaddonsv1alpha1.NetworkFence, error)
func (ManagedClusterViewGetterImpl) GetNamespaceFromManagedCluster ¶
func (ManagedClusterViewGetterImpl) GetResource ¶
func (m ManagedClusterViewGetterImpl) GetResource(mcv *viewv1beta1.ManagedClusterView, resource interface{}) error
func (ManagedClusterViewGetterImpl) GetVRGFromManagedCluster ¶
func (m ManagedClusterViewGetterImpl) GetVRGFromManagedCluster(resourceName, resourceNamespace, managedCluster string, annotations map[string]string, ) (*rmn.VolumeReplicationGroup, error)
func (ManagedClusterViewGetterImpl) ListMModesMCVs ¶
func (m ManagedClusterViewGetterImpl) ListMModesMCVs(cluster string) (*viewv1beta1.ManagedClusterViewList, error)
type ResourceUpdater ¶
type ResourceUpdater struct {
// contains filtered or unexported fields
}
func NewResourceUpdater ¶
func NewResourceUpdater(obj client.Object) *ResourceUpdater
func (*ResourceUpdater) AddFinalizer ¶
func (u *ResourceUpdater) AddFinalizer(finalizerName string) *ResourceUpdater
func (*ResourceUpdater) AddLabel ¶
func (u *ResourceUpdater) AddLabel(key, value string) *ResourceUpdater
func (*ResourceUpdater) AddOwner ¶
func (u *ResourceUpdater) AddOwner(owner metav1.Object, scheme *runtime.Scheme) *ResourceUpdater
func (*ResourceUpdater) RemoveFinalizer ¶
func (u *ResourceUpdater) RemoveFinalizer(finalizerName string) *ResourceUpdater
type ResourceVersionUpdatePredicate ¶
type ResourceVersionUpdatePredicate struct{}
func (ResourceVersionUpdatePredicate) Create ¶
func (ResourceVersionUpdatePredicate) Create(event.CreateEvent) bool
func (ResourceVersionUpdatePredicate) Delete ¶
func (ResourceVersionUpdatePredicate) Delete(event.DeleteEvent) bool
func (ResourceVersionUpdatePredicate) Generic ¶
func (ResourceVersionUpdatePredicate) Generic(event.GenericEvent) bool
func (ResourceVersionUpdatePredicate) Update ¶
func (ResourceVersionUpdatePredicate) Update(e event.UpdateEvent) bool
type SecretsUtil ¶
type SecretsUtil struct { client.Client APIReader client.Reader Ctx context.Context Log logr.Logger }
func (*SecretsUtil) AddSecretToCluster ¶
func (sutil *SecretsUtil) AddSecretToCluster(secretName, clusterName, namespace, targetns string) error
func (*SecretsUtil) RemoveSecretFromCluster ¶
func (sutil *SecretsUtil) RemoveSecretFromCluster(secretName, clusterName, namespace string) error