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

azure: enable CustomData if the userdata has cloud-init format #546

Merged
merged 1 commit into from
Aug 8, 2024

Conversation

ader1990
Copy link
Contributor

@ader1990 ader1990 commented Aug 1, 2024

Currently, see: flatcar/Flatcar#656, Flatcar on Azure does not support the Azure Virtual Machine feature AzureVM-UserData (https://learn.microsoft.com/en-us/azure/virtual-machines/user-data) enabled when the userdata is in cloud-init (cloud-config) format. It requires the Azure Virtual Machine feature called AzureVM-CustomData (https://learn.microsoft.com/en-us/azure/virtual-machines/custom-data) to be enabled. Yes, I know, confusing.

This change fixes the flakiness in the cl.cloudinit.basic Mantle test, which sometimes was run with AzureVMUserData enabled.

Patch made by @jepio.

Fixes: flatcar/Flatcar#1505

@@ -164,7 +165,7 @@ func (a *API) getVMParameters(name, userdata, sshkey, storageAccountURI string,
// I don't think it would be an issue to have empty user-data set but better
// to be safe than sorry.
if ud != "" {
if a.Opts.UseUserData {
if a.Opts.UseUserData && (userdata.IsIgnition() || userdata.IsEmpty()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

That's interesting because we already have a check for empty user data:

// I don't think it would be an issue to have empty user-data set but better
// to be safe than sorry.
if ud != "" {

Copy link
Member

Choose a reason for hiding this comment

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

good point, so the IsEmpty() check can be removed.

@ader1990 would you ensure this PR gets merged?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hello, the PR looks good and was tested by github actions from the /scripts repository.
The IsEmpty() check is performed also in the IsIgnition(), I will remove it. I don't think there is the need for another full rerun after the IsEmpty removal?

Co-authored-by: Jeremi Piotrowski <[email protected]>
Signed-off-by: Adrian Vladu <[email protected]>
@ader1990 ader1990 force-pushed the ader1990/fix_azure_userdata branch from 7217492 to 87bd3f4 Compare August 7, 2024 12:18
@ader1990 ader1990 merged commit b94c871 into flatcar-master Aug 8, 2024
2 checks passed
@tormath1 tormath1 deleted the ader1990/fix_azure_userdata branch August 8, 2024 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mantle test cl.cloudinit.basic sometimes fails on Azure
3 participants