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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMPROVEMENT] UI should refuse to attach strict-local volume to the wrong node #8546

Open
ejweber opened this issue May 10, 2024 · 0 comments
Labels
kind/improvement Request for improvement of existing function priority/2 Nice to fix in this release (managed by PO) require/backport Require backport. Only used when the specific versions to backport have not been definied. require/doc Require updating the longhorn.io documentation require/manual-test-plan Require adding/updating manual test cases if they can't be automated severity/4 Function working but has a minor issue (a minor incident with low impact)
Milestone

Comments

@ejweber
Copy link
Contributor

ejweber commented May 10, 2024

Is your improvement request related to a feature? Please describe (馃憤 if you like this request)

Off the top of my head, I'm not sure how easy this request is to implement (probably not too bad), but the existing behavior is a bit weird:

  • Create a strict-local volume in the UI.
  • Attach it to a node in the UI.
  • Detach if from the node in the UI.
  • Attach it to a different node in the UI.

This is not legal, and indeed, longhorn-manager logs errors and refuses to complete the operation.

[longhorn-manager-m9vhl] time="2024-05-10T20:02:03Z" level=error msg="Failed to sync Longhorn VolumeAttachment" func=controller.handleReconcileErrorLogging file="utils.go:67" LonghornVolumeAttachment=longhorn-system/test controller=longhorn-volume-attachment error="longhorn-volume-attachment: failed to sync VolumeAttachment longhorn-system/test: admission webhook \"validator.longhorn.io\" denied the request: failed to check if strict-local volume test and its replica are on the same node: moving a strict-local volume test to another node is not supported" node=eweber-v126-worker-9c1451b4-kgxdq
[longhorn-manager-mmjh9] time="2024-05-10T20:02:03Z" level=warning msg="Rejected operation: Request (user: system:serviceaccount:longhorn-system:longhorn-service-account, longhorn.io/v1beta2, Kind=Volume, namespace: longhorn-system, name: test, operation: UPDATE)" func="admission.(*Handler).admit" file="admission.go:106" error="failed to check if strict-local volume test and its replica are on the same node: moving a strict-local volume test to another node is not supported" service=admissionWebhook```

However, this message is coming from the attach/detach controller. There is already an attachment ticket in the corresponding volumeattachment.longhorn.io CR, and the attach API call returned successful to the UI.

  spec:
    attachmentTickets:
      longhorn-ui:
        generation: 0
        id: longhorn-ui
        nodeID: eweber-v126-worker-9c1451b4-6464j
        parameters:
          disableFrontend: "false"
          lastAttachedBy: ""
        type: longhorn-api
    volume: test
  status:
    attachmentTicketStatuses:
      longhorn-ui:
        conditions:
        - lastProbeTime: ""
          lastTransitionTime: "2024-05-10T19:44:31Z"
          message: ""
          reason: ""
          status: "False"
          type: Satisfied
        generation: 0
        id: longhorn-ui
        satisfied: false

There is no error in the UI, but the volume is not (and will not be) attached.

Describe the solution you'd like

It would be better to fail obviously at an upper layer so the UI is aware. Maybe the VolumeManager.Attach method can check for this situation and return an error instead of creating the volumeattachment.longhorn.io?

@ejweber ejweber added require/doc Require updating the longhorn.io documentation require/manual-test-plan Require adding/updating manual test cases if they can't be automated kind/improvement Request for improvement of existing function require/backport Require backport. Only used when the specific versions to backport have not been definied. severity/4 Function working but has a minor issue (a minor incident with low impact) priority/2 Nice to fix in this release (managed by PO) labels May 10, 2024
@ejweber ejweber added this to the v1.8.0 milestone May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/improvement Request for improvement of existing function priority/2 Nice to fix in this release (managed by PO) require/backport Require backport. Only used when the specific versions to backport have not been definied. require/doc Require updating the longhorn.io documentation require/manual-test-plan Require adding/updating manual test cases if they can't be automated severity/4 Function working but has a minor issue (a minor incident with low impact)
Projects
None yet
Development

No branches or pull requests

1 participant