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

Fix CSITopology matching logic for csi storage driver #24522

Merged
merged 7 commits into from
Nov 22, 2024

Conversation

thefallentree
Copy link
Contributor

@thefallentree thefallentree commented Nov 21, 2024

Description

CSI volume is created with following topology

  "Topologies": [
        null,
        {
            "Segments": {
                "topology.kubernetes.io/zone": "us-east-1a"
            }
        }
    ],

and Node Accessible Topology is reported as

  "6befce82-c4e5-8509-55ad-3b69bde1fa22": {
            "AllocID": "b6b6f136-d4c4-691e-47b6-330e1fbf4c4f",
            "HealthDescription": "healthy",
            "Healthy": true,
            "NodeInfo": {
                "AccessibleTopology": {
                    "Segments": {
                        "topology.kubernetes.io/zone": "us-east-1a",
                        "kubernetes.io/os": "linux",
                        "topology.ebs.csi.aws.com/zone": "us-east-1a"
                    }
                },
                "ID": "i-05feecab254e44c60",
                "MaxVolumes": 26,
                "RequiresNodeStageVolume": true,
                "SupportsCondition": false,
                "SupportsExpand": true,
                "SupportsStats": true
            },
            "PluginID": "aws-ebs",
            "RequiresControllerPlugin": true,
            "RequiresTopologies": true,
            "UpdateTime": "2024-11-20T21:41:43.593062188Z"
        },

The current logic assume they completely match, where the accessible topology's Segements just need to be a superset of the volume topology's Segements

Up until EBS CSI driver version < 1.26.1 , the reported value matches exactly, and after v1.27.0 it has been broken since.

Testing & Reproduction steps

without this patch , the e2e test for csi driver with a ebs-csi driver > 1.26.1 will fail.

Links

fix #20094

Contributor Checklist

  • Changelog Entry If this PR changes user-facing behavior, please generate and add a
    changelog entry using the make cl command.
  • Testing Please add tests to cover any new functionality or to demonstrate bug fixes and
    ensure regressions will be caught.
  • Documentation If the change impacts user-facing functionality such as the CLI, API, UI,
    and job configuration, please update the Nomad website documentation to reflect this. Refer to
    the website README for docs guidelines. Please also consider whether the
    change requires notes within the upgrade guide.

Reviewer Checklist

  • Backport Labels Please add the correct backport labels as described by the internal
    backporting document.
  • Commit Type Ensure the correct merge method is selected which should be "squash and merge"
    in the majority of situations. The main exceptions are long-lived feature branches or merges where
    history should be preserved.
  • Enterprise PRs If this is an enterprise only PR, please add any required changelog entry
    within the public repository.

Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

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

Hi @thefallentree! Thanks for this PR. In addition to resolving the compilation errors and the items I noted in the comments, please run make cl to add a changelog entry.

nomad/structs/node.go Outdated Show resolved Hide resolved
@tgross tgross self-assigned this Nov 21, 2024
@tgross tgross added this to the 1.9.x milestone Nov 21, 2024
nomad/structs/node.go Outdated Show resolved Hide resolved
Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

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

Thanks @thefallentree!

I've push a small commit to make the changelog message applicable to more users, and tidied up some style items in the unit test (we're trying to get rid of testify on Nomad). Once CI is green, I'll merge this and get it backported.

@tgross tgross added backport/ent/1.7.x+ent Changes are backported to 1.7.x+ent backport/ent/1.8.x+ent Changes are backported to 1.8.x+ent backport/1.9.x backport to 1.9.x release line labels Nov 21, 2024
@tgross tgross merged commit 642e33a into hashicorp:main Nov 22, 2024
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/ent/1.7.x+ent Changes are backported to 1.7.x+ent backport/ent/1.8.x+ent Changes are backported to 1.8.x+ent backport/1.9.x backport to 1.9.x release line theme/storage type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

csi: aws-ebs-csi plugin v1.28.0 fails to place allocations
2 participants