Skip to content
This repository was archived by the owner on Oct 24, 2023. It is now read-only.

fix: add a ClusterName property and use it for resources names#202

Closed
sylr wants to merge 2 commits intoAzure:masterfrom
sylr:resources-renaming
Closed

fix: add a ClusterName property and use it for resources names#202
sylr wants to merge 2 commits intoAzure:masterfrom
sylr:resources-renaming

Conversation

@sylr
Copy link
Contributor

@sylr sylr commented Dec 26, 2018

What this PR does / why we need it:

Rebase a branch we used at my company to fix the name of the resources.

It adds a property clusterName which is used to prefix the name of all Azure resources, e.g. : clusterName = k8s-prod -> k8s-prod-master-0, k8s-prod-master-1 ... etc

If no clusterName is provided the prefix of the resources falls back to (k8s|aks)-<clusterId>.

Which issue this PR fixes : fixes #56

Special notes for your reviewer:

Release note:

Add a clusterName property which is used to prefix all Azure resources. 

@acs-bot acs-bot added the size/M label Dec 26, 2018
@sylr sylr force-pushed the resources-renaming branch from 46bf3d4 to 698462d Compare December 26, 2018 11:51
@acs-bot acs-bot added size/L and removed size/M labels Dec 26, 2018
@sylr sylr force-pushed the resources-renaming branch 6 times, most recently from 07916b5 to e330a58 Compare December 26, 2018 13:22
@codecov
Copy link

codecov bot commented Dec 26, 2018

Codecov Report

Merging #202 into master will decrease coverage by 0.02%.
The diff coverage is 78.94%.

@@            Coverage Diff             @@
##           master     #202      +/-   ##
==========================================
- Coverage   53.21%   53.19%   -0.03%     
==========================================
  Files          95       95              
  Lines       14230    14239       +9     
==========================================
+ Hits         7573     7574       +1     
- Misses       5991     5997       +6     
- Partials      666      668       +2

1 similar comment
@codecov
Copy link

codecov bot commented Dec 26, 2018

Codecov Report

Merging #202 into master will decrease coverage by 0.02%.
The diff coverage is 78.94%.

@@            Coverage Diff             @@
##           master     #202      +/-   ##
==========================================
- Coverage   53.21%   53.19%   -0.03%     
==========================================
  Files          95       95              
  Lines       14230    14239       +9     
==========================================
+ Hits         7573     7574       +1     
- Misses       5991     5997       +6     
- Partials      666      668       +2

@codecov
Copy link

codecov bot commented Dec 26, 2018

Codecov Report

Merging #202 into master will increase coverage by <.01%.
The diff coverage is 60%.

@@            Coverage Diff             @@
##           master     #202      +/-   ##
==========================================
+ Coverage   53.25%   53.25%   +<.01%     
==========================================
  Files          95       95              
  Lines       14246    14259      +13     
==========================================
+ Hits         7586     7594       +8     
- Misses       5995     5998       +3     
- Partials      665      667       +2

@sylr sylr force-pushed the resources-renaming branch 4 times, most recently from 51519f5 to 46bf3d4 Compare December 26, 2018 15:50
@acs-bot acs-bot added size/M and removed size/L labels Dec 26, 2018
@sylr sylr force-pushed the resources-renaming branch from 46bf3d4 to dc15b94 Compare December 26, 2018 15:51
@acs-bot acs-bot added size/L and removed size/M labels Dec 26, 2018
@tariq1890
Copy link
Contributor

@sylr Looks like the PR has some changes to fix goimports errors. Can they be excluded from this PR?

@sylr
Copy link
Contributor Author

sylr commented Dec 26, 2018 via email

@sylr
Copy link
Contributor Author

sylr commented Dec 26, 2018

@tariq1890 can you approve the e2e checks on circleci, I'll remove the goimports patch tomorrow.

no_output_timeout: "30m"
- store_artifacts:
path: /go/src/github.com/Azure/aks-engine/_logs
- store_artifacts:
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need this? We had removed this as a part of this PR - Azure/acs-engine#4214

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added this for debug purposes.

Why did you remove it ?

Copy link
Contributor

Choose a reason for hiding this comment

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

@jackfrancis may be the right person to ask for this. I believe this was found as unnecessary since we would run our e2e's locally if we were to inspect the outputs.

Copy link
Contributor

Choose a reason for hiding this comment

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

let's revert adding this back - circle ci is not used anymore

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

pkg/api/types.go Outdated
}

// GetPrefix returns resource prefix based on Properties
func (p *Properties) GetPrefix() (ret string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

GetPrefix is too vague, let's have something specific. GetClusterPrefix would work IMO. Also open to other names :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

GetClusterName ?

@tariq1890
Copy link
Contributor

@sylr Done!

@sylr sylr force-pushed the resources-renaming branch 2 times, most recently from 2e8cfbb to aa66793 Compare December 27, 2018 09:31
@sylr sylr changed the title Add a clusterName property and use it for resources name Add a ClusterName property and use it for resources names Dec 27, 2018
@sylr
Copy link
Contributor Author

sylr commented Dec 27, 2018

/assign @tariq1890

"--resource-group", a.ResourceGroup.Name,
"--template-file", e.Config.GeneratedTemplatePath,
"--parameters", e.Config.GeneratedParametersPath)
"--parameters", e.Config.GeneratedParametersPath,
Copy link
Contributor

Choose a reason for hiding this comment

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

Assuming these were added for debugging and not meant to be included in the PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually I think it would be good to merge this as it gives complete error messages if anything goes wrong instead of a correlation id you can't use.

@acs-bot
Copy link

acs-bot commented Dec 28, 2018

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sylr
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: tariq1890

If they are not already assigned, you can assign the PR to them by writing /assign @tariq1890 in a comment when ready.

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

The pull request process is described here

Details 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

@mboersma mboersma changed the title Add a ClusterName property and use it for resources names fix: add a ClusterName property and use it for resources names Dec 31, 2018
@jackfrancis
Copy link
Member

@sylr Can you kindly add a detailed description of the changes in the PR?

@sylr
Copy link
Contributor Author

sylr commented Jan 2, 2019

@jackfrancis done

@jackfrancis
Copy link
Member

Thanks for this @sylr

The change as-is is breaking. E.g.:

Before:

"masterVMNamePrefix": "k8s-master-63250626-",

After:

"masterVMNamePrefix": "k8s-63250626-master-",

We should make as a requirement of this change that it be non-breaking when the clusterName property is not used.

@sylr
Copy link
Contributor Author

sylr commented Jan 7, 2019

@jackfrancis I disagree on this.

We shouldn't have resources with different name patterns.

@jackfrancis
Copy link
Member

@sylr I'm not sure what you mean. The important thing, to preserve backwards-compatibility, is that any new change like this not effect previous usage patterns. In this specific case, we need to make sure that the vm name generation implementation produces the same output as it did before when this new feature is not enabled.

Sylvain Rabot added 2 commits January 8, 2019 11:37
Signed-off-by: Sylvain Rabot <s.rabot@lectra.com>
Signed-off-by: Sylvain Rabot <s.rabot@lectra.com>
@sylr sylr force-pushed the resources-renaming branch from 639b118 to 7235c32 Compare January 8, 2019 10:37
@stale
Copy link

stale bot commented Feb 7, 2019

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

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.

Enable user-configurable vm names

5 participants