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

ARO-6425 v20240812preview validation #3563

Merged
merged 19 commits into from
May 21, 2024

Conversation

yithian
Copy link
Collaborator

@yithian yithian commented May 7, 2024

Which issue this PR addresses:

For ARO-6425

What this PR does / why we need it:

Adds static validation for new API fields added in v20240812preview

Test plan for issue:

Includes unit tests for the new static validation features.

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

No, this is just static validation to ensure inputs are as expected.

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

Unit test data has been written to match expected inputs but nonetheless this should be tested in a lower environment before being pushed to production

@yithian yithian changed the title Aro 6425 v20240812preview validation ARO-6425 v20240812preview validation May 7, 2024
@github-actions github-actions bot added the needs-rebase branch needs a rebase label May 7, 2024
Copy link

github-actions bot commented May 7, 2024

Please rebase pull request.

@yithian yithian force-pushed the ARO-6425_v20240812preview_validation branch from f4314dd to f7a880b Compare May 7, 2024 18:53
@cadenmarchese cadenmarchese added the chainsaw Pull requests or issues owned by Team Chainsaw label May 10, 2024
As these functions don't really fit into any of the util packages and
are only used in one place each, this commit removes those functions and
in-lines their code in the places they were called
@yithian yithian force-pushed the ARO-6425_v20240812preview_validation branch from 4b95ad8 to ca9536a Compare May 13, 2024 13:22
PlatformWorkloadIdentities: []PlatformWorkloadIdentity{
{
OperatorName: "FAKE-OPERATOR",
ResourceID: "/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/a-fake-group/providers/Microsoft.RedHatOpenShift/userAssignedIdentities/fake-cluster-name",
Copy link
Collaborator

Choose a reason for hiding this comment

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

should this be Microsoft.ManagedIdentity/userAssignedIdentities?
same for other test cases.

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 regexp the resourceID is being compared against is at pkg/api/v20240812preview/openshiftcluster_validatestatic.go line 430

The specific provider for the resource ID isn't being checked, just that the string is formatted like a resource ID at all. I can change the value in the test cases to Microsoft.ManagedIdentity if you'd like

… IDs

This requires a refactor of ParseArmResourceId() to allow for resource
IDs without a subresource
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.

Made another review pass since there are a lot of details to inspect and you've made some changes since my last review. I suggested a few small changes and started a group discussion about a piece that I'm unsure about.

pkg/util/arm/resources.go Outdated Show resolved Hide resolved
pkg/util/arm/resources.go Outdated Show resolved Hide resolved
pkg/util/arm/resources.go Show resolved Hide resolved
yithian and others added 4 commits May 17, 2024 07:58
@cadenmarchese
Copy link
Collaborator

/azp run ci,e2e

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

kimorris27

This comment was marked as outdated.

@kimorris27 kimorris27 dismissed their stale review May 20, 2024 13:20

Dismissing my own approving review because I realized I missed an open comment.

@kimorris27
Copy link
Contributor

Thanks for being flexible and responding to all of the suggestions quickly. Will LGTM once Caden's last comment is addressed.

Copy link
Collaborator

@cadenmarchese cadenmarchese left a comment

Choose a reason for hiding this comment

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

lgtm!

@cadenmarchese
Copy link
Collaborator

/azp run ci,e2e

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@cadenmarchese cadenmarchese merged commit e71343a into master May 21, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chainsaw Pull requests or issues owned by Team Chainsaw ready-for-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants