Add input, output and json flag to gatekeeper #500
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The old gatekeeper function provides the following flags in https://github.com/GoogleContainerTools/kpt-functions-sdk/blob/b7e346f0c18f972edf7ca02272734fbc68fca905/go/pkg/framework/runners/runners.go#L31-L44:
--input
(string): default is stdin.--output
(string): default is stdout.--json
(bool): default is not use json formatWe used to mirror the old OSS gatekeeper function to the
gcr.io/config-management-release/policy-controller-validate
GCR in https://github.com/GoogleContainerTools/kpt-functions-sdk/blob/b7e346f0c18f972edf7ca02272734fbc68fca905/scripts/mirrorImages.sh#L9.And
gcr.io/config-management-release/policy-controller-validate
is a component of the policy controller which is a Google product. We saw some users in b/193160625 depend on these flags when usingdocker run
directly.Before we mirror our new gatekeeper function, we should ensure it behave the same as before so that it doesn't accidentally break policy controller users.
This PR introduce these flags and make it behave the same as the old gatekeeper function.
The change is backward compatible. It doesn't affect how the function works with the function orchestrator.
This PR partially address kptdev/kpt#2406