Skip to content

Conversation

giorio94
Copy link
Member

@giorio94 giorio94 commented Nov 27, 2023

23e762c ("node: add extra validation") introduced extra validation logic executed when unmarshalling node objects retrieved from the kvstore, ensuring in particular that the ClusterID is in the expected range and non-zero (unless the local ClusterID is zero).

Yet, this validation broke the external workloads support, if the ClusterID is set to a non-zero value. Indeed, the RegisterNode type used in this case is just a wrapper for the Node one, and reuses the same unmarshalling logic. Given that the RegisterNode object is initially created configuring the name only, it causes an unmarshalling failure when processed by the clustermesh-apiserver, due to the ClusterID being zero (only if that of the cluster is different from zero).

To fix this issue, let's override the Unmarshal function to skip the validation logic for the external workloads type, as used differently. Another possibility could be to explicitly configure the ClusterID; yet this would be trickier to backport to v1.14, as historically the ClusterID was not configured for external workloads agents, and inferred at runtime from that of the cluster it connected to.

Link to successful CI run, with non-default ClusterID: https://github.com/cilium/cilium/actions/runs/7002550345

Fixes #29355

@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Nov 27, 2023
@giorio94
Copy link
Member Author

/ci-external-workloads

1 similar comment
@giorio94
Copy link
Member Author

/ci-external-workloads

@giorio94 giorio94 changed the title gha: set ClusterID in conformance external workloads Fix external workloads not working with non-default ClusterID Nov 27, 2023
@giorio94 giorio94 added kind/bug This is a bug in the Cilium logic. release-note/bug This PR fixes an issue in a previous release of Cilium. area/clustermesh Relates to multi-cluster routing functionality in Cilium. needs-backport/1.14 labels Nov 27, 2023
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Nov 27, 2023
23e762c ("node: add extra validation") introduced extra validation
logic executed when unmarshalling node objects retrieved from the kvstore,
ensuring in particular that the ClusterID is in the expected range and
non-zero (unless the local ClusterID is zero).

Yet, this validation broke the external workloads support, if the
ClusterID is set to a non-zero value. Indeed, the RegisterNode type
used in this case is just a wrapper for the Node one, and reuses the
same unmarshalling logic. Given that the RegisterNode object is initially
created configuring the name only, it causes an unmarshalling failure
when processed by the clustermesh-apiserver, due to the ClusterID being
zero (only if that of the cluster is different from zero).

To fix this issue, let's override the Unmarshal function to skip the
validation logic for the external workloads type, as used differently.
Another possibility could be to explicitly configure the ClusterID; yet
this would be trickier to backport to v1.14, as historically the
ClusterID was not configured for external workloads agents, and inferred
at runtime from that of the cluster it connected to.

Fixes: 23e762c ("node: add extra validation")
Fixes: #29355
Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
@giorio94 giorio94 force-pushed the pr/giorio94/main/external-workloads-fix branch from a385d6d to 6313088 Compare November 27, 2023 09:19
@giorio94
Copy link
Member Author

/test

@giorio94 giorio94 marked this pull request as ready for review November 27, 2023 17:02
@giorio94 giorio94 requested a review from a team as a code owner November 27, 2023 17:02
@giorio94 giorio94 requested review from youngnick, a team and YutaroHayakawa and removed request for a team November 27, 2023 17:02
@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Nov 28, 2023
@tklauser tklauser added this pull request to the merge queue Nov 28, 2023
Merged via the queue into main with commit 56676d2 Nov 28, 2023
@tklauser tklauser deleted the pr/giorio94/main/external-workloads-fix branch November 28, 2023 16:20
@joamaki joamaki mentioned this pull request Nov 29, 2023
14 tasks
@joamaki joamaki added backport-pending/1.14 The backport for Cilium 1.14.x for this PR is in progress. and removed needs-backport/1.14 labels Nov 29, 2023
@github-actions github-actions bot removed the backport-pending/1.14 The backport for Cilium 1.14.x for this PR is in progress. label Dec 1, 2023
@github-actions github-actions bot added the backport-done/1.14 The backport for Cilium 1.14.x for this PR is done. label Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/clustermesh Relates to multi-cluster routing functionality in Cilium. backport-done/1.14 The backport for Cilium 1.14.x for this PR is done. kind/bug This is a bug in the Cilium logic. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/bug This PR fixes an issue in a previous release of Cilium.
Projects
No open projects
Status: Released
Development

Successfully merging this pull request may close these issues.

External Workloads not working with non-default cluster_id
5 participants