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

SDN-4434: Network diagnostics scheduling #2339

Merged
merged 5 commits into from Apr 23, 2024

Conversation

kyrtapz
Copy link
Contributor

@kyrtapz kyrtapz commented Apr 16, 2024

Implements: openshift/enhancements#1585

Note: The API is currently in TechPreview, the plan is to enable it in GA in the current release.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Apr 16, 2024
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Apr 16, 2024

@kyrtapz: This pull request references SDN-4434 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 story to target the "4.16.0" version, but no target version was set.

In response to this:

Implements: openshift/enhancements#1585

Note: The API is currently in TechPreview, the plan is to enable it in GA in the current release.

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 openshift-eng/jira-lifecycle-plugin repository.

@kyrtapz kyrtapz force-pushed the net_diag_scheduling branch 2 times, most recently from 9c4c305 to ba6f97f Compare April 16, 2024 08:50
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 16, 2024
@kyrtapz
Copy link
Contributor Author

kyrtapz commented Apr 16, 2024

/retest

@kyrtapz
Copy link
Contributor Author

kyrtapz commented Apr 16, 2024

/hold
waiting for a review from @bpickard22 and @trozet

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 16, 2024
@kyrtapz
Copy link
Contributor Author

kyrtapz commented Apr 17, 2024

/retest

@@ -131,6 +131,27 @@ func add(mgr manager.Manager, r *ReconcileOperConfig) error {
return err
}

// Watch for changes to networkDiagnostics in network.config
err = c.Watch(source.Kind(mgr.GetCache(), &configv1.Network{}), &handler.EnqueueRequestForObject{}, predicate.Funcs{
Copy link
Contributor

Choose a reason for hiding this comment

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

how come we dont follow this pattern of adding a watcher for other related config changes? at least, i dont see other config options in this function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This controller doesn't read other config fields from configv1.Network.

if err != nil {
return nil, progressing, err
}
objs = append(objs, o...)

// render network diagnostics
o, err = renderNetworkDiagnostics(conf, manifestDir)
o, err = renderNetworkDiagnostics(operConf, clusterConf, manifestDir)
Copy link
Contributor

Choose a reason for hiding this comment

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

why do you need the cluster conf here? I thought our pattern was to get config, update oper, then render with oper.

Copy link
Contributor Author

@kyrtapz kyrtapz Apr 19, 2024

Choose a reason for hiding this comment

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

We do not follow that pattern here and the networkDiagnostics is configured through clusterConf only so we don't need to copy it over. operConf has the legacy disableNetworkDiagnostics field which we fallback to(backwards compatibility) and the plan is to deprecate it.

// network diagnostics feature is disabled when clusterConf.NetworkDiagnostics.Mode is set to "Disabled"
// or when clusterConf.NetworkDiagnostics is empty and the legacy operConf.DisableNetworkDiagnostics is true
if clusterConf.NetworkDiagnostics.Mode == configv1.NetworkDiagnosticsDisabled ||
reflect.DeepEqual(clusterConf.NetworkDiagnostics, configv1.NetworkDiagnostics{}) && operConf.DisableNetworkDiagnostics {
Copy link
Contributor

Choose a reason for hiding this comment

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

if Mode is empty, where are you defaulting it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the mode is empty and operConf.DisableNetworkDiagnostics is not set then we render the diagnostics.
Empty is an allowed value in the API, from the API docs:

 this means the user has no opinion and the platform is left
 to choose reasonable defaults. These defaults are subject to change over time.
 The current default is All.

Copy link
Contributor

@trozet trozet left a comment

Choose a reason for hiding this comment

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

/lgtm
/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 23, 2024
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 23, 2024
@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD c8bcc35 and 2 for PR HEAD 8fe5415 in total

@bpickard22
Copy link
Contributor

/lgtm

kyrtapz and others added 5 commits April 23, 2024 17:12
Commands ran:
go get github.com/openshift/api
go mod tidy
go mod vendor

Signed-off-by: Patryk Diak <pdiak@redhat.com>
Co-authored-by: Benjamin Pickard <bpickard@redhat.com>
Signed-off-by: Patryk Diak <pdiak@redhat.com>
Signed-off-by: Patryk Diak <pdiak@redhat.com>
…heck controller

Signed-off-by: Patryk Diak <pdiak@redhat.com>
Introduce a way to exclude a resource from the status manger
and use it for the network diagnostics daemonset and deployment.

Signed-off-by: Patryk Diak <pdiak@redhat.com>
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Apr 23, 2024
@kyrtapz
Copy link
Contributor Author

kyrtapz commented Apr 23, 2024

Had to do a manual rebase because even though the automatic one was successful the code did not build.
The change I had to make:

--- a/pkg/network/render.go
+++ b/pkg/network/render.go
@@ -132,7 +132,7 @@ func Render(operConf *operv1.NetworkSpec, clusterConf *configv1.NetworkSpec, man
        }
        objs = append(objs, o...)
 
-       o, err = renderIPTablesAlerter(conf, bootstrapResult, manifestDir)
+       o, err = renderIPTablesAlerter(operConf, bootstrapResult, manifestDir)
        if err != nil {
                return nil, progressing, err
        }

Copy link
Contributor

@trozet trozet left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 23, 2024
Copy link
Contributor

openshift-ci bot commented Apr 23, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bpickard22, kyrtapz, trozet

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

The pull request process is described here

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-merge-bot openshift-merge-bot bot merged commit 154c095 into openshift:master Apr 23, 2024
21 of 35 checks passed
Copy link
Contributor

openshift-ci bot commented Apr 23, 2024

@kyrtapz: 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-vsphere-ovn-dualstack-primaryv6 44c7f1d link false /test e2e-vsphere-ovn-dualstack-primaryv6
ci/prow/e2e-azure-ovn 44c7f1d link false /test e2e-azure-ovn
ci/prow/e2e-metal-ipi-ovn-ipv6-ipsec 44c7f1d link false /test e2e-metal-ipi-ovn-ipv6-ipsec
ci/prow/e2e-openstack-ovn 44c7f1d link false /test e2e-openstack-ovn
ci/prow/e2e-aws-sdn-upgrade 44c7f1d link false /test e2e-aws-sdn-upgrade
ci/prow/e2e-network-mtu-migration-ovn-ipv6 44c7f1d link false /test e2e-network-mtu-migration-ovn-ipv6
ci/prow/e2e-vsphere-ovn-dualstack 44c7f1d link false /test e2e-vsphere-ovn-dualstack
ci/prow/security 44c7f1d link false /test security

Full PR test history. Your PR dashboard.

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.

@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

This PR has been included in build cluster-network-operator-container-v4.17.0-202404231810.p0.g154c095.assembly.stream.el9 for distgit cluster-network-operator.
All builds following this will include this PR.

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.

None yet

5 participants