Although the policy framework is built to be extended, we haven't maintained documentation around how to integrate with it. Someone writing a new policy controller might have a hard time understanding what events the framework is looking for, and what fields need to be in their APIs.
For example, the .spec.remediationAction is required in all policy types (even if it doesn't do anything), so that it can be inherited from the parent policy. Similarly, all policy types should have a .spec.namespaceSelector with a consistent format to increase usability. There are also optional fields like .status.relatedObjects which would help usability, but just be a best practice, not a requirement.
A common repository with these types, and implementations around common uses (like generating compliance events) would assist policy controller authors.
In response to [this](https://github.com/open-cluster-management-io/community/issues/150#issuecomment-1612387727):
>I think this one is already finished
>/close
Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
Although the policy framework is built to be extended, we haven't maintained documentation around how to integrate with it. Someone writing a new policy controller might have a hard time understanding what events the framework is looking for, and what fields need to be in their APIs.
For example, the
.spec.remediationAction
is required in all policy types (even if it doesn't do anything), so that it can be inherited from the parent policy. Similarly, all policy types should have a.spec.namespaceSelector
with a consistent format to increase usability. There are also optional fields like.status.relatedObjects
which would help usability, but just be a best practice, not a requirement.A common repository with these types, and implementations around common uses (like generating compliance events) would assist policy controller authors.