mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-12-15 16:09:39 -05: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
|
|
@ -58,9 +58,12 @@ type Config struct {
|
|||
// Schema version of this configuration file.
|
||||
Version string `yaml:"version" validate:"eq=v2"`
|
||||
// description: |
|
||||
// Machine image used to create Constellation nodes.
|
||||
// Machine image version used to create Constellation nodes.
|
||||
Image string `yaml:"image" validate:"required,version_compatibility"`
|
||||
// description: |
|
||||
// Name of the cluster.
|
||||
Name string `yaml:"name" validate:"required,valid_name"`
|
||||
// description: |
|
||||
// Size (in GB) of a node's disk to store the non-volatile state.
|
||||
StateDiskSizeGB int `yaml:"stateDiskSizeGB" validate:"min=0"`
|
||||
// description: |
|
||||
|
|
@ -252,6 +255,7 @@ func Default() *Config {
|
|||
return &Config{
|
||||
Version: Version2,
|
||||
Image: defaultImage,
|
||||
Name: "constell",
|
||||
MicroserviceVersion: compatibility.EnsurePrefixV(constants.VersionInfo),
|
||||
KubernetesVersion: string(versions.Default),
|
||||
StateDiskSizeGB: 30,
|
||||
|
|
@ -505,6 +509,13 @@ func (c *Config) Validate(force bool) error {
|
|||
if err := validate.RegisterTranslation("version_compatibility", trans, registerVersionCompatibilityError, translateVersionCompatibilityError); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := validate.RegisterTranslation("valid_name", trans, registerValidateNameError, c.translateValidateNameError); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.RegisterValidation("valid_name", c.validateName); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.RegisterValidation("no_placeholders", validateNoPlaceholder); err != nil {
|
||||
return err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue