kubewarden / kubewarden-controller

Manage admission policies in your Kubernetes cluster with ease
https://kubewarden.io
Apache License 2.0
189 stars 33 forks source link

Refresh PSP migration guidelines #497

Closed flavio closed 11 months ago

flavio commented 1 year ago

The information we have inside of of the psp-migration documentation are outdated and not working anymore.

These are some of issues that we face:

Actions to perform

viccuad commented 1 year ago

Given that we don't control avia/psp-migration, should we add an e2e test for this, so we catch this in the future?

flavio commented 1 year ago

I think the main issues with the code generated by the psp-migration tool are:

I would invest time not in building e2e tests, but on doing some update-cli automation to address the second problem. If appvia doesn't accept our PRs we can think about other solutions

jvanz commented 11 months ago

We do not need to update the AppVia tool. They have a renovate bot wich always bump our policies version.

2de845e - Update ghcr.io/kubewarden/policies/sysctl-psp Docker tag to v0.1.12 (4 weeks ago) <renovate[bot]>
750ac4f - Update ghcr.io/kubewarden/policies/hostpaths-psp Docker tag to v0.1.10 (4 weeks ago) <renovate[bot]>
562aab8 - Update ghcr.io/kubewarden/policies/volumes-psp Docker tag to v0.1.11 (3 months ago) <renovate[bot]>
3e45cd9 - bump all kubewarden lib versions (3 months ago) <Chris Nesbitt-Smith>

What we need to do is to bump the tool version used in out migration script.

flavio commented 11 months ago

Have they upgraded the api version used when generating the (Cluster)AdmissionPolicy yaml files?

jvanz commented 11 months ago

Have they upgraded the api version used when generating the (Cluster)AdmissionPolicy yaml files?

Actually, we have done that ( I did not remember that ):

commit f8522f4cf8bb6f06cf448682d52de861e88bd39d
Author: José Guilherme Vanz <1514798+jvanz@users.noreply.github.com>
Date:   Mon Jul 4 10:02:04 2022 -0300

    Create Kuberwarden v1 CRDs. (#231)

    Kubewarden bumped the CRDs version to v1. This commit updates the code
    and tests to use the latest released CRDs version.

diff --git a/src/kubewarden.ts b/src/kubewarden.ts
index 4abedef..1c59ccb 100644
--- a/src/kubewarden.ts
+++ b/src/kubewarden.ts
@@ -151,7 +151,7 @@ export function transform_kubewarden(PSP: k8s.V1beta1PodSecurityPolicy): object[

 export function kubewarden_policy_helper(name: string, module: string, settings: any = null, mutating: boolean = false) {
   return {
-    apiVersion: "policies.kubewarden.io/v1alpha2",
+    apiVersion: "policies.kubewarden.io/v1",
     kind: "ClusterAdmissionPolicy",
     metadata: {
       name: `psp-${name.toLowerCase()}`,
flavio commented 11 months ago

Closing, there's nothing left to be done :clap: