Skip to content

Commit

Permalink
Make ekctl utils update-aws-node aware of Kubernetes version
Browse files Browse the repository at this point in the history
It needs to pick the right manifest based on the version used.
  • Loading branch information
errordeveloper committed Apr 16, 2019
1 parent b828036 commit 3315d3d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
8 changes: 6 additions & 2 deletions pkg/addons/default/aws_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const (
)

// UpdateAWSNode will update the `aws-node` add-on
func UpdateAWSNode(rawClient kubernetes.RawClientInterface, region string) error {
func UpdateAWSNode(rawClient kubernetes.RawClientInterface, region string, controlPlaneVersion string) error {
_, err := rawClient.ClientSet().AppsV1().DaemonSets(metav1.NamespaceSystem).Get(AWSNode, metav1.GetOptions{})
if err != nil {
if apierrs.IsNotFound(err) {
Expand All @@ -34,7 +34,11 @@ func UpdateAWSNode(rawClient kubernetes.RawClientInterface, region string) error
}

// if DaemonSets is present, go through our list of assets
list, err := LoadAsset(AWSNode, "yaml")
assetName := AWSNode
if strings.HasPrefix(controlPlaneVersion, "1.10.") {
assetName += "-1.10"
}
list, err := LoadAsset(assetName, "yaml")
if err != nil {
return err
}
Expand Down
7 changes: 6 additions & 1 deletion pkg/ctl/utils/update_aws_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,10 @@ func doUpdateAWSNode(p *api.ProviderConfig, cfg *api.ClusterConfig, nameArg stri
return err
}

return defaultaddons.UpdateAWSNode(rawClient, meta.Region)
kubernetesVersion, err := rawClient.ServerVersion()
if err != nil {
return err
}

return defaultaddons.UpdateAWSNode(rawClient, meta.Region, kubernetesVersion)
}

0 comments on commit 3315d3d

Please sign in to comment.