-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to convert K8s Obj to PSP
Add the ability to convert a single K8s Object to a Pod Security Policy, instead of reading all objects from a live cluster. - Add spf13/cobra to add subcommands "inspect", which covers the existing functionality, and "convert", which converts a single K8s Object as a yaml file. - Move the code that generates a PodSecurityPolicy from lists of ContainerSecuritySpec/PodSecuritySpec to a standalone package in generator/generator.go. It only has a few minor changes: - It has a struct so it's more like an object than a standalone function. - The provided service account is optional. When not provided e.g. nil, "secret" is always added as an allowed volume type. - When used by the converter, the namespace and serverGitVersion are set to default values "default" and "v1.11", which allows enforcement of ReadOnly filesystems. - Error handling at the top level is done by log.Fatalf instead of panic(), to make problems like incorrect arguments a bit more graceful. - Add logging at least for the conversion path, showing the files that are read and written at debug level.
- Loading branch information
Showing
7 changed files
with
887 additions
and
571 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.