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
pkg/asset/installconfig/azure: create reusable session #3767
pkg/asset/installconfig/azure: create reusable session #3767
Conversation
/test e2e-azure /hold |
session *Session | ||
client *Client | ||
dnsCfg *DNSConfig | ||
CloudName typesazure.CloudEnvironment |
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.
Is it worth putting this behind a getter to show that the value is immutable? Or do we trust consumers to play nice? Whatever the public API is, it should have a good comment.
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.
Hmm, I don't actually see a consumer on a quick skim. Maybe we can use cloudName
with no getter?
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.
Is it worth putting this behind a getter to show that the value is immutable? Or do we trust consumers to play nice?
Also I think this does not need to be exported. CloudName should be available in the platform
/hold cancel |
5880e4f
to
6b3bad7
Compare
/hold |
0ccff59
to
cd3507b
Compare
/hold cancel |
/retest |
client *Client | ||
dnsCfg *DNSConfig |
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.
why create these? users can create these using the session right?
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.
Creating these just reduces repeated code. Both Client
and DNSConfig
are just wrappers around Session
, they contain no other state besides a non-exported session. I stopped short of refactoring them away entirely and opted instead to streamline their creation like this.
cd3507b
to
cfe55ce
Compare
/test e2e-azure |
cfe55ce
to
8cf66b2
Compare
/retest |
session *Session | ||
client *Client | ||
dnsCfg *DNSConfig | ||
cloudName typesazure.CloudEnvironment |
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.
So we need this information to re-generate a session. When install config is stored in the state it will not be stored in state and when we need the cloud after loading install config asset from state we will no longer have the cloudName configured.
Any information that is required to create a new metadata must be Serialized to json..
8cf66b2
to
81acac5
Compare
This commit creates an Azure metadata struct in the installconfig asset (similar to AWS) and stores an Azure session and clients for interacting with the Azure API. This commit also refactors existing code to use this functionality rather than plumbing the install config values repeatedly.
81acac5
to
faea85f
Compare
/test e2e-azure |
/appprove /hold |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abhinavdahiya 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 |
/hold cancel |
/retest |
1 similar comment
/retest |
/retest Please review the full test history for this PR and help us cut down flakes. |
1 similar comment
/retest Please review the full test history for this PR and help us cut down flakes. |
@patrickdillon: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/retest Please review the full test history for this PR and help us cut down flakes. |
1 similar comment
/retest Please review the full test history for this PR and help us cut down flakes. |
This commit creates an Azure metadata struct in the installconfig asset
(similar to AWS) and stores an Azure session and clients for interacting
with the Azure API. This commit also refactors existing code to use
this functionality rather than plumbing the install config values repeatedly.