Skip to content

Fix key and ownerRef bug#718

Merged
mergify[bot] merged 2 commits into
csi-addons:mainfrom
Madhu-1:fix-key
Nov 27, 2024
Merged

Fix key and ownerRef bug#718
mergify[bot] merged 2 commits into
csi-addons:mainfrom
Madhu-1:fix-key

Conversation

@Madhu-1

@Madhu-1 Madhu-1 commented Nov 27, 2024

Copy link
Copy Markdown
Member

csi-lib-utils/leaderelection:sanitizeName() is used to sanitize the leader identity used for the leases csiaddonsnode need to store the key with same format so that it can be used to get the connection.

The pod owned by deployment might move to new nodes and this might create the stale CSIAddonsNode object on the old node if we set Deployment as the ownerRef (this could leave stale connection in connection map and a CR).
so, we need to set the pod as the owner for the deployment as we dont store any details that are required later on for any other operations like Fencing etc.

@Madhu-1 Madhu-1 changed the title Fix key and ownerRef buy Fix key and ownerRef bug Nov 27, 2024
Comment thread internal/controller/csiaddons/csiaddonsnode_controller.go Outdated
Comment thread sidecar/internal/csiaddonsnode/csiaddonsnode.go Outdated
@Madhu-1

Madhu-1 commented Nov 27, 2024

Copy link
Copy Markdown
Member Author

@Mergifyio rebase

@mergify

mergify Bot commented Nov 27, 2024

Copy link
Copy Markdown

rebase

☑️ Nothing to do

Details
  • queue-position = -1 [📌 rebase requirement]
  • -closed [📌 rebase requirement]
  • -conflict [📌 rebase requirement]
  • any of:
    • #commits > 1 [📌 rebase requirement]
    • #commits-behind > 0 [📌 rebase requirement]
    • -linear-history [📌 rebase requirement]

@Madhu-1

Madhu-1 commented Nov 27, 2024

Copy link
Copy Markdown
Member Author

@Mergifyio rebase

namespace + "/" + leader identity(pod name)
is the key for the connection.
this key is used by GetLeaderByDriver to
get the connection.
csi-lib-utils/leaderelection:sanitizeName() is
used to sanitize the leader identity used
for the leases csiaddonsnode need to store the
key with same format so that it can be used
to get the connection.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
The pod might move to new nodes and this
might create the stale CSIAddonsNode object.
so, we need to set the pod as the owner
for the deployment as we dont store any details
that are required later on for any other
operations like Fencing etc.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
@mergify

mergify Bot commented Nov 27, 2024

Copy link
Copy Markdown

rebase

☑️ Nothing to do

Details
  • queue-position = -1 [📌 rebase requirement]
  • -closed [📌 rebase requirement]
  • -conflict [📌 rebase requirement]
  • any of:
    • #commits > 1 [📌 rebase requirement]
    • #commits-behind > 0 [📌 rebase requirement]
    • -linear-history [📌 rebase requirement]

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.

3 participants