Skip to content

Commit

Permalink
config refactoring: make tests green again
Browse files Browse the repository at this point in the history
Signed-off-by: Karen Almog <[email protected]>
  • Loading branch information
Karen Almog committed Dec 24, 2021
1 parent 35a0706 commit 0b4b16a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
1 change: 1 addition & 0 deletions inttest/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ check-ctr: TIMEOUT=10m
check-byocri: TIMEOUT=5m
# readiness check for metric tests takes between around 5 and 6 minutes.
check-metrics: TIMEOUT=6m
check-calico: TIMEOUT=6m

# Establishing konnectivity tunnels with the LB in place takes a while, thus a bit longer timeout for the smoke
check-customports: TIMEOUT=6m
Expand Down
2 changes: 1 addition & 1 deletion inttest/customports/customports_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func (ds *Suite) TestControllerJoinsWithCustomPort() {

workerToken, err := ds.GetJoinToken("worker", "", "--config=/tmp/k0s.yaml")
ds.Require().NoError(err)
ds.Require().NoError(ds.RunWorkersWithToken("/var/lib/k0s", workerToken, `--config="/tmp/k0s.yaml"`))
ds.Require().NoError(ds.RunWorkersWithToken("/var/lib/k0s", workerToken))

kc, err := ds.KubeClient("controller0", "")
ds.Require().NoError(err)
Expand Down
12 changes: 3 additions & 9 deletions pkg/apis/k0s.k0sproject.io/v1beta1/clusterconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,19 +279,13 @@ func (c *ClusterConfig) Validate() []error {
}

// GetBootstrappingConfig returns a ClusterConfig object stripped of Cluster-Wide Settings
func (c *ClusterConfig) GetBootstrappingConfig() *ClusterConfig {
func (c *ClusterConfig) GetBootstrappingConfig(storageSpec *StorageSpec) *ClusterConfig {
return &ClusterConfig{
ObjectMeta: c.ObjectMeta,
TypeMeta: c.TypeMeta,
Spec: &ClusterSpec{
API: c.Spec.API,
Storage: &StorageSpec{
Type: c.Spec.Storage.Type,
Etcd: &EtcdConfig{
PeerAddress: c.Spec.Storage.Etcd.PeerAddress,
},
Kine: c.Spec.Storage.Kine,
},
API: c.Spec.API,
Storage: storageSpec,
Network: &Network{
ServiceCIDR: c.Spec.Network.ServiceCIDR,
DualStack: c.Spec.Network.DualStack,
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func GetNodeConfig(cfgPath string, k0sVars constant.CfgVars) (*v1beta1.ClusterCo
if err != nil {
return nil, err
}
nodeConfig := cfg.GetBootstrappingConfig()
nodeConfig := cfg.GetBootstrappingConfig(cfg.Spec.Storage)
var etcdConfig *v1beta1.EtcdConfig
if cfg.Spec.Storage.Type == v1beta1.EtcdStorageType {
etcdConfig = &v1beta1.EtcdConfig{
Expand Down

0 comments on commit 0b4b16a

Please sign in to comment.