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

Set pending state on policies if dependencies are not met + remove template #11

Conversation

willkutler
Copy link
Contributor

@willkutler willkutler commented Oct 31, 2022

Adds logic to determine whether a policy template should be pending based on whether its dependencies are satisfied. If a template should be pending, these changes will remove it from the managed cluster and set the status of the parent policy to Pending.

https://github.com/stolostron/backlog/issues/26188
https://github.com/stolostron/backlog/issues/26189

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.

Looking good overall! I have a lot of somewhat optional comments, and only one that I think actually would require a change: whether we can use allDeps, or whether we need a tmplDeps variable.

controllers/statussync/policy_status_sync.go Outdated Show resolved Hide resolved
controllers/templatesync/template_sync.go Outdated Show resolved Hide resolved
Comment on lines 289 to 293
// set up namespace for replicated policy dependencies
ns := dep.Namespace
if ns == "" {
ns = r.ClusterNamespaceOnHub
}
Copy link
Member

Choose a reason for hiding this comment

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

I think if in the future we have (or support a 3rd party) policy type that is cluster-scoped, we would want to guard this so that we only set the namespace when it's one of our known types. But I don't know if that would even cause those types problems, so it's definitely not necessary to make any changes right now.

controllers/templatesync/template_sync.go Outdated Show resolved Hide resolved
controllers/templatesync/template_sync.go Outdated Show resolved Hide resolved
controllers/templatesync/template_sync.go Outdated Show resolved Hide resolved
test/e2e/case12_ordering_test.go Show resolved Hide resolved
test/e2e/case12_ordering_test.go Outdated Show resolved Hide resolved
test/e2e/case12_ordering_test.go Outdated Show resolved Hide resolved
test/e2e/case12_ordering_test.go Outdated Show resolved Hide resolved
JustinKuli
JustinKuli previously approved these changes Nov 2, 2022
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.

/hold

Looks good to me! Just holding to squash the commits (which helped in review, so thanks for keeping them like that), and I think it will be good to go.

@openshift-ci openshift-ci bot added the lgtm label Nov 2, 2022
@openshift-ci
Copy link

openshift-ci bot commented Nov 2, 2022

[APPROVALNOTIFIER] This PR is APPROVED

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

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:
  • OWNERS [JustinKuli,willkutler]

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

@willkutler
Copy link
Contributor Author

/unhold

commits have been squashed and the message has been updated, this PR should be good to go now

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