Skip to content

Conversation

@JeffeyL
Copy link
Contributor

@JeffeyL JeffeyL commented Sep 8, 2023

Description: (Copied from issue) When using the Policy Generator, when orderManifests is true, it's a signal that the user wants to have dependencies set for the manifests within. However, consolidateManifests defaults to true, so orderManifests won't really do anything unless consolidateManifests is also set to false. As a convenience, we should set consolidateManifests accordingly so that this implementation detail is abstracted for the user.

Solution: Conditionals were added where consolidateManifests was being set (both default and actual values) to set to false when the corresponding orderManifests value is true.

Ref: https://issues.redhat.com/browse/ACM-5068

@JeffeyL
Copy link
Contributor Author

JeffeyL commented Sep 8, 2023

There were some unrelated unit tests failing when I was testing, will check back to see if this is consistent.

@JeffeyL JeffeyL marked this pull request as ready for review September 8, 2023 16:16
Copy link
Member

@JustinKuli JustinKuli left a comment

Choose a reason for hiding this comment

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

Looks good overall to me!

wantErr: "extraDependencies may not be set in policy one manifest[0] because orderManifests is set",
},
"orderManifests and consolidateManifests is false": {
"orderManifests is true and consolidateManifests is unset": {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: can we add a tiny bit more context to these tests?

Suggested change
"orderManifests is true and consolidateManifests is unset": {
"orderManifests is true in policyDefaults, and consolidateManifests is unset": {

wantFile: "testdata/ordering/three-ordered-manifests.yaml",
wantErr: "",
},
"orderManifests in policy and consolidateManifests is false": {
Copy link
Member

Choose a reason for hiding this comment

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

If we can update this description as well, something like

Suggested change
"orderManifests in policy and consolidateManifests is false": {
"orderManifests is true in policy and consolidateManifests is unset": {

Simple checks added on conditionals for both default and actual values to change consolidateManifests=false

Signed-off-by: Jeffrey Luo <[email protected]>
Copy link
Member

@JustinKuli JustinKuli left a comment

Choose a reason for hiding this comment

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

LGTM

@openshift-ci
Copy link

openshift-ci bot commented Sep 11, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JeffeyL, JustinKuli

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

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