Skip to content

Conversation

@rbbratta
Copy link
Contributor

@rbbratta rbbratta commented Oct 2, 2023

Since OPNET-198 we support IPv6 Primary cluster

Correctly set IPFamily based on the first family found

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Oct 2, 2023
@openshift-ci-robot
Copy link

openshift-ci-robot commented Oct 2, 2023

@rbbratta: This pull request references OPNET-329 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.15.0" version, but no target version was set.

Details

In response to this:

Since OPNET-198 we support IPv6 Primary cluster

Correctly set IPFamily based on the first family found

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@rbbratta
Copy link
Contributor Author

rbbratta commented Oct 2, 2023

Failures https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/openshift_release/42899/rehearse-42899-pull-ci-openshift-cluster-network-operator-master-e2e-vsphere-ovn-dualstack-primaryv6/1707789324319199232

: [sig-network] [Feature:IPv6DualStack] should create a single stack service with cluster ip from primary service range [Suite:openshift/conformance/parallel] [Suite:k8s] expand_less 	9s
{  fail [test/e2e/network/dual_stack.go:704]: service e2e-dualstack-3953/defaultclusterip expected family IPv4 at index[0] got IPv6
Error: exit with code 1
Ginkgo exit error 1: exit with code 1}

@rbbratta
Copy link
Contributor Author

rbbratta commented Oct 2, 2023

/cc @mkowalski

@openshift-ci openshift-ci bot requested review from bparees and jwforres October 2, 2023 11:56
@rbbratta rbbratta force-pushed the fix-DualStackIPv6Primary branch from 6c3870e to 865ed5a Compare October 2, 2023 11:56
@rbbratta
Copy link
Contributor Author

rbbratta commented Oct 2, 2023

/retitle OPNET-330: fix DualStackIPv6Primary

@openshift-ci openshift-ci bot changed the title OPNET-329: fix DualStackIPv6Primary OPNET-330: fix DualStackIPv6Primary Oct 2, 2023
@openshift-ci-robot
Copy link

openshift-ci-robot commented Oct 2, 2023

@rbbratta: This pull request references OPNET-330 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.15.0" version, but no target version was set.

Details

In response to this:

Since OPNET-198 we support IPv6 Primary cluster

Correctly set IPFamily based on the first family found

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Comment on lines 59 to 60
// IPFamily matches the kube e2e way
IPFamily string
Copy link
Contributor

Choose a reason for hiding this comment

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

If anything, I'd rather describe this variable like described upstream in https://github.com/kubernetes/kubernetes/blob/master/test/e2e/framework/test_context.go#L173, e.g.

