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

F-498: add support for passwd and random_passwd arguments #499

Merged
merged 1 commit into from
Jan 19, 2024

Conversation

grossibr
Copy link
Contributor

@grossibr grossibr commented Oct 19, 2023

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for PR followers and do not help prioritize the request

Description

Adds support for passwd and random_passwd arguments for graphics section for VNC so we avoid the following:

│ Error: Unsupported argument
│
│ on ../../_modules/instance/instance.tf line 33, in resource "opennebula_virtual_machine" "instance":
│ 33: passwd = substr(base64encode(random_string.password.result), 0, 8)
│
│ An argument named "passwd" is not expected here.
<!--- Please leave a helpful description of the PR here. --->

References

#498: Add passwd and random_passwd arguments for opennebula_virtual_machine and opennebula_template graphics sections

New or Affected Resource(s)

  • opennebula_virtual_machine
  • opennebula_template

Checklist

  • I have created an issue and I have mentioned it in References
  • My code follows the style guidelines of this project (use go fmt)
  • My changes generate no new warnings or errors
  • I have updated the unit tests and they pass succesfuly - NA
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation (if needed)
  • I have updated the changelog file

opennebula/shared_schemas.go Outdated Show resolved Hide resolved
opennebula/shared_schemas.go Outdated Show resolved Hide resolved
@grossibr
Copy link
Contributor Author

@frousselet may I ask you to approve the flows once more?

@frousselet
Copy link
Collaborator

Done, @axbgrossi :)

@grossibr grossibr changed the title [WIP] add support to passwd field F-498: add support to passwd field Oct 31, 2023
@grossibr grossibr marked this pull request as ready for review October 31, 2023 13:46
@grossibr
Copy link
Contributor Author

@frousselet once more if you're available, please

@grossibr grossibr changed the title F-498: add support to passwd field F-498: add support to passwd and random_passwd arguments Oct 31, 2023
@grossibr grossibr changed the title F-498: add support to passwd and random_passwd arguments F-498: add support for passwd and random_passwd arguments Oct 31, 2023
@grossibr
Copy link
Contributor Author

grossibr commented Nov 1, 2023

CI / Test OpenNebula 5.12 error seems unrelated to the changes in this PR, please resume with review

@grossibr
Copy link
Contributor Author

@treywelsh @frousselet will this be merged by you maintainers when the time comes?

@grossibr
Copy link
Contributor Author

grossibr commented Dec 4, 2023

@frousselet please consider reviewing this PR so we can finally close that issue

Copy link
Collaborator

@frousselet frousselet left a comment

Choose a reason for hiding this comment

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

Hello @axbgrossi,

Thanks for your work.

If I understand the documentation, random password should be a boolean (then converted in a 'YES' or a 'NO' string by the provider).
The way you did is a good start but it might be too permissive.

Also, both passwd and random_passwd should conflict with each other.

@grossibr
Copy link
Contributor Author

@frousselet could you please approve the workflows?

@grossibr grossibr force-pushed the master branch 2 times, most recently from 251027e to b3bd076 Compare December 14, 2023 18:11
@grossibr
Copy link
Contributor Author

@frousselet would you be kind to approve the workflows once more?

Copy link
Collaborator

@frousselet frousselet left a comment

Choose a reason for hiding this comment

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

Hi @axbgrossi,

Thanks for your work!

There is a SDK native ConflictsWith argument you can use to natively deal with conflicting attributes.

opennebula/shared_schemas.go Outdated Show resolved Hide resolved
website/docs/r/template.html.markdown Outdated Show resolved Hide resolved
website/docs/r/virtual_machine.html.markdown Outdated Show resolved Hide resolved
@grossibr
Copy link
Contributor Author

@frousselet would you please approve the flows once more?

@grossibr
Copy link
Contributor Author

grossibr commented Jan 2, 2024

@frousselet once more please

@treywelsh
Copy link
Collaborator

Seems due to the ConflictsWith: their values targets nested Graphics attributes, not attributes at the root of the schema.
So try something "graphics.0.passwd" and "graphics.0.random_passwd". It's ok because Graphics is a typelist with a maximum of 1 element

@grossibr
Copy link
Contributor Author

Seems due to the ConflictsWith: their values targets nested Graphics attributes, not attributes at the root of the schema. So try something "graphics.0.passwd" and "graphics.0.random_passwd". It's ok because Graphics is a typelist with a maximum of 1 element

done, @treywelsh or @frousselet could you please approve the flows?

@frousselet
Copy link
Collaborator

frousselet commented Jan 19, 2024

Hello @axbgrossi,

Thanks a lot for your work.
Could you rebase with master and solve merge conflicts please?

Then I will be able to merge and include it in the 1.4.0 release.

@frousselet frousselet merged commit 387fe01 into OpenNebula:master Jan 19, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants