Skip to content

Commit 564ee03

Browse files
Remove openshift start node
1 parent e2fd943 commit 564ee03

File tree

13 files changed

+286
-1368
lines changed

13 files changed

+286
-1368
lines changed

pkg/cmd/openshift/openshift.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"github.com/spf13/cobra"
1212
"github.com/spf13/pflag"
1313

14+
"k8s.io/apimachinery/pkg/util/wait"
1415
kcmd "k8s.io/kubernetes/pkg/kubectl/cmd"
1516
ktemplates "k8s.io/kubernetes/pkg/kubectl/cmd/templates"
1617
kcmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
@@ -27,10 +28,7 @@ var (
2728
openshiftLong = ktemplates.LongDesc(`
2829
%[2]s
2930
30-
The %[3]s helps you build, deploy, and manage your applications on top of
31-
Docker containers. To start an all-in-one server with the default configuration, run:
32-
33-
$ %[1]s start &`)
31+
The %[3]s helps you build, deploy, and manage containerized applications.`)
3432
)
3533

3634
// CommandFor returns the appropriate command for this base name,
@@ -68,8 +66,8 @@ func NewCommandOpenShift(name string) *cobra.Command {
6866
Run: kcmdutil.DefaultSubCommandRun(out),
6967
}
7068

71-
startAllInOne, _ := start.NewCommandStartAllInOne(name, out, errout)
72-
root.AddCommand(startAllInOne)
69+
root.AddCommand(start.NewCommandStart(name, out, errout, wait.NeverStop))
70+
7371
root.AddCommand(newCompletionCommand("completion", name+" completion"))
7472
root.AddCommand(cmdversion.NewCmdVersion(name, osversion.Get(), os.Stdout))
7573
root.AddCommand(newCmdOptions())
@@ -125,6 +123,7 @@ var (
125123
* zsh completions are only supported in versions of zsh >= 5.2`)
126124
)
127125

126+
// NewCmdCompletion creates a completion command.
128127
func NewCmdCompletion(fullName string, out io.Writer) *cobra.Command {
129128
cmdHelpName := fullName
130129

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package node

pkg/cmd/server/kubernetes/node/node.go

Lines changed: 0 additions & 78 deletions
This file was deleted.

pkg/cmd/server/start/bootstrap_node.go

Lines changed: 0 additions & 171 deletions
This file was deleted.

pkg/cmd/server/start/command_test.go

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package start
22

33
import (
4-
"errors"
5-
"fmt"
64
"io/ioutil"
75
"os"
86
"path"
@@ -14,9 +12,6 @@ import (
1412

1513
"github.com/spf13/cobra"
1614

17-
configapi "github.com/openshift/origin/pkg/cmd/server/apis/config"
18-
configapilatest "github.com/openshift/origin/pkg/cmd/server/apis/config/latest"
19-
2015
// install all APIs
2116
_ "github.com/openshift/origin/pkg/api/install"
2217
_ "k8s.io/kubernetes/pkg/apis/core/install"
@@ -205,49 +200,3 @@ func executeMasterCommand(args []string) *MasterArgs {
205200

206201
return cfg.MasterArgs
207202
}
208-
209-
func executeAllInOneCommand(args []string) (*MasterArgs, *NodeArgs) {
210-
masterArgs, _, _, nodeArgs, _, _ := executeAllInOneCommandWithConfigs(args)
211-
return masterArgs, nodeArgs
212-
}
213-
214-
func executeAllInOneCommandWithConfigs(args []string) (*MasterArgs, *configapi.MasterConfig, error, *NodeArgs, *configapi.NodeConfig, error) {
215-
argsToUse := make([]string, 0, 4+len(args))
216-
argsToUse = append(argsToUse, "start")
217-
argsToUse = append(argsToUse, args...)
218-
argsToUse = append(argsToUse, "--write-config="+getCleanAllInOneConfigDir())
219-
argsToUse = append(argsToUse, "--create-certs=false")
220-
221-
root := &cobra.Command{
222-
Use: "openshift",
223-
Short: "test",
224-
Long: "",
225-
Run: func(c *cobra.Command, args []string) {
226-
c.Help()
227-
},
228-
}
229-
230-
openshiftStartCommand, cfg := NewCommandStartAllInOne("openshift start", os.Stdout, os.Stderr)
231-
root.AddCommand(openshiftStartCommand)
232-
root.SetArgs(argsToUse)
233-
root.Execute()
234-
235-
masterCfg, masterErr := configapilatest.ReadAndResolveMasterConfig(path.Join(getAllInOneConfigDir(), "master", "master-config.yaml"))
236-
237-
var nodeCfg *configapi.NodeConfig
238-
var nodeErr error
239-
240-
nodeConfigs, nodeErr := filepath.Glob(getNodeConfigGlob())
241-
if nodeErr == nil {
242-
if len(nodeConfigs) != 1 {
243-
nodeErr = fmt.Errorf("found wrong number of node configs: %v", nodeConfigs)
244-
} else {
245-
nodeCfg, nodeErr = configapilatest.ReadAndResolveNodeConfig(nodeConfigs[0])
246-
}
247-
}
248-
249-
if nodeCfg == nil && nodeErr == nil {
250-
nodeErr = errors.New("did not find node config")
251-
}
252-
return cfg.MasterOptions.MasterArgs, masterCfg, masterErr, cfg.NodeArgs, nodeCfg, nodeErr
253-
}

pkg/cmd/server/start/config_test.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -259,22 +259,6 @@ func TestKubeClientForExternalKubernetesMasterWithConfig(t *testing.T) {
259259
}
260260
}
261261

262-
func TestKubeClientForNodeWithConfig(t *testing.T) {
263-
expectedServer := "https://some-other-server:1234"
264-
expectedUser := "myuser"
265-
266-
nodeArgs := NewDefaultNodeArgs()
267-
nodeArgs.KubeConnectionArgs.ClientConfigLoadingRules, nodeArgs.KubeConnectionArgs.ClientConfig = makeKubeconfig(expectedServer, expectedUser)
268-
269-
actual, err := nodeArgs.KubeConnectionArgs.GetKubernetesAddress(nil)
270-
if err != nil {
271-
t.Fatalf("unexpected error: %v", err)
272-
}
273-
if expectedServer != actual.String() {
274-
t.Fatalf("expected %v, got %v", expectedServer, actual)
275-
}
276-
}
277-
278262
func TestKubeClientForExternalKubernetesMasterWithErrorKubeconfig(t *testing.T) {
279263
masterArgs := NewDefaultMasterArgs()
280264
masterArgs.KubeConnectionArgs.ClientConfigLoadingRules, masterArgs.KubeConnectionArgs.ClientConfig = makeErrorKubeconfig()

pkg/cmd/server/start/master_args.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func NewDefaultMasterArgs() *MasterArgs {
107107
ListenArg: NewDefaultListenArg(),
108108
ImageFormatArgs: NewDefaultImageFormatArgs(),
109109
KubeConnectionArgs: NewDefaultKubeConnectionArgs(),
110-
NetworkArgs: NewDefaultNetworkArgs(),
110+
NetworkArgs: NewDefaultMasterNetworkArgs(),
111111
}
112112

113113
return config

0 commit comments

Comments
 (0)