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

Add tenant ID to internal apis for CMSI usage #3655

Merged
merged 13 commits into from
Jul 4, 2024
Merged

Add tenant ID to internal apis for CMSI usage #3655

merged 13 commits into from
Jul 4, 2024

Conversation

niontive
Copy link
Collaborator

Which issue this PR addresses:

Part of issue ARO 8606

What this PR does / why we need it:

  • It's possible for MSI dataplane to not return tenant ID in request for managed identity. We're expected to use the header from ARM, so persist this.

Test plan for issue:

Unit test

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

No

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

@niontive
Copy link
Collaborator Author

Using #3514 as inspiration

Copy link
Contributor

@kimorris27 kimorris27 left a comment

Choose a reason for hiding this comment

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

LGTM! My only comment is the tiniest nit.

pkg/frontend/openshiftcluster_putorpatch.go Outdated Show resolved Hide resolved
@kimorris27
Copy link
Contributor

/azp run ci, e2e

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@kimorris27
Copy link
Contributor

E2E failed with what appear to be flakes. I'm going to investigate a bit and see if I can card up some tickets to address them, but in the meantime, I'll trigger E2E again.

@kimorris27
Copy link
Contributor

/azp run e2e

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@kimorris27
Copy link
Contributor

At least one of the flakes seems to be related to some PIP configs that got into a Failed provisioning state somehow. I also saw HTTP connections that were dropped between the E2E agent and the cluster API. I couldn't find anything in ARM logs to explain what I saw, and the Azure resources from the last E2E run are already gone, so I think we'll have to let this one go.

Copy link
Collaborator

@mociarain mociarain left a comment

Choose a reason for hiding this comment

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

LGTM, just looking for some clarity on the TODOs

Comment on lines +60 to +61
// TODO - refactor this function to reduce the number of parameters
func (f *frontend) _putOrPatchOpenShiftCluster(ctx context.Context, log *logrus.Entry, body []byte, correlationData *api.CorrelationData, systemData *api.SystemData, path, originalPath, method, referer string, header *http.Header, converter api.OpenShiftClusterConverter, staticValidator api.OpenShiftClusterStaticValidator, subId, resourceProviderNamespace string, apiVersion string, identityURL string, identityTenantID string) ([]byte, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I feel we often leave these types of comments with the best intentions but then never loop back on them.

From just jumping into this I would think we need a little struct here but maybe I'm missing something? I get not adding it here to reduce the PR complexity but could we have a branch off this with the refactor so we know it's all going to go together?

Happy to pair on this too if that helps :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't have bandwidth at the moment to tackle this refactor. On top of that, I'm not the best person to work on this since I don't own the frontend code.

I'll defer to @bennerv and @hlipsig for this.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I had a little play with it and I think I see where you're coming from. Lots of cans and lots of worms. I opened a small refactror PR here that hopefully helps the next person who comes along and I'm okay to leave it there for now.

Also AFAIK we all own all the code, there are no specific teams that own any part of the codebase but do correct me if I'm wrong.

pkg/frontend/openshiftcluster_putorpatch.go Show resolved Hide resolved
@mociarain mociarain merged commit 6b91187 into master Jul 4, 2024
22 checks passed
@mociarain mociarain deleted the ARO-8608 branch July 4, 2024 08:51
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.

5 participants