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 AdminAPI representation of PreconfiguredNSG status #3933

Merged
merged 4 commits into from
Nov 1, 2024

Conversation

tsatam
Copy link
Collaborator

@tsatam tsatam commented Oct 31, 2024

Which issue this PR addresses:

Fixes ARO-11975

What this PR does / why we need it:

Ensures that the status of the cluster document's networkProfile.preconfiguredNSG property is included on Admin API representations of the document.

Test plan for issue:

  • Ensure AdminAPI representation of clusterdoc includes this property in local env

Is there any documentation that needs to be updated for this PR?

No

How do you know this will function as expected in production?

Testing done above

bennerv
bennerv previously approved these changes Oct 31, 2024
@tsatam
Copy link
Collaborator Author

tsatam commented Oct 31, 2024

/azp run ci,e2e

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

s-fairchild
s-fairchild previously approved these changes Oct 31, 2024
jhoreman
jhoreman previously approved these changes Oct 31, 2024
@tsatam tsatam dismissed stale reviews from jhoreman, s-fairchild, and bennerv via b15a5b3 October 31, 2024 20:00
@github-actions github-actions bot added the needs-rebase branch needs a rebase label Oct 31, 2024
Copy link

Please rebase pull request.

@tsatam tsatam force-pushed the tsatam/hotfix-fix-preconfigurednsg-adminapi branch from b15a5b3 to 90f57cc Compare October 31, 2024 20:03
@github-actions github-actions bot removed the needs-rebase branch needs a rebase label Oct 31, 2024
@tsatam
Copy link
Collaborator Author

tsatam commented Oct 31, 2024

/azp run ci,e2e

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@@ -179,6 +179,7 @@ func (c openShiftClusterConverter) ToExternal(oc *api.OpenShiftCluster) interfac
}

if oc.Identity != nil {
out.Identity = &ManagedServiceIdentity{}
Copy link
Contributor

Choose a reason for hiding this comment

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

You should check if out.Identity == nil or this will clobber anything that is already there. This would have been a 100% panic if out.Identity were always nil. Is it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The out object is created from scratch earlier up in this function (L18-75), so we don't need to worry about clobbering any existing Identity properties, out.Identity is always nil at this point.

Copy link
Contributor

Choose a reason for hiding this comment

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

So are you saying this code would always panic? Your original comment made it seem like it was normally fine and only having a panic in MIWI

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The if statement this line is contained in, if oc.Identity != nil, would only be true for MIWI clusters, but the code within that if block would always panic since out.Identity was always nil.

@tsatam tsatam merged commit 9858073 into master Nov 1, 2024
20 checks passed
tsatam added a commit that referenced this pull request Nov 6, 2024
* Fix spelling of preconfiguredNSG JSON tag

* Copy PreconfiguredNSG property during internal->admin conversion

* Fix nil pointer dereference when converting workload identity cluster doc to adminapi representation

* Update admin openshiftcluster_putorpatch tests to expect property for PreconfiguredNSG
tsatam added a commit that referenced this pull request Nov 6, 2024
* Fix spelling of preconfiguredNSG JSON tag

* Copy PreconfiguredNSG property during internal->admin conversion

* Fix nil pointer dereference when converting workload identity cluster doc to adminapi representation

* Update admin openshiftcluster_putorpatch tests to expect property for PreconfiguredNSG
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.

6 participants