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

diagnose: handle undetermined network plugins #1016

Merged
merged 2 commits into from
Dec 5, 2023

Conversation

skitt
Copy link
Member

@skitt skitt commented Nov 30, 2023

When the network plugin hasn't been determined yet, instead of indicating that it's not supported, explicitly warn that it hasn't been determined yet.

Fixes: #479

When the network plugin hasn't been determined yet, instead of
indicating that it's not supported, explicitly warn that it hasn't
been determined yet.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
@submariner-bot
Copy link
Contributor

🤖 Created branch: z_pr1016/skitt/diagnose-unknown-cni
🚀 Full E2E won't run until the "ready-to-test" label is applied. I will add it automatically once the PR has 2 approvals, or you can add it manually.

@@ -62,6 +62,11 @@ func CNIConfig(clusterInfo *cluster.Info, _ string, status reporter.Interface) e
status.Start("Checking Submariner support for the CNI network plugin")
defer status.End()

if clusterInfo.Submariner.Status.NetworkPlugin == "" {
status.Warning("The network plugin hasn't been determined yet.")
Copy link
Contributor

Choose a reason for hiding this comment

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

This implies it would be determined at some point? But shouldn't L85 below handle this case?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it is determined later. Line 85 handles the case but produces a confusing message, indicating that the plugin isn’t supported when the reality is that Submariner doesn’t know what the plugin is yet.

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 L80. L8(5|6) says "Submariner could not detect the CNI network plugin and is using (%q) plugin.". Isn't that the message we want? Perhaps we just need to move L85-88 here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops, yes. But that message would be inaccurate: if NetworkPlugin is empty in the status, Submariner isn’t using the generic plugin, it’s just not detected the plugin yet.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahh right - this is for diagnose.

Copy link
Member

Choose a reason for hiding this comment

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

I feel the message The network plugin hasn't been determined yet could give an impression to the user that if they retry the diagnose command after a while, the CNI plugin could be determined by then.

Copy link
Member Author

Choose a reason for hiding this comment

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

@sridhargaddam yes, that’s exactly what should happen. The situation handled here only happens if subctl diagnose is run before the plugin has been identified; once it has, diagnose will show the type (or “generic” if it isn’t known).

Copy link
Member

Choose a reason for hiding this comment

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

got it, thanks for the clarification.

@@ -62,6 +62,11 @@ func CNIConfig(clusterInfo *cluster.Info, _ string, status reporter.Interface) e
status.Start("Checking Submariner support for the CNI network plugin")
defer status.End()

if clusterInfo.Submariner.Status.NetworkPlugin == "" {
status.Warning("The network plugin hasn't been determined yet.")
Copy link
Contributor

Choose a reason for hiding this comment

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

Ahh right - this is for diagnose.

@submariner-bot submariner-bot added the ready-to-test When a PR is ready for full E2E testing label Dec 4, 2023
@tpantelis tpantelis enabled auto-merge (rebase) December 5, 2023 02:22
@tpantelis tpantelis merged commit 9279941 into submariner-io:devel Dec 5, 2023
28 checks passed
@submariner-bot
Copy link
Contributor

🤖 Closed branches: [z_pr1016/skitt/diagnose-unknown-cni]

@skitt skitt deleted the diagnose-unknown-cni branch December 7, 2023 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-test When a PR is ready for full E2E testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

subctl diagnose gives incorrect information when the CNI is unknown
5 participants