Skip to content
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

Merged
merged 1 commit into from Jun 19, 2020

Conversation

patrickdillon
Copy link
Contributor

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.

@patrickdillon
Copy link
Contributor Author

/test e2e-azure

/hold
want to see some success in azure CI
my local test stalled on creating a master VM. not sure if that is a result of this PR or a problem with my local azure config

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 17, 2020
session *Session
client *Client
dnsCfg *DNSConfig
CloudName typesazure.CloudEnvironment
Copy link
Member

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.

Copy link
Member

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?

Copy link
Contributor Author

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

@patrickdillon
Copy link
Contributor Author

/hold cancel
looks like my local testing issue has something to do with project/region quotas. it's been awhile since I've spun up azure so I'll double check that

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 17, 2020
@patrickdillon
Copy link
Contributor Author

/hold
bad rebase :(

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 17, 2020
@patrickdillon patrickdillon force-pushed the azure-session branch 2 times, most recently from 0ccff59 to cd3507b Compare June 17, 2020 18:22
@patrickdillon
Copy link
Contributor Author

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 17, 2020
@patrickdillon
Copy link
Contributor Author

/retest

Comment on lines 16 to 17
client *Client
dnsCfg *DNSConfig
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@patrickdillon
Copy link
Contributor Author

/test e2e-azure

@patrickdillon
Copy link
Contributor Author

/retest
/test e2e-azure

session *Session
client *Client
dnsCfg *DNSConfig
cloudName typesazure.CloudEnvironment
Copy link
Contributor

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..

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.
@patrickdillon
Copy link
Contributor Author

/test e2e-azure

@abhinavdahiya
Copy link
Contributor

/appprove
/lgtm

/hold
remove the hold when azure is greenish.

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 18, 2020
@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 18, 2020
@abhinavdahiya
Copy link
Contributor

/approve

@openshift-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 18, 2020
@abhinavdahiya
Copy link
Contributor

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 18, 2020
@abhinavdahiya
Copy link
Contributor

/retest

1 similar comment
@abhinavdahiya
Copy link
Contributor

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jun 19, 2020

@patrickdillon: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/e2e-openstack-upi 6b3bad7 link /test e2e-openstack-upi

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.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 0fc9401 into openshift:master Jun 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants