Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Fix the issue that the VMSS upgrading doesn't work if the topology do… #3665

Merged
merged 4 commits into from
Aug 14, 2018
Merged

Fix the issue that the VMSS upgrading doesn't work if the topology do… #3665

merged 4 commits into from
Aug 14, 2018

Conversation

chengliangli0918
Copy link
Contributor

…esn't have master nodes

What this PR does / why we need it:

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Special notes for your reviewer:

If applicable:

  • documentation
  • unit tests
  • tested backward compatibility (ie. deploy with previous version, upgrade with this branch)

Release note:

@@ -383,6 +385,43 @@ func (ku *Upgrader) upgradeAgentPools(ctx context.Context) error {
}

func (ku *Upgrader) upgradeAgentScaleSets(ctx context.Context) error {
if len(ku.ClusterTopology.AgentPoolScaleSetsToUpgrade) != 0 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be > 0, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the comments, I will change it to > 0 in next iteration.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed '!= 0' to '> 0' according to the comment

@codecov
Copy link

codecov bot commented Aug 13, 2018

Codecov Report

Merging #3665 into master will decrease coverage by 0.14%.
The diff coverage is 0%.

@@            Coverage Diff             @@
##           master    #3665      +/-   ##
==========================================
- Coverage   55.72%   55.57%   -0.15%     
==========================================
  Files         108      108              
  Lines       16026    16049      +23     
==========================================
- Hits         8930     8919      -11     
- Misses       6329     6363      +34     
  Partials      767      767


random := rand.New(rand.NewSource(time.Now().UnixNano()))
deploymentSuffix := random.Int31()
deploymentName := fmt.Sprintf("agentscaleset-%s-%d", time.Now().Format("06-01-02T15.04.05"), deploymentSuffix)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

time.Now().Format("06-01-02T15.04.05") why is the timestamp hardcoded here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not hardcoded timestamp, it defines a format to change the time.Now() to string, e.g. 18-08-12T22.33.17.
This new line just follows the existing pattern used on Line 59 in pkg\operations\kubernetesupgrade\upgradeagentnode.go

deploymentName := fmt.Sprintf("master-%s-%d", time.Now().Format("06-01-02T15.04.05"), deploymentSuffix)

@@ -383,6 +385,43 @@ func (ku *Upgrader) upgradeAgentPools(ctx context.Context) error {
}

func (ku *Upgrader) upgradeAgentScaleSets(ctx context.Context) error {
if len(ku.ClusterTopology.AgentPoolScaleSetsToUpgrade) > 0 {
// need to apply the ARM template with target kubernets version to the VMSS first in order that the new VMSS instances
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kubernets --> Kubernetes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, thanks. Fix it in commit 3.

if len(ku.ClusterTopology.AgentPoolScaleSetsToUpgrade) > 0 {
// need to apply the ARM template with target Kubernetes version to the VMSS first in order that the new VMSS instances
// created can get the expected Kubernetes version. Otherwise the new instances created still have old Kubernetes version
// if the topology dosn't have master nodes(so there is no ARM deployments in previous upgradeMasterNodes step)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the last line should be if the topology doesn't have master nodes (so there are no ARM deployments in previous upgradeMasterNodes step)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, thank you. Changed in commit 4.

@jackfrancis
Copy link
Member

/lgtm pending vmss upgrade tests (out of band)

@acs-bot
Copy link

acs-bot commented Aug 14, 2018

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chengliangli0918, jackfrancis

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jackfrancis jackfrancis merged commit a81db34 into Azure:master Aug 14, 2018
@ghost ghost removed the in progress label Aug 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants