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 node labels syncing #1259

Merged
merged 5 commits into from
Oct 6, 2023
Merged

Conversation

ishankhare07
Copy link
Contributor

What issue type does this pull request address? (keep at least one, remove the others)
/kind bugfix
/kind enhancement
/kind test

What does this pull request do? Which issues does it resolve? (use resolves #<issue_number> if possible)
resolves #1001 ENG-1289

Please provide a short message that should be published in the vcluster release notes
Fixed an issue where vcluster node were syncing as fake-$NAME. Use $NAME.nodes.vcluster.com instead

What else do we need to know?

@@ -90,6 +90,7 @@ func (s *nodeSyncer) translateUpdateBackwards(pNode *corev1.Node, vNode *corev1.
}
} else {
labels, annotations = translate.ApplyMetadata(pNode.Annotations, vNode.Annotations, pNode.Labels, vNode.Labels)
labels["kubernetes.io/hostname"] = GetNodeHost(vNode.Name)
Copy link
Member

Choose a reason for hiding this comment

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

Why is this needed, the issue only talks about fake sync? Also if we need this, why do we ignore the enableScheduler path?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @FabianKramm actually the original issue also mentioned

This should also be done for the "real nodes sync".

And yea I think I added the above line at the wrong place, I will move it out of the if-else block – we should not be ignoring the enableScheduler path, thanks for pointing out

Signed-off-by: Ishan Khare <me@ishankhare.dev>
@@ -98,8 +98,11 @@ func (s *nodeSyncer) translateUpdateBackwards(pNode *corev1.Node, vNode *corev1.
} else {
delete(annotations, TaintsAnnotation)
}
labels, annotations = translate.ApplyMetadata(pNode.Annotations, vNode.Annotations, pNode.Labels, vNode.Labels)
Copy link
Member

Choose a reason for hiding this comment

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

Why is that needed here?

@@ -100,6 +100,8 @@ func (s *nodeSyncer) translateUpdateBackwards(pNode *corev1.Node, vNode *corev1.
}
}

labels["kubernetes.io/hostname"] = GetNodeHost(vNode.Name)
Copy link
Member

Choose a reason for hiding this comment

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

I think we should only do this if s.useFakeKubelets is true as otherwise we won't rewritte the hostname at all

@FabianKramm FabianKramm merged commit 97dc882 into loft-sh:main Oct 6, 2023
47 checks passed
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.

Node label kubernetes.io/hostname should contain correct value
2 participants