Skip to content

Copy StorageClass and AccessMode to cloneConfig on volume cloning#1168

Open
zzzanziber wants to merge 1 commit into
NetApp:masterfrom
zzzanziber:fix-clone-metadata-inheritance
Open

Copy StorageClass and AccessMode to cloneConfig on volume cloning#1168
zzzanziber wants to merge 1 commit into
NetApp:masterfrom
zzzanziber:fix-clone-metadata-inheritance

Conversation

@zzzanziber

Copy link
Copy Markdown

Change description

Copy StorageClass and AccessMode to cloneConfig on volume cloning

Ensure that during volume cloning, target StorageClass and AccessMode from volumeConfig are copied onto cloneConfig if they are specified, so that the metadata in the TridentVolume CR remains in sync with the Kubernetes PV state.

Fixes Issue #1162

Project tracking

  • [ x] This PR does not require a JIRA ticket (explain below why)

This is an upstream open-source contribution to the NetApp Trident repository and does not track against internal JIRA.

Do any added TODOs have an issue in the backlog?

No.

Did you add unit tests? Why not?

Yes, added TestCloneVolume_CrossStorageClassAndAccessMode in core/orchestrator_core_test.go to assert that both StorageClass and AccessMode are correctly inherited by the clone configuration when cloning a volume.

Does this code need functional testing?

No. The logic is fully validated by the added unit tests in the orchestrator core.

Is a code review walkthrough needed? why or why not?

No. The change is simple and localized, only copying two string fields from volumeConfig onto cloneConfig during the clone configuration build stage.

Should additional test coverage be executed in addition to pre-merge?

No.

Does this code need a note in the changelog?

Changelog

Fixed volume cloning to ensure the clone inherits the target StorageClass and AccessMode when specified.

Does this code require documentation changes?

No. This fixes a bug where metadata became out-of-sync; the expected behavior remains the same.

Additional Information

Ensure that during volume cloning, target StorageClass and AccessMode
from volumeConfig are copied onto cloneConfig if they are specified, so
that the metadata in the TridentVolume CR remains in sync with the
Kubernetes PV state.

Fixes NetApp#1162
@github-actions

Copy link
Copy Markdown

Changelog label required

This PR must have exactly one changelog label before it can merge:

  • needs-changelog — user-facing change; add a release-note entry in the PR description (e.g. under a ## Changelog section)
  • no-changelog — no release note needed; please add a brief rationale in the PR description (e.g. under the changelog question in the PR template)

PR author or collaborator: comment on this PR with one of:

  • /needs-changelog
  • /no-changelog

Maintainers may also set needs-changelog or no-changelog in the GitHub UI.

Merge is blocked only until one of these labels is set — release note or rationale text in the PR description is encouraged but not required to merge.

@torirevilla

Copy link
Copy Markdown
Contributor

If you wish to contribute to Trident please complete the necessary steps outlined in the CONTRIBUTING.md file, including the signed CCLA.

Sign and submit NetApp's Contributor License Agreement. You must sign and submit the Corporate Contributor License Agreement (CCLA) in order to contribute.

@zzzanziber

Copy link
Copy Markdown
Author

Done.

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