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-476: add marketplace app resource #489

Merged
merged 3 commits into from
Oct 19, 2023
Merged

Conversation

treywelsh
Copy link
Collaborator

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

Add marketplace appliance resource and datasource

References

close #476

New or Affected Resource(s)

  • opennebula_marketplace_app
  • data_opennebula_marketplace_app

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
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation (if needed)
  • I have updated the changelog file

@treywelsh
Copy link
Collaborator Author

treywelsh commented Aug 31, 2023

TODO: add tests, doc, changelog
Note: in the appliance template there's a TAGS section:TAGS><![CDATA[alpine, kubernetes, service, vnf]]></TAGS>
This could be misleading, as said in this issue: #478

@treywelsh treywelsh changed the title F #476: add marketplace app resource F-476: add marketplace app resource Aug 31, 2023
@treywelsh
Copy link
Collaborator Author

treywelsh commented Sep 6, 2023

I have a small problem: I tried to create an app with this TF:

resource "opennebula_marketplace_app" "example" {
  name = "test"
  market_id = "122"
  type = "IMAGE"
  description = "this is an app"
  publisher = "toto"
  version = "0.1.0"
  vmtemplate64 = "REVTQz0idGhpcyBpcyBhIHZtIHRlbXBsYXRlIgo="
  apptemplate64 = "REVTQz0idGhpcyBpcyBhbiBhcHAgdGVtcGxhdGUiCg=="

  tags = {
    custom1 = "value1"
  }
}

It's surely broken, however the create method returns an error and doesn't returns an ID but the app is created in OpenNebula and has ERROR state.
The provider should be able to delete the application but is not without having the app ID.
The XML-RPC method has a return field either used to return an ID, or the error string, it's probably why we don't get an ID but an error message instead. Should the resource be created then ?

To fix this and be able to retrieve the ID, we could add to the appliance a custom field containing an ID string used to identify the resource created, the provider could juste remove this ID later. I already did something like this for the virtual router instances

@treywelsh treywelsh force-pushed the F-476-add-marketplaceapp branch 2 times, most recently from 748fc76 to 83bdaef Compare September 7, 2023 11:07
@treywelsh
Copy link
Collaborator Author

Depends on OpenNebula/one#6312

@treywelsh treywelsh force-pushed the F-476-add-marketplaceapp branch 4 times, most recently from d6321bc to 30fa5be Compare September 18, 2023 13:23
@treywelsh treywelsh force-pushed the F-476-add-marketplaceapp branch 9 times, most recently from 3062f51 to 5527d93 Compare October 11, 2023 09:22
@treywelsh
Copy link
Collaborator Author

5.12 release tests fails because in the acceptance test config I'm testing an appliance type that wasn't supported.
I'm trying to make the acceptance tests for 5.12 to ignore this error to make them pass

@treywelsh treywelsh force-pushed the F-476-add-marketplaceapp branch 6 times, most recently from d9a961b to f23c916 Compare October 17, 2023 15:46
@treywelsh treywelsh marked this pull request as ready for review October 18, 2023 07:36
@frousselet frousselet merged commit 53d6db7 into master Oct 19, 2023
6 checks passed
@frousselet frousselet deleted the F-476-add-marketplaceapp branch October 19, 2023 14:05
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.

Add opennebula_marketplace_app resource and data source
2 participants