Skip to content

Commit e776aff

Browse files
Merge pull request #17482 from deads2k/bin-09-infra
Automatic merge from submit-queue (batch tested with PRs 17299, 17482, 17471). remove openshift infra command This removes the `openshift infra` command. It does not replace ``` - irouter.NewCommandTemplateRouter("router"), - irouter.NewCommandF5Router("f5-router"), - deployer.NewCommandDeployer("deploy"), - recycle.NewCommandRecycle("recycle", out), - builder.NewCommandS2IBuilder("sti-build"), - builder.NewCommandDockerBuilder("docker-build"), ``` since those have their own binaries. @sosiouxme I created a new command `openshift-diagnostics` to hold `openshift-diagnostics diagnostic-pod` and `openshift-diagnostics network-diagnostic-pod`. I'm not attached to the name, but looking at the dependency tree, I'm betting these move with `oc` later this month. @smarterclayton I think this fulfills the intent of our conversation last week. @juanvallejo fyi
2 parents d15f4cc + 0a63dd8 commit e776aff

20 files changed

+47
-1223
lines changed

cmd/openshift-diagnostics/main.go

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
package main
2+
3+
import (
4+
"math/rand"
5+
"os"
6+
"runtime"
7+
"time"
8+
9+
"k8s.io/apiserver/pkg/util/logs"
10+
11+
"github.com/openshift/origin/pkg/cmd/util/serviceability"
12+
"github.com/openshift/origin/pkg/oc/admin/diagnostics"
13+
"github.com/spf13/cobra"
14+
15+
// install all APIs
16+
_ "github.com/openshift/origin/pkg/api/install"
17+
_ "k8s.io/kubernetes/pkg/api/install"
18+
_ "k8s.io/kubernetes/pkg/apis/autoscaling/install"
19+
_ "k8s.io/kubernetes/pkg/apis/batch/install"
20+
_ "k8s.io/kubernetes/pkg/apis/extensions/install"
21+
)
22+
23+
func main() {
24+
logs.InitLogs()
25+
defer logs.FlushLogs()
26+
defer serviceability.BehaviorOnPanic(os.Getenv("OPENSHIFT_ON_PANIC"))()
27+
defer serviceability.Profile(os.Getenv("OPENSHIFT_PROFILE")).Stop()
28+
29+
rand.Seed(time.Now().UTC().UnixNano())
30+
if len(os.Getenv("GOMAXPROCS")) == 0 {
31+
runtime.GOMAXPROCS(runtime.NumCPU())
32+
}
33+
34+
cmd := &cobra.Command{
35+
Use: "openshift-diagnostics",
36+
Short: "Diagnose OpenShift clusters",
37+
}
38+
cmd.AddCommand(
39+
diagnostics.NewCommandPodDiagnostics("diagnostic-pod", os.Stdout),
40+
diagnostics.NewCommandNetworkPodDiagnostics("network-diagnostic-pod", os.Stdout),
41+
)
42+
43+
if err := cmd.Execute(); err != nil {
44+
os.Exit(1)
45+
}
46+
}

0 commit comments

Comments
 (0)