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

B-515: fix ignored vlan_id #561

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

B-515: fix ignored vlan_id #561

wants to merge 2 commits into from

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

Allow to optionally set a vlan_id value for ovswitch
Related older PR #407

References

Close #515

New or Affected Resource(s)

  • opennebula_virtual_network

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 treywelsh changed the title B #515: fix ignored vlan_id B-515: fix ignored vlan_id Jul 25, 2024
@treywelsh treywelsh requested a review from frousselet August 8, 2024 11:50
Copy link

This pull request is stale because it has been open for 30 days with no activity and it is not in a milestone. Remove 'status: stale' label or comment, or this will be closed in 5 days.

Copy link

This pull request is stale because it has been open for 30 days with no activity and it is not in a milestone. Remove 'status: stale' label or comment, or this will be closed in 5 days.

if d.Get("automatic_vlan_id").(bool) {
tpl.Add("AUTOMATIC_VLAN_ID", "YES")
vlanSet = true
} else if vlanid, ok := d.GetOk("vlan_id"); ok {
Copy link
Contributor

Choose a reason for hiding this comment

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

According to OpenNebula docs on ovswitch vnets, automatic_vlan_id should be ignored in case vlan_id is defined (https://docs.opennebula.io/6.10/open_cluster_deployment/networking_setup/openvswitch.html#defining-open-vswitch-network). Meaning that, if both params are defined, vlan_id should have priority => vlan_id should be checked first

Copy link
Member

Choose a reason for hiding this comment

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

hey @dgarcia18 good catch! In any case, setting both attributes will raise a conflict error in the provider, but I've corrected it just in case and added a test for checking this case 👍🏼

"automatic_vlan_id": conflicts with vlan_id
 Error: Conflicting configuration arguments

@rsmontero rsmontero added this to the 1.4.2 milestone Oct 21, 2024
@dcarracedo dcarracedo requested review from sk4zuzu and aleixrm and removed request for sk4zuzu December 3, 2024 10:05
@rsmontero rsmontero requested review from dgarcia18 and removed request for dgarcia18 December 3, 2024 10:07
@dcarracedo dcarracedo removed the request for review from aleixrm December 3, 2024 10:08
Signed-off-by: Aleix Ramírez <[email protected]>
@aleixrm
Copy link
Member

aleixrm commented Dec 3, 2024

hey @treywelsh I've added @dgarcia18 's suggestion and some tests in this PR: #581

Feel free to take a look and merge it to this branch, I think that with those changes this PR could be merged 👍🏼 Thanks!

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.

vlan_id is ignored with opennebula_virtual_network and ovswitch
6 participants