@@ 1,7 1,6 @@
package mutator
import (
- "reflect"
"testing"
"github.com/go-logr/logr"
@@ 31,7 30,7 @@ func TestMutatorHandler(t *testing.T) {
}
expectedPatch := `{"op":"add","path":"/spec/containers/1","value":{"args":["--listen-addr","0.0.0.0:8080","--upstream-url","http://127.0.0.1:9090"],"image":"quay.io/tomleb/mkproof-proxy:latest","name":"mkproof-proxy","resources":{}}}`
- if !reflect.DeepEqual(response.Patches[0].Json(), expectedPatch) {
+ if response.Patches[0].Json() != expectedPatch {
t.Fatal("wrong patch")
}
}
@@ 58,7 57,7 @@ func TestMutatorHandlerSecret(t *testing.T) {
}
expectedPatch := `{"op":"add","path":"/spec/containers/1","value":{"args":["--listen-addr","0.0.0.0:8080","--upstream-url","http://127.0.0.1:9090"],"env":[{"name":"MKPROOF_PROXY_SECRET_KEY","valueFrom":{"secretKeyRef":{"key":"secret-key","name":"my-secret"}}}],"image":"quay.io/tomleb/mkproof-proxy:latest","name":"mkproof-proxy","resources":{}}}`
- if !reflect.DeepEqual(response.Patches[0].Json(), expectedPatch) {
+ if response.Patches[0].Json() != expectedPatch {
t.Fatal("wrong patch")
}
}