-
Notifications
You must be signed in to change notification settings - Fork 26
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
IPV6 APIVIP Handling #589
Open
dbw7
wants to merge
10
commits into
suse-edge:main
Choose a base branch
from
dbw7:ipv6-apivip
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
IPV6 APIVIP Handling #589
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
bcafb09
pre-testing-updates
dbw7 26e8725
beginning to write tests
dbw7 1e82f22
ipv6 handling
dbw7 9a6cd09
remove unnecessary if
dbw7 090d385
update cluster_test
dbw7 d66ad0b
feedback updates
dbw7 38dc6b7
add release notes and doc
dbw7 cdca128
fix validation bug
dbw7 7582178
feedback updates
dbw7 86843c2
feedback updates
dbw7 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -220,7 +220,7 @@ func TestConfigureKubernetes_SuccessfulSingleNodeK3sCluster(t *testing.T) { | |
ctx.ImageDefinition.Kubernetes = image.Kubernetes{ | ||
Version: "v1.30.3+k3s1", | ||
Network: image.Network{ | ||
APIVIP4: "192.168.122.100", | ||
APIVIP: "192.168.122.100", | ||
APIHost: "api.cluster01.hosted.on.edge.suse.com", | ||
}, | ||
} | ||
|
@@ -293,7 +293,7 @@ func TestConfigureKubernetes_SuccessfulMultiNodeK3sCluster(t *testing.T) { | |
Version: "v1.30.3+k3s1", | ||
Network: image.Network{ | ||
APIHost: "api.cluster01.hosted.on.edge.suse.com", | ||
APIVIP4: "192.168.122.100", | ||
APIVIP: "192.168.122.100", | ||
}, | ||
Nodes: []image.Node{ | ||
{ | ||
|
@@ -423,7 +423,7 @@ func TestConfigureKubernetes_SuccessfulSingleNodeRKE2Cluster(t *testing.T) { | |
ctx.ImageDefinition.Kubernetes = image.Kubernetes{ | ||
Version: "v1.30.3+rke2r1", | ||
Network: image.Network{ | ||
APIVIP4: "192.168.122.100", | ||
APIVIP: "192.168.122.100", | ||
APIHost: "api.cluster01.hosted.on.edge.suse.com", | ||
}, | ||
} | ||
|
@@ -492,7 +492,7 @@ func TestConfigureKubernetes_SuccessfulMultiNodeRKE2Cluster(t *testing.T) { | |
Version: "v1.30.3+rke2r1", | ||
Network: image.Network{ | ||
APIHost: "api.cluster01.hosted.on.edge.suse.com", | ||
APIVIP4: "192.168.122.100", | ||
APIVIP: "192.168.122.100", | ||
}, | ||
Nodes: []image.Node{ | ||
{ | ||
|
@@ -734,7 +734,7 @@ func TestConfigureKubernetes_SuccessfulRKE2ServerWithManifests(t *testing.T) { | |
ctx.ImageDefinition.Kubernetes = image.Kubernetes{ | ||
Version: "v1.30.3+rke2r1", | ||
Network: image.Network{ | ||
APIVIP4: "192.168.122.100", | ||
APIVIP: "192.168.122.100", | ||
APIHost: "api.cluster01.hosted.on.edge.suse.com", | ||
}, | ||
} | ||
|
@@ -821,3 +821,47 @@ func TestConfigureKubernetes_SuccessfulRKE2ServerWithManifests(t *testing.T) { | |
assert.Contains(t, contents, "name: my-nginx") | ||
assert.Contains(t, contents, "image: nginx:1.14.2") | ||
} | ||
|
||
func TestKubernetesVIPManifestValidIPV4(t *testing.T) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit-picking, but I'd align these two names from "IPV4"/"IPV6" to IPv4 too, as the rest of the code/prints. |
||
k8s := &image.Kubernetes{ | ||
Version: "v1.30.3+rke2r1", | ||
Network: image.Network{ | ||
APIVIP: "192.168.1.1", | ||
}, | ||
} | ||
|
||
manifest, err := kubernetesVIPManifest(k8s) | ||
require.NoError(t, err) | ||
|
||
assert.Contains(t, manifest, "- 192.168.1.1/32") | ||
assert.Contains(t, manifest, "- name: rke2-api") | ||
} | ||
|
||
func TestKubernetesVIPManifestValidIPV6(t *testing.T) { | ||
k8s := &image.Kubernetes{ | ||
Version: "v1.30.3+k3s1", | ||
Network: image.Network{ | ||
APIVIP: "fd12:3456:789a::21", | ||
}, | ||
} | ||
|
||
manifest, err := kubernetesVIPManifest(k8s) | ||
require.NoError(t, err) | ||
fmt.Println(manifest) | ||
atanasdinov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
assert.Contains(t, manifest, "- fd12:3456:789a::21/128") | ||
assert.Contains(t, manifest, "- name: k8s-api") | ||
assert.NotContains(t, manifest, "rke2") | ||
} | ||
|
||
func TestKubernetesVIPManifestInvalidIP(t *testing.T) { | ||
k8s := &image.Kubernetes{ | ||
Version: "v1.30.3+k3s1", | ||
Network: image.Network{ | ||
APIVIP: "1111", | ||
}, | ||
} | ||
|
||
_, err := kubernetesVIPManifest(k8s) | ||
require.ErrorContains(t, err, "parsing kubernetes APIVIP address: ParseAddr(\"1111\"): unable to parse IP") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this should read as
apiVIP
instead of all caps, since that's what the field is named in the definition. But I don't feel particularly strongly if you decide to keep it like this.