Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propagate VR condition error message to protected pvc conditions #1639

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nirs
Copy link
Member

@nirs nirs commented Nov 5, 2024

Using development build of csi-addons adding .Message to the all conditions.

@@ -8,5 +8,5 @@ resources:
- https://github.com/csi-addons/kubernetes-csi-addons/releases/download/v0.10.0/setup-controller.yaml

images:
- name: quay.io/csiaddons/k8s-controller
newTag: v0.10.0
- name: quay.io/ypadia/k8s-controller
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why ypadia?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you checking in the development build path?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I want to test this PR now:
csi-addons/kubernetes-csi-addons#691

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image kustomization fixed, it works now:
csi-addons/kubernetes-csi-addons#691 (comment)

@nirs nirs force-pushed the vr-status branch 2 times, most recently from d65c6eb to a84c11b Compare November 5, 2024 13:38
Using development build of csi-addons adding .Message to the all
conditions.

Signed-off-by: Nir Soffer <[email protected]>
@nirs nirs changed the title Test vr status with a message Propagate VR condition error message to protected pvc conditions Nov 5, 2024
@nirs
Copy link
Member Author

nirs commented Nov 5, 2024

Works for VR conditions other then Validated. We propagate the messages form the VR conditions:

VR:

  status:
    conditions:
    - lastTransitionTime: "2024-11-05T14:32:43Z"
      message: failed to promote volume
      observedGeneration: 1
      reason: FailedToPromote
      status: "False"
      type: Completed
    - lastTransitionTime: "2024-11-05T14:32:43Z"
      message: failed to enable volume replication
      observedGeneration: 1
      reason: Error
      status: "True"
      type: Degraded
    - lastTransitionTime: "2024-11-05T14:32:43Z"
      message: volume is not resyncing
      observedGeneration: 1
      reason: NotResyncing
      status: "False"
      type: Resyncing
    - lastTransitionTime: "2024-11-05T14:32:43Z"
      message: 'failed to meet prerequisite: rpc error: code = FailedPrecondition
        desc = system is not in a state required for the operation''s execution: failed
        to enable mirroring on image "replicapool/csi-vol-f4737b6e-eeff-4137-8248-301cf37a3368":
        parent image "replicapool/csi-snap-e7c91292-a272-4278-9ee9-6be7a4c8bfe0" is
        not enabled for mirroring'
      observedGeneration: 1
      reason: PrerequisiteNotMet
      status: "False"
      type: Validated

VRG:

    protectedPVCs:
    - accessModes:
      - ReadWriteOnce
      conditions:
      - lastTransitionTime: "2024-11-05T14:32:43Z"
        message: failed to promote volume
        observedGeneration: 1
        reason: Error
        status: "False"
        type: DataReady
      - lastTransitionTime: "2024-11-05T14:32:44Z"
        message: PV cluster data already protected for PVC restored-pvc
        observedGeneration: 1
        reason: Uploaded
        status: "True"
        type: ClusterDataProtected
      - lastTransitionTime: "2024-11-05T14:32:44Z"
        message: failed to promote volume
        observedGeneration: 1
        reason: Error
        status: "False"
        type: DataProtected

Missing change: when Validated condition is False, we want to set the DataReady condition and DataProtected using the error message from the Validated condition. Currently we use the Validated condition only for checking if the VR is finished and can be removed.

@nirs nirs force-pushed the vr-status branch 3 times, most recently from 19ac40b to a0d18cc Compare November 5, 2024 16:07
When condition is not met, we set the protected PVC condition message
using the error message returned from isVRConditionMet(). When using
csi-addons > 0.10.0, we use now the message from the condition instead
of the default message.

Since the Validated condition is not reported by older version of
csi-addons, and ramen may run on a system with older csi-addons,
isVRConditionMet() return now a boolean value telling if the check was
successful; we found the condition, its observed generation matches the
object generation, and its value is not Unknown.

Since we want to propagate the message from the Validated condition, if
Validate.Status was False, we set the DataReady and DataProtected using
the Validated.Message, and skip checking the next conditions.

If we could not check the Validated condition we continue to check the
other conditions.

Signed-off-by: Nir Soffer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants