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

kubernetes-1.21: update ipv6 address comparison patch #1932

Merged
merged 1 commit into from
Feb 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
From 5798f636260c14be4b14936d576a7dc2ccd2f88c Mon Sep 17 00:00:00 2001
From: Erikson Tung <etung@amazon.com>
Date: Fri, 28 Jan 2022 18:26:29 -0800
Subject: [PATCH] parse IPv6 node address before comparing with node IP

IPv6 formatting might differ between `node-ip` being provided to kubelet
and the node address being provided by the cloud provider. Need to parse
node address before comparison.

See https://github.com/kubernetes/kubernetes/pull/107736/ for the
equivalent fix for newer version of K8s (i.e. >v1.23)

The change here does not use forked golang parsers because K8s v1.21.6
does not have changes from https://github.com/kubernetes/kubernetes/commit/0cd75e8fec62a2531637e80bb950ac9983cac1b0
and would be otherwise too cumbersome to carry as a patch.
---
pkg/kubelet/nodestatus/setters.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pkg/kubelet/nodestatus/setters.go b/pkg/kubelet/nodestatus/setters.go
index 52f12178b66..cedf60eb951 100644
--- a/pkg/kubelet/nodestatus/setters.go
+++ b/pkg/kubelet/nodestatus/setters.go
@@ -125,7 +125,7 @@ func NodeAddress(nodeIPs []net.IP, // typically Kubelet.nodeIPs

nodeIPTypes := make(map[v1.NodeAddressType]bool)
for _, nodeAddress := range cloudNodeAddresses {
- if nodeAddress.Address == nodeIP.String() {
+ if net.ParseIP(nodeAddress.Address).Equal(nodeIP) {
enforcedNodeAddresses = append(enforcedNodeAddresses, v1.NodeAddress{Type: nodeAddress.Type, Address: nodeAddress.Address})
nodeIPTypes[nodeAddress.Type] = true
}
--
2.17.1

2 changes: 1 addition & 1 deletion packages/kubernetes-1.21/kubernetes-1.21.spec
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Source9: kubelet-sysctl.conf
Source1000: clarify.toml

Patch0001: 0001-AWS-Include-IPv6-addresses-in-NodeAddresses.patch
Patch0002: 0002-Fix-kubelet-IPv6-address-comparison.patch
Patch0002: 0002-IPv6-node-address-before-comparing-with-node-I.patch

BuildRequires: git
BuildRequires: rsync
Expand Down