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

Add input, output and json flag to gatekeeper #500

Merged
merged 2 commits into from
Jul 30, 2021

Conversation

mengqiy
Copy link
Contributor

@mengqiy mengqiy commented Jul 28, 2021

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 format

We 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 using docker 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

@google-cla google-cla bot added the cla: yes Google CLA OK label Jul 28, 2021
This make it behave the same as the old gatekeeper function.
@mengqiy
Copy link
Contributor Author

mengqiy commented Jul 30, 2021

@droot PTAL

@mengqiy mengqiy requested a review from droot July 30, 2021 00:49
Copy link
Contributor

@droot droot 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 adding the tests, @mengqiy . Looks good!

@mengqiy mengqiy merged commit 6e1907d into GoogleContainerTools:master Jul 30, 2021
@mengqiy mengqiy deleted the gatekeeperflags branch July 30, 2021 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Google CLA OK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants