Skip to content

Commit

Permalink
feat(kyverno): clean policy and refactoring script
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Lamirault <nicolas.lamirault@gmail.com>
  • Loading branch information
nlamirault committed Jan 15, 2024
1 parent ed0a4d7 commit 4266de2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 72 deletions.
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -48,8 +48,8 @@ mixins: guard-CHART guard-LOG guard-RELEASE ## Install mixins
$(VENV)/bin/python3 ./hack/mixins.py $(CHART) --release $(RELEASE) --log $(LOG)

.PHONY: policies
policies: guard-CHART guard-LOG ## Install policies
$(VENV)/bin/python3 ./hack/policies.py $(CHART) --log $(LOG)
policies: guard-CHART guard-RELEASE guard-LOG ## Install policies
$(VENV)/bin/python3 ./hack/policies.py $(CHART) --release $(RELEASE) --log $(LOG)

# .PHONY: init ## Initialize environment
# init:
Expand Down
61 changes: 0 additions & 61 deletions charts/portefaix-kyverno/templates/policy-C0004.yaml

This file was deleted.

14 changes: 5 additions & 9 deletions hack/policies.py
Expand Up @@ -29,15 +29,7 @@
import coloredlogs
import requests

# datasource=github-tags depName=portefaix/portefaix-policies
version = "v0.11.0"
policies_archive = "portefaix-policies-%s.zip" % version
policies_url = (
"https://github.com/portefaix/portefaix-policies/archive/refs/tags/%s.zip"
% version
)
policies_directory = "portefaix-policies-%s" % version.replace('v', '')

POLICIES_REPO = "https://github.com/portefaix/portefaix-policies"

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -96,7 +88,11 @@ def main(url, filename, directory, chart):
if __name__ == "__main__":
parser = argparse.ArgumentParser(prefix_chars="-")
parser.add_argument("chart", type=str, help="Chart to update")
parser.add_argument("--release", type=str, help="Release of policies")
parser.add_argument("--log", type=str, default="info", help="Log level")
args = parser.parse_args()
coloredlogs.install(level=args.log)
policies_archive = "portefaix-policies-%s.zip" % args.release
policies_url = "%s/archive/refs/tags/%s.zip" % (POLICIES_REPO, args.release)
policies_directory = "portefaix-policies-%s" % args.release.replace('v', '')
main(policies_url, policies_archive, policies_directory, args.chart)

0 comments on commit 4266de2

Please sign in to comment.