IPFamily defines default IP stack of the cluster

}
}
// IP order matters for DualStack.
for _, cidr := range state.NetworkSpec.ServiceNetwork {
Copy link
Contributor

@mkowalski mkowalski Oct 2, 2023

Choose a reason for hiding this comment

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

Can we have if config.HasIPv6 && config.HasIPv4 before we run this loop? If this is something for dual-stack only, then let's run it only for dual-stack

Plus, as we are detecting primary stack based on the 1st network, would utilnet.IsIPv6CIDRString(state.NetworkSpec.ServiceNetwork[0]) suffice?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will shorten comment. This is for single and dual.

Plus, as we are detecting primary stack based on the 1st network, would utilnet.IsIPv6CIDRString(state.NetworkSpec.ServiceNetwork[0]) suffice?

I was trying to think of a way to combine the loops.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is for single and dual.

I miss something to understand how this added code is relevant for single-stack... For single-stack the previous loop (just above the code you add) should already correctly detect the IP stack, or no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The new loop replaces the old logic

// these constants are taken from kube e2e and used by tests
context.IPFamily = "ipv4"
if config.HasIPv6 && !config.HasIPv4 {
        context.IPFamily = "ipv6"
}

Copy link
Contributor

Choose a reason for hiding this comment

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

That's fair, thanks for explaining!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

avoided loop by assuming IPv4 default.

@rbbratta
Copy link
Contributor Author

rbbratta commented Oct 2, 2023

Old discusssion #26140 (review)

@rbbratta rbbratta force-pushed the fix-DualStackIPv6Primary branch 2 times, most recently from 2797fb0 to 5e652e8 Compare October 2, 2023 13:52
@rbbratta
Copy link
Contributor Author

rbbratta commented Oct 2, 2023

/test e2e-vsphere-ovn-dualstack

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 2, 2023

@rbbratta: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test e2e-aws-jenkins
  • /test e2e-aws-ovn-fips
  • /test e2e-aws-ovn-image-registry
  • /test e2e-aws-ovn-serial
  • /test e2e-gcp-ovn
  • /test e2e-gcp-ovn-builds
  • /test e2e-gcp-ovn-image-ecosystem
  • /test e2e-gcp-ovn-upgrade
  • /test images
  • /test lint
  • /test unit
  • /test verify
  • /test verify-deps

The following commands are available to trigger optional jobs:

  • /test 4.12-upgrade-from-stable-4.11-e2e-aws-ovn-upgrade-rollback
  • /test e2e-agnostic-ovn-cmd
  • /test e2e-aws
  • /test e2e-aws-csi
  • /test e2e-aws-disruptive
  • /test e2e-aws-etcd-recovery
  • /test e2e-aws-multitenant
  • /test e2e-aws-ovn
  • /test e2e-aws-ovn-cgroupsv2
  • /test e2e-aws-ovn-etcd-scaling
  • /test e2e-aws-ovn-kubevirt
  • /test e2e-aws-ovn-single-node
  • /test e2e-aws-ovn-single-node-serial
  • /test e2e-aws-ovn-single-node-upgrade
  • /test e2e-aws-ovn-upgrade
  • /test e2e-aws-proxy
  • /test e2e-azure
  • /test e2e-azure-ovn-etcd-scaling
  • /test e2e-gcp-csi
  • /test e2e-gcp-disruptive
  • /test e2e-gcp-fips-serial
  • /test e2e-gcp-ovn-etcd-scaling
  • /test e2e-gcp-ovn-rt-upgrade
  • /test e2e-gcp-ovn-techpreview
  • /test e2e-gcp-ovn-techpreview-serial
  • /test e2e-metal-ipi-ovn-dualstack
  • /test e2e-metal-ipi-ovn-ipv6
  • /test e2e-metal-ipi-sdn
  • /test e2e-metal-ipi-serial
  • /test e2e-metal-ipi-serial-ovn-ipv6
  • /test e2e-metal-ipi-virtualmedia
  • /test e2e-openstack-kuryr
  • /test e2e-openstack-ovn
  • /test e2e-openstack-serial
  • /test e2e-vsphere
  • /test e2e-vsphere-ovn-etcd-scaling
  • /test okd-e2e-gcp

Use /test all to run the following jobs that were automatically triggered:

  • pull-ci-openshift-origin-master-e2e-agnostic-ovn-cmd
  • pull-ci-openshift-origin-master-e2e-aws-csi
  • pull-ci-openshift-origin-master-e2e-aws-ovn-cgroupsv2
  • pull-ci-openshift-origin-master-e2e-aws-ovn-fips
  • pull-ci-openshift-origin-master-e2e-aws-ovn-serial
  • pull-ci-openshift-origin-master-e2e-aws-ovn-single-node
  • pull-ci-openshift-origin-master-e2e-aws-ovn-single-node-serial
  • pull-ci-openshift-origin-master-e2e-aws-ovn-single-node-upgrade
  • pull-ci-openshift-origin-master-e2e-aws-ovn-upgrade
  • pull-ci-openshift-origin-master-e2e-gcp-csi
  • pull-ci-openshift-origin-master-e2e-gcp-ovn
  • pull-ci-openshift-origin-master-e2e-gcp-ovn-rt-upgrade
  • pull-ci-openshift-origin-master-e2e-gcp-ovn-upgrade
  • pull-ci-openshift-origin-master-e2e-metal-ipi-ovn-ipv6
  • pull-ci-openshift-origin-master-e2e-metal-ipi-sdn
  • pull-ci-openshift-origin-master-e2e-openstack-ovn
  • pull-ci-openshift-origin-master-images
  • pull-ci-openshift-origin-master-lint
  • pull-ci-openshift-origin-master-unit
  • pull-ci-openshift-origin-master-verify
  • pull-ci-openshift-origin-master-verify-deps
Details

In response to this:

/test e2e-vsphere-ovn-dualstack

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Since OPNET-198 we support IPv6 Primary cluster

Correctly set IPFamily based on the first family found
@rbbratta rbbratta force-pushed the fix-DualStackIPv6Primary branch from 5e652e8 to 8d8acd8 Compare October 2, 2023 16:41
@rbbratta
Copy link
Contributor Author

rbbratta commented Oct 3, 2023

/retest-required

@rbbratta
Copy link
Contributor Author

rbbratta commented Oct 4, 2023

/cc @cybertron

@openshift-ci openshift-ci bot requested a review from cybertron October 4, 2023 18:42
@mkowalski
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 4, 2023
@openshift-ci-robot
Copy link

openshift-ci-robot commented Oct 4, 2023

@rbbratta: This pull request references OPNET-330 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.15.0" version, but no target version was set.

Details

In response to this:

Since OPNET-198 we support IPv6 Primary cluster

Correctly set IPFamily based on the first family found

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@rbbratta
Copy link
Contributor Author

rbbratta commented Oct 4, 2023

/cc @danwinship

@openshift-ci openshift-ci bot requested a review from danwinship October 4, 2023 20:02
@cybertron
Copy link
Member

/test e2e-openstack-ovn
/test e2e-aws-ovn-single-node
/lgtm

The other jobs seem to be pretty much perma-failing, but these two seem like they should pass.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 4, 2023

@rbbratta: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-ovn-single-node-serial 8d8acd8 link false /test e2e-aws-ovn-single-node-serial
ci/prow/e2e-aws-ovn-single-node-upgrade 8d8acd8 link false /test e2e-aws-ovn-single-node-upgrade
ci/prow/e2e-aws-ovn-single-node 8d8acd8 link false /test e2e-aws-ovn-single-node

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

if config.HasIPv6 && !config.HasIPv4 {
context.IPFamily = "ipv6"
}
// IPFamily constants are taken from kube e2e and used by tests
Copy link
Contributor

Choose a reason for hiding this comment

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

The comment here before was explaining "the reason we have the strings "ipv4" and "ipv6" hardcoded here is because that's what kube e2e uses, but it doesn't export them as constants we can import, so we have to hardcode them". So in the context of the rewrite, you should be explaining that in pkg/clioptions/clusterdiscovery/cluster.go. But maybe it would be better to add local constants for them (and explain there that they have to be the same as the upstream ones)? Or else use v1.Family for our config, and call strings.ToLower(string(config.PrimaryIPFamily)) here and comment that the upstream tests use the strings "ipv4" and "ipv6", which are also the lowercasified versions of the v1.Family constants.

HasIPv4 bool
HasIPv6 bool
// IPFamily defines default IP stack of the cluster, replaces upstream getDefaultClusterIPFamily
IPFamily string
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like it should be PrimaryIPFamily?

Also, HasIPv4+HasIPv6+IPFamily is redundant (and allows impossible configurations like hasIPv6: false, ipFamily: "ipv6"). We don't want to get rid of the old fields, for compatibility, but it would probably be nicer to make this PrimaryIPFamily string (or PrimaryIPFamily v1.Family?) plus DualStack bool and then deprecate HasIPv4 and HasIPv6?

Copy link
Contributor Author

@rbbratta rbbratta Oct 5, 2023

Choose a reason for hiding this comment

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

IPFamily matches context.IPFamily Changing the name would confuse.

The only use case of context.IPFamily in e2e seems to beClusterIsIPv6 which is used frequently.

// ClusterIsIPv6 returns true if the cluster is IPv6
func (tc TestContextType) ClusterIsIPv6() bool {
	return tc.IPFamily == "ipv6"
}

So, assume IPv4 unless IPFamily is IPv6. Then to detect dualstack something else.

	if c.IPFamily == "ipv6" {
		skips = append(skips, "[Feature:Networking-IPv4]")
	} else {
		skips = append(skips, "[Feature:Networking-IPv6]")
	}
	if !c.HasIPv4 || !c.HasIPv6 {
		// lack of "]" is intentional; this matches multiple tags
		skips = append(skips, "[Feature:IPv6DualStack")
	

with consts.

Copy link
Contributor Author

@rbbratta rbbratta Oct 5, 2023

Choose a reason for hiding this comment

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

err, well

	if !c.DualStack {
		// lack of "]" is intentional; this matches multiple tags
		skips = append(skips, "[Feature:IPv6DualStack")
		// c.IPFamily can be empty, which == "ipv4"
		if c.IPFamily != strings.ToLower(string(corev1.IPv6Protocol)) {
			skips = append(skips, "[Feature:Networking-IPv6]")
		} else {
			skips = append(skips, "[Feature:Networking-IPv4]")
		}
	}
	// else DualStack, run all the tests

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, HasIPv4+HasIPv6+IPFamily is redundant (and allows impossible configurations like hasIPv6: false, ipFamily: "ipv6").

I'm not sure what to do in the case of no discovery. The tc.Context has an IPFamily but we seem to want to skip ipv4 tests if there is no discovery, which implies that HasIPv4 can be false while IPFamily == "ipv4"

		{
			name:                 "complex override without discovery",
			provider:             `{"type":"aws","region":"us-east-2","zone":"us-east-2a","multimaster":false,"multizone":true}`,
			discoveredPlatform:   nil,
			optionalCapabilities: configv1.KnownClusterVersionCapabilities,
			expectedConfig:       `{"type":"aws","ProjectID":"","Region":"us-east-2","Zone":"us-east-2a","NumNodes":0,"MultiMaster":false,"MultiZone":true,"Zones":null,"ConfigFile":"","Disconnected":false,"SingleReplicaTopology":false,"NetworkPlugin":"","HasIPv4":false,"HasIPv6":false,"HasSCTP":false,"IsProxied":false,"IsIBMROKS":false,"HasNoOptionalCapabilities":false}`,
			runTests:             sets.NewString("everyone", "not-gce", "not-sdn", "not-multitenant", "online", "requires-optional-cap"),
		},

@knobunc knobunc added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 5, 2023
@openshift-ci-robot
Copy link

openshift-ci-robot commented Oct 5, 2023

@rbbratta: This pull request references OPNET-330 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.15.0" version, but no target version was set.

Details

In response to this:

Since OPNET-198 we support IPv6 Primary cluster

Correctly set IPFamily based on the first family found

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 5, 2023

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by: cybertron, mkowalski, rbbratta

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot merged commit 49d04dd into openshift:master Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants