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

Preflight update and tests #3686

Merged
merged 1 commit into from
Jul 18, 2024
Merged

Conversation

carvalhe
Copy link
Contributor

Which issue this PR addresses:

Fixes https://issues.redhat.com/browse/ARO-3854

What this PR does / why we need it:

Currently we have preflight set up for create operations but also need it for update. These changes allow for both put/patch operations on preflight. This PR also cleans up the way we validate for preflight and adds new checks for it as well. There was a previous PR for this here: #3365 but it was getting messy, and needed to move off the forked branch so that E2E tests would work correctly.

Test plan for issue:

Created additional unit tests that are similar to put/patch tests. Kusto logs also show preflight success and failures with more details than before. Preflight is also marked for testing and won't hit live until another PR in the future sets that value.

@cadenmarchese
Copy link
Collaborator

/azp run ci,e2e

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

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!

Copy link
Collaborator

@SudoBrendan SudoBrendan left a comment

Choose a reason for hiding this comment

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

Thanks for the continued work here! I don't have anything blocking, but I think updating the SprintF to a template execution could be warranted here if desired.

Comment on lines +85 to +95
`, apiVersion, clusterId, api.ExampleOpenShiftClusterDocument().OpenShiftCluster.Name,
api.ExampleOpenShiftClusterDocument().OpenShiftCluster.Type,
location, defaultProfile, resourceGroup, api.EncryptionAtHostEnabled, version.DefaultInstallStream.Version.String(),
mockSubID, mockSubID, netProfile, netProfile, api.VMSizeStandardD32sV3, masterSub,
api.EncryptionAtHostEnabled, encryptionSet,
api.ExampleOpenShiftClusterDocument().OpenShiftCluster.Properties.WorkerProfiles[0].Name, api.VMSizeStandardD32sV3,
api.ExampleOpenShiftClusterDocument().OpenShiftCluster.Properties.WorkerProfiles[0].DiskSizeGB,
api.EncryptionAtHostEnabled, workerSub,
api.ExampleOpenShiftClusterDocument().OpenShiftCluster.Properties.WorkerProfiles[0].Count,
encryptionSet, api.VisibilityPublic, defaultProfile, api.VisibilityPublic,
api.ExampleOpenShiftClusterDocument().OpenShiftCluster.Properties.IngressProfiles[0].IP))
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: 28 ordered parameters is going to be hard to maintain over time - if it's easy enough, can we convert this to a golang string template, and then populate it with named parameters rather than ordered ones?

Resources: []json.RawMessage{
[]byte(fmt.Sprintf(`
{
"apiVersion": "%s",
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: same as above - now thinking this should be wrapped in a function call, where you pass it a map of variables.

@cadenmarchese
Copy link
Collaborator

Merging with approvals for now, but @carvalhe let's try and get Brendan's ideas in a separate PR if possible. Thanks!

@cadenmarchese cadenmarchese merged commit e7b3fe6 into master Jul 18, 2024
20 checks passed
@mociarain mociarain deleted the bcarvalhiera/preflight_fix branch July 18, 2024 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants