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

Fix set IP block visibility on READ if NSX version too low #1228

Merged
merged 1 commit into from
Jun 7, 2024

Conversation

wsquan171
Copy link
Contributor

This change fixes setting policy IP block visibility on READ if NSX is below 4.2, where the value will always be nil. This will cause tf to always show diff if the resource spec has non-empty value.

Closes #1227

This change fixes setting policy IP block visibility on READ if NSX is
below 4.2, where the value will always be nil. This will cause tf to
always show diff if the resource spec has non-empty value.

Closes vmware#1227

Signed-off-by: Shawn Wang <shawn.wang@broadcom.com>
@wsquan171 wsquan171 requested a review from ksamoray June 5, 2024 21:51
@ksamoray
Copy link
Collaborator

ksamoray commented Jun 6, 2024

LGTM, would like @annakhm to have a look as well as this behavior is not consistent throughout the provider code.
Maybe we could at least warn that this attribute has been ignored?

Copy link
Member

@salv-orlando salv-orlando left a comment

Choose a reason for hiding this comment

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

LGTM!

@annakhm
Copy link
Collaborator

annakhm commented Jun 6, 2024

What happens in NSX 4.2 if this setting is unspecified? Does NSX send back a default?

@wsquan171
Copy link
Contributor Author

@annakhm this param is unknown to NSX < 4.2. On read it will be empty value, and if included on write it will error.

@annakhm
Copy link
Collaborator

annakhm commented Jun 6, 2024

@annakhm this param is unknown to NSX < 4.2. On read it will be empty value, and if included on write it will error.

My question was for NSX 4.2. This param is optional, so user can skip it. However, for such enumerations NSX would normally send back a default (not always though). I wanted to verify we don't need to set this param as Computed for NSX 4.2, regardless of earlier version

@wsquan171
Copy link
Contributor Author

I wanted to verify we don't need to set this param as Computed for NSX 4.2, regardless of earlier version

For NSX 4.2, if the value is unset, NSX will send back as-is (also unset). This doesn't need to be computed.

@wsquan171 wsquan171 merged commit ff9f397 into vmware:master Jun 7, 2024
3 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
Development

Successfully merging this pull request may close these issues.

visibility not set on creation of nsxt_policy_ip_block
4 participants