diff --git a/.github/actions/aqua/action.yaml b/.github/actions/aqua/action.yaml index a75ee20..02f2e19 100644 --- a/.github/actions/aqua/action.yaml +++ b/.github/actions/aqua/action.yaml @@ -7,7 +7,7 @@ inputs: runs: using: composite steps: - - uses: aquaproj/aqua-installer@v3.0.0 # v3.0.0 + - uses: aquaproj/aqua-installer@6ce1f8848ec8e61f14d57bd5d7597057a6dd187c # v3.0.1 with: aqua_version: v2.25.1 env: diff --git a/hooks/mutate_pod.go b/hooks/mutate_pod.go index a5b305f..3dfa799 100644 --- a/hooks/mutate_pod.go +++ b/hooks/mutate_pod.go @@ -12,6 +12,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/webhook" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" + "k8s.io/apimachinery/pkg/runtime" ) type podMutator struct { @@ -50,7 +51,7 @@ func (m *podMutator) Handle(ctx context.Context, req admission.Request) admissio m.log.Info("mutating pod,", "name", namespacedName, "profile", m.profileName) po := &corev1.Pod{} - err := admission.Decoder.Decode(*m.decoder, req, po) + err := admission.NewDecoder(runtime.NewScheme()).Decode(req, po) if err != nil { m.log.Error(err, "failed to decode pod", "name", namespacedName, "profile", m.profileName) return admission.Errored(http.StatusBadRequest, err)