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
cc_ubuntu_advantage: Implement custom auto-attach behaviors #1583
Conversation
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.
Thanks for pulling a sample PR together for discussion @aciba90 I think we need a bit of UA-dev team input on these new API functions/signature and behavior to make progress on this.
6154d4d
to
2c33e8c
Compare
This PR would benefit from the inclusion of #1604 in order to easily allocate Ubuntu Pro instances for integration-testing. |
8d082aa
to
c7d411b
Compare
Hello! Thank you for this proposed change to cloud-init. This pull request is now marked as stale as it has not seen any activity in 14 days. If no activity occurs within the next 7 days, this pull request will automatically close. If you are waiting for code review and you are seeing this message, apologies! Please reply, tagging TheRealFalcon, and he will ensure that someone takes a look soon. (If the pull request is closed and you would like to continue working on it, please do tag TheRealFalcon to reopen it.) |
c7d411b
to
f058e60
Compare
0b521e2
to
63b1b93
Compare
}, | ||
"config": { | ||
"type": "object", | ||
"description": "Configuration settings or override Ubuntu Advantage config", | ||
"description": "Configuration settings or override Ubuntu Advantage config. Only used in non Ubuntu Pro instances.", |
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.
During the implementation of canonical/ubuntu-pro-client#2171, it was possible to pass an UAConfig
instance (containing this config) to full_auto_attach. But this did not get to the merged commit. Is there an alternative way to pass the config? Or is it not necessary to do so in Pro instances? @CalvoM
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.
We have a way of passing the UAConfig to the endpoint via _full_auto_attach. However, we recommend that you use the endpoint not requiring the UAConfig parameter, since we create the object internally. You can use the other endpoint, when you have some custom configuration for UAConfig default object.
d39c5d7
to
da62b7c
Compare
I have integrated the future UA API to execute I have executed the following test: tox -e integration-test -- tests/integration_tests/modules/test_ubuntu_advantage.py::TestUbuntuAdvantagePro and verified that This PR is ready to be reviewed. @blackboxsw, @CalvoM. |
- Rename _is_pro to _should_auto_attach - Improve logging in _shold_auto_attach - Improve doc
e219c0d
to
5ed0aa4
Compare
configure_ua( | ||
token=token, | ||
enable=ua_section.get("enable"), | ||
config=ua_section.get("config"), |
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.
@aciba90 I just realized one big gap in this implementation is that we are only invoking ua config *http_proxy*
values on non-PRO instances. I think we actually need this feature to override proxy config for both PRO and non-PRO instances, so this may involve a bit of a refactor to ensure both PRO instances and can still manipulate proxy values prior to auto-attach of plain attach.
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 do think the one final review blocking this PR is that auto_attach (PRO) images still need to be able to specify 'config' settings. Can you please factor that out to a function that both auto_attach and _attach
can separately call before performing their attach logic? Without this refactor, this represents a regression in current behavior of PRO images which can currently specify ubuntu_advantage:config
settings to configure proxy vars.
If you wish to take that refactor as a separate PR that follows this one I'm fine with that. We just need to make sure we don't release until PRO can support ubuntu_advantage.config
Per #1583 (comment) I did wrongly understand there was not an alternative way to set the UA config up for I am working on it and I have found some bugs related to the config validation and processing, therefore I would suggest including it as a follow-up PR, as this one is getting considerable big. |
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.
Thanks @aciba90 let's then land this and iterate on the config handling before pushing a release into kinetic.
Proposed Commit Message
Additional Context
SC-1145
SC-1149
canonical/ubuntu-pro-client#2166
canonical/ubuntu-pro-client#2171
Test Steps
# Run it in gce, azure or ec2 (only clouds providing Pro images) tox -e integration-test -- tests/integration_tests/modules/test_ubuntu_advantage.py::TestUbuntuAdvantagePro
Checklist: