mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-01-26 07:16:08 -05:00
Remove ConstellationPort from config file
Signed-off-by: Malte Poll <mp@edgeless.systems>
This commit is contained in:
parent
83857b142c
commit
c679526bae
@ -8,6 +8,7 @@ import (
|
||||
"io"
|
||||
"io/fs"
|
||||
"net"
|
||||
"strconv"
|
||||
"text/tabwriter"
|
||||
|
||||
"github.com/edgelesssys/constellation/cli/azure"
|
||||
@ -105,7 +106,7 @@ func initialize(ctx context.Context, cmd *cobra.Command, protCl protoClient, ser
|
||||
return err
|
||||
}
|
||||
|
||||
endpoints := ipsToEndpoints(append(coordinators.PublicIPs(), nodes.PublicIPs()...), *config.CoordinatorPort)
|
||||
endpoints := ipsToEndpoints(append(coordinators.PublicIPs(), nodes.PublicIPs()...), strconv.Itoa(constants.CoordinatorPort))
|
||||
|
||||
cmd.Println("Waiting for cloud provider resource creation and boot ...")
|
||||
if err := waiter.InitializeValidators(validators.V()); err != nil {
|
||||
@ -129,7 +130,7 @@ func initialize(ctx context.Context, cmd *cobra.Command, protCl protoClient, ser
|
||||
autoscalingNodeGroups: autoscalingNodeGroups,
|
||||
cloudServiceAccountURI: serviceAccount,
|
||||
}
|
||||
result, err := activate(ctx, cmd, protCl, input, config, validators.V())
|
||||
result, err := activate(ctx, cmd, protCl, input, validators.V())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -158,9 +159,9 @@ func initialize(ctx context.Context, cmd *cobra.Command, protCl protoClient, ser
|
||||
}
|
||||
|
||||
func activate(ctx context.Context, cmd *cobra.Command, client protoClient, input activationInput,
|
||||
config *config.Config, validators []atls.Validator,
|
||||
validators []atls.Validator,
|
||||
) (activationResult, error) {
|
||||
err := client.Connect(net.JoinHostPort(input.coordinatorPubIP, *config.CoordinatorPort), validators)
|
||||
err := client.Connect(net.JoinHostPort(input.coordinatorPubIP, strconv.Itoa(constants.CoordinatorPort)), validators)
|
||||
if err != nil {
|
||||
return activationResult{}, err
|
||||
}
|
||||
|
@ -4,7 +4,6 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/fs"
|
||||
"strconv"
|
||||
|
||||
azureClient "github.com/edgelesssys/constellation/cli/azure/client"
|
||||
"github.com/edgelesssys/constellation/cli/cloud/cloudtypes"
|
||||
@ -43,7 +42,6 @@ var (
|
||||
// All fields in this struct and its child structs have pointer types
|
||||
// to ensure the default values of the actual type is not confused with an omitted value.
|
||||
type Config struct {
|
||||
CoordinatorPort *string `yaml:"coordinatorPort,omitempty"`
|
||||
AutoscalingNodeGroupsMin *int `yaml:"autoscalingNodeGroupsMin,omitempty"`
|
||||
AutoscalingNodeGroupsMax *int `yaml:"autoscalingNodeGroupsMax,omitempty"`
|
||||
StateDiskSizeGB *int `yaml:"StateDisksizeGB,omitempty"`
|
||||
@ -53,7 +51,6 @@ type Config struct {
|
||||
// Default returns a struct with the default config.
|
||||
func Default() *Config {
|
||||
return &Config{
|
||||
CoordinatorPort: proto.String(strconv.Itoa(constants.CoordinatorPort)),
|
||||
AutoscalingNodeGroupsMin: intPtr(1),
|
||||
AutoscalingNodeGroupsMax: intPtr(10),
|
||||
StateDiskSizeGB: intPtr(30),
|
||||
|
@ -10,7 +10,6 @@ import (
|
||||
"github.com/spf13/afero"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
func TestDefaultConfig(t *testing.T) {
|
||||
@ -47,11 +46,6 @@ func TestFromFile(t *testing.T) {
|
||||
wantResultMutator func(c *Config) // mutates the Default() config to the expected result.
|
||||
wantErr bool
|
||||
}{
|
||||
"overwrite fields": {
|
||||
from: &Config{CoordinatorPort: proto.String("1000")},
|
||||
configName: constants.ConfigFilename,
|
||||
wantResultMutator: func(c *Config) { c.CoordinatorPort = proto.String("1000") },
|
||||
},
|
||||
"overwrite slices": {
|
||||
from: &Config{Provider: someProviderConfig},
|
||||
configName: constants.ConfigFilename,
|
||||
@ -86,7 +80,6 @@ func TestFromFile(t *testing.T) {
|
||||
require.NoError(err)
|
||||
wantResult := Default()
|
||||
tc.wantResultMutator(wantResult)
|
||||
assert.EqualValues(wantResult.CoordinatorPort, result.CoordinatorPort)
|
||||
assert.EqualValues(wantResult.AutoscalingNodeGroupsMin, result.AutoscalingNodeGroupsMin)
|
||||
assert.EqualValues(wantResult.AutoscalingNodeGroupsMax, result.AutoscalingNodeGroupsMax)
|
||||
require.NotNil(wantResult.Provider)
|
||||
|
Loading…
x
Reference in New Issue
Block a user