Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sancyx committed Aug 30, 2021
1 parent 3abc6ce commit 35d8e31
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (a UpdateNodeGroupActivity) Execute(ctx context.Context, input UpdateNodeGr
nodeVolumeStorage := input.NodeVolumes.InstanceRoot.Storage
nodeVolumeEncryptionEnabled := ""
nodeVolumeEncryptionKeyARN := ""
nodeVolumeType := ""
nodeVolumeType := "gp3"
nodeVolumeSize := 0

if input.NodeVolumes.InstanceRoot != nil && eks.EBS_STORAGE == input.NodeVolumes.InstanceRoot.Storage {
Expand All @@ -141,7 +141,6 @@ func (a UpdateNodeGroupActivity) Execute(ctx context.Context, input UpdateNodeGr
nodeVolumeEncryptionKeyARN = a.defaultNodeVolumeEncryption.EncryptionKeyARN
}

nodeVolumeType = "gp3"
if input.NodeVolumes.InstanceRoot.Type != "" {
nodeVolumeType = input.NodeVolumes.InstanceRoot.Type
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ func (w UpdateNodePoolWorkflow) Execute(ctx workflow.Context, input UpdateNodePo

if effectiveVolumes.InstanceRoot.Storage == "" {
effectiveVolumes.InstanceRoot.Storage = parameters.NodeVolumeStorage
// set default ebs value for InstanceRoot.Storage for old templates
if currentTemplateVersion.IsLessThan("2.5.0") {
effectiveVolumes.InstanceRoot.Storage = eks.EBS_STORAGE
}
}
// load EBS volume related params only in case storage == ebs
if eks.EBS_STORAGE == effectiveVolumes.InstanceRoot.Storage {
Expand Down
2 changes: 1 addition & 1 deletion internal/cluster/distribution/eks/node_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (n NewNodePool) Validate() error {
}

if n.Volumes.KubeletRoot != nil &&
EBS_STORAGE != n.Volumes.KubeletRoot.Storage && INSTANCE_STORE_STORAGE != n.Volumes.KubeletRoot.Storage ||
EBS_STORAGE != n.Volumes.KubeletRoot.Storage && INSTANCE_STORE_STORAGE != n.Volumes.KubeletRoot.Storage &&
NONE_STORAGE != n.Volumes.KubeletRoot.Storage {
violations = append(violations, "Invalid value specified in `volumes.kubeletRoot.storage`. Valid values are: ebs, instance-storage, none.")
}
Expand Down
4 changes: 4 additions & 0 deletions src/cluster/eks_update_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ func (w EKSUpdateClusterWorkflow) Execute(ctx workflow.Context, input EKSUpdateC

if effectiveVolumes.InstanceRoot.Storage == "" {
effectiveVolumes.InstanceRoot.Storage = parameters.NodeVolumeStorage
// set default ebs value for InstanceRoot.Storage for old templates
if currentTemplateVersion.IsLessThan("2.5.0") {
effectiveVolumes.InstanceRoot.Storage = eks.EBS_STORAGE
}
}
// load EBS volume related params only in case storage == ebs
if eks.EBS_STORAGE == effectiveVolumes.InstanceRoot.Storage {
Expand Down

0 comments on commit 35d8e31

Please sign in to comment.