mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-03 14:54:53 -04:00
init: create kubeconfig file with unique user/cluster name (#1133)
* Generate kubeconfig with unique name * Move create name flag to config * Add name validation to config * Move name flag in e2e tests to config generation * Remove name flag from create * Update ascii cinema flow --------- Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
parent
fd860ddb91
commit
c29107f5be
29 changed files with 359 additions and 436 deletions
|
@ -10,7 +10,6 @@ import (
|
|||
"bytes"
|
||||
"errors"
|
||||
"strconv"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/edgelesssys/constellation/v2/cli/internal/clusterid"
|
||||
|
@ -42,7 +41,6 @@ func TestCreate(t *testing.T) {
|
|||
controllerCountFlag *int
|
||||
workerCountFlag *int
|
||||
configFlag string
|
||||
nameFlag string
|
||||
stdin string
|
||||
wantErr bool
|
||||
wantAbort bool
|
||||
|
@ -81,15 +79,6 @@ func TestCreate(t *testing.T) {
|
|||
stdin: "foo\nfoo\nfoo\n",
|
||||
wantErr: true,
|
||||
},
|
||||
"flag name to long": {
|
||||
setupFs: fsWithDefaultConfig,
|
||||
creator: &stubCloudCreator{},
|
||||
provider: cloudprovider.GCP,
|
||||
controllerCountFlag: intPtr(1),
|
||||
workerCountFlag: intPtr(1),
|
||||
nameFlag: strings.Repeat("a", constants.ConstellationNameLength+1),
|
||||
wantErr: true,
|
||||
},
|
||||
"flag control-plane-count invalid": {
|
||||
setupFs: fsWithDefaultConfig,
|
||||
creator: &stubCloudCreator{},
|
||||
|
@ -200,9 +189,6 @@ func TestCreate(t *testing.T) {
|
|||
if tc.yesFlag {
|
||||
require.NoError(cmd.Flags().Set("yes", "true"))
|
||||
}
|
||||
if tc.nameFlag != "" {
|
||||
require.NoError(cmd.Flags().Set("name", tc.nameFlag))
|
||||
}
|
||||
if tc.configFlag != "" {
|
||||
require.NoError(cmd.Flags().Set("config", tc.configFlag))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue