Skip to content

Commit 1ccf7d2

Browse files
Merge pull request #17772 from sosiouxme/20171213-diagnostics-fixups
Automatic merge from submit-queue (batch tested with PRs 17762, 17790, 17772, 17653, 17655). diagnostics: minor fixes Just a few things I noticed needed fixing.
2 parents cf67864 + 357071f commit 1ccf7d2

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

pkg/oc/admin/diagnostics/cluster.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func (o DiagnosticsOptions) buildClusterDiagnostics(rawConfig *clientcmdapi.Conf
126126
// attempts to find which context in the config might be a cluster-admin for the server in the current context.
127127
func (o DiagnosticsOptions) findClusterClients(rawConfig *clientcmdapi.Config) (*rest.Config, kclientset.Interface, bool, string, error) {
128128
if o.ClientClusterContext != "" { // user has specified cluster context to use
129-
if context, exists := rawConfig.Contexts[o.ClientClusterContext]; exists {
129+
if context, exists := rawConfig.Contexts[o.ClientClusterContext]; !exists {
130130
configErr := fmt.Errorf("Specified '%s' as cluster-admin context, but it was not found in your client configuration.", o.ClientClusterContext)
131131
o.Logger.Error("CED1003", configErr.Error())
132132
return nil, nil, false, "", configErr

pkg/oc/admin/diagnostics/diagnostics/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ logic. This provides two major benefits:
5252
Having configuration files where ansible places them means you will generally
5353
not even need to specify where to find them. Running:
5454

55-
oc ex diagnostics
55+
oc adm diagnostics
5656

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

63-
oc ex diagnostics --master-config=... --node-config=...
63+
oc adm diagnostics --master-config=... --node-config=...
6464

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

9696
A diagnostic is an object that conforms to the Diagnostic interface
9797
(see pkg/diagnostics/types/diagnostic.go). The diagnostic object should
98-
be built in one of the builders in the pkg/cmd/admin/diagnostics
98+
be built in one of the builders in the pkg/oc/admin/diagnostics
9999
package (based on whether it depends on client, cluster-admin, or host
100100
configuration). When executed, the diagnostic logs its findings into
101101
a result object. It should be assumed that they may run in parallel.

pkg/oc/admin/diagnostics/diagnostics/client/run_diagnostics_pod.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func (d *DiagnosticPod) runDiagnosticPod(r types.DiagnosticResult) {
7272
{
7373
Name: "pod-diagnostics",
7474
Image: imageName,
75-
Command: []string{"openshift", "infra", "diagnostic-pod", "-l", strconv.Itoa(loglevel)},
75+
Command: []string{"openshift-diagnostics", "diagnostic-pod", "-l", strconv.Itoa(loglevel)},
7676
},
7777
},
7878
},

pkg/oc/admin/diagnostics/diagnostics/network/run_pod.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func (d *NetworkDiagnostic) runNetworkDiagnostic() {
137137
// In Collection phase, results from each node are moved to the user machine where the CLI cmd is executed.
138138

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

0 commit comments

Comments
 (0)