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

diagnostics: minor fixes #17772

Merged
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
2 changes: 1 addition & 1 deletion pkg/oc/admin/diagnostics/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func (o DiagnosticsOptions) buildClusterDiagnostics(rawConfig *clientcmdapi.Conf
// attempts to find which context in the config might be a cluster-admin for the server in the current context.
func (o DiagnosticsOptions) findClusterClients(rawConfig *clientcmdapi.Config) (*rest.Config, kclientset.Interface, bool, string, error) {
if o.ClientClusterContext != "" { // user has specified cluster context to use
if context, exists := rawConfig.Contexts[o.ClientClusterContext]; exists {
if context, exists := rawConfig.Contexts[o.ClientClusterContext]; !exists {
configErr := fmt.Errorf("Specified '%s' as cluster-admin context, but it was not found in your client configuration.", o.ClientClusterContext)
o.Logger.Error("CED1003", configErr.Error())
return nil, nil, false, "", configErr
Expand Down
6 changes: 3 additions & 3 deletions pkg/oc/admin/diagnostics/diagnostics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ logic. This provides two major benefits:
Having configuration files where ansible places them means you will generally
not even need to specify where to find them. Running:

oc ex diagnostics
oc adm diagnostics

by itself will look for master and node configs (in addition to client
config file) in the standard locations and use them if found; so this
should make the ansible-installed use case as simple as possible. It's also
very easy to use configuration files when they are not in the expected
Enterprise locations:

oc ex diagnostics --master-config=... --node-config=...
oc adm diagnostics --master-config=... --node-config=...

Having logs in journald is necessary for the current log analysis
logic. Other usage may have logs going into files, output to stdout,
Expand Down Expand Up @@ -95,7 +95,7 @@ save may be your own.

A diagnostic is an object that conforms to the Diagnostic interface
(see pkg/diagnostics/types/diagnostic.go). The diagnostic object should
be built in one of the builders in the pkg/cmd/admin/diagnostics
be built in one of the builders in the pkg/oc/admin/diagnostics
package (based on whether it depends on client, cluster-admin, or host
configuration). When executed, the diagnostic logs its findings into
a result object. It should be assumed that they may run in parallel.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (d *DiagnosticPod) runDiagnosticPod(r types.DiagnosticResult) {
{
Name: "pod-diagnostics",
Image: imageName,
Command: []string{"openshift", "infra", "diagnostic-pod", "-l", strconv.Itoa(loglevel)},
Command: []string{"openshift-diagnostics", "diagnostic-pod", "-l", strconv.Itoa(loglevel)},
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/oc/admin/diagnostics/diagnostics/network/run_pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func (d *NetworkDiagnostic) runNetworkDiagnostic() {
// In Collection phase, results from each node are moved to the user machine where the CLI cmd is executed.

// TEST Phase: Run network diagnostic pod on all valid nodes in parallel
command := fmt.Sprintf("openshift infra network-diagnostic-pod -l %d", loglevel)
command := fmt.Sprintf("openshift-diagnostics network-diagnostic-pod -l %d", loglevel)
if err := d.runNetworkPod(command); err != nil {
d.res.Error("DNet2006", err, err.Error())
return
Expand Down