Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Core] Auto mapping for cluster name #2403
[Core] Auto mapping for cluster name #2403
Changes from 45 commits
b843b33
e06c3b5
575b327
7d7963a
4edc463
7411f53
d65bc3c
30d5e21
fb422cf
15a6c8c
ae7778d
a8a1126
5d1e499
f52f35f
8e68d44
252b528
6af9a6f
35e5823
d450f78
2b64383
b35aec6
c97f37d
0efbf65
0e7ca13
1c19a82
5f2890e
037c332
d69507d
947ee7b
b700b54
bd8f5b6
9f73d58
6c84013
2baf0de
2af8e6f
fef2586
f961e66
2ab3721
3737e95
2a8c32d
7a7073c
8ef7741
c3a0623
193fc6c
62bcef4
3fbf47d
8b7d52e
88207c7
342f72d
9a13119
9c050d0
1d005a2
c6b1166
c84c1ff
9d5aea0
1570851
2aa871b
9a4293a
5b56eee
e027719
086e3e9
fa098be
d48b15d
1a00d07
8d4c87f
d783c09
bacb92e
118965b
00d7250
57ff88f
2c7f159
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we keep the
common_utils.user_and_hostname_hash()
for the case when multiple user uses same cluster name?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
cluster_name_on_cloud
already contains the user hash, so it should be fine to don't have theuser_and_hostname_hash()
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above. This knowledge is leaked. Calling it
make_cluster_name_user_specific()
may mitigate it somewhat.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an argument that decides whether to add user hash to the name. I guess it is ok to call it
make_cluster_name_on_cloud
, without mentioning about the user hash in the name?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be pretty easy for new code/contributors to call provision_lib funcs and pass
cluster_name=cluster_name
. Hard to catch if we don't rename the args in provision_lib interface. Is this too intrusive? Any ideas to mitigate this?One possibility/bandage is to document this clearly at the top of provision_lib.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another potential way is to create a lightweight class and use it in provision_lib interfaces:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great point! I could not think of a better way to mitigate this. I would personally prefer keeping the
cluster_name
inprovision_lib
, and adding a comment at the top ofprovision_lib
and a design doc. I feel like the mapping is backend specific, and may not need to be reflected in the provision APIs.Another alternative (though more involved) is to rename the
handle.cluster_name
tohandle.display_name
and renamehandle.cluster_name_on_cloud
tohandle.cluster_name
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After offline discussion, we now changed the
provision_lib
's APIs to takecluster_name_on_cloud
as an argument.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use
backend_utils.tag_filter_for_cluster
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to keep it here, as we will soon replace this with the
provision_lib
, and thebackend_utils
depends on the cloud module, importing it here sounds like a over-kill.