Switch from json-iterator to utiljson
Kubernetes-commit: bba877d3a6d0e6498d5e43a54939d5e4e8baee1a
This commit is contained in:
parent
3d1bdae9f4
commit
18b69ef17d
|
|
@ -34,6 +34,7 @@ import (
|
||||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
"k8s.io/apimachinery/pkg/runtime/serializer/json"
|
"k8s.io/apimachinery/pkg/runtime/serializer/json"
|
||||||
|
utiljson "k8s.io/apimachinery/pkg/util/json"
|
||||||
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
||||||
"k8s.io/apiserver/pkg/admission"
|
"k8s.io/apiserver/pkg/admission"
|
||||||
admissionmetrics "k8s.io/apiserver/pkg/admission/metrics"
|
admissionmetrics "k8s.io/apiserver/pkg/admission/metrics"
|
||||||
|
|
@ -61,8 +62,6 @@ const (
|
||||||
MutationAuditAnnotationFailedOpenKeyPrefix string = "failed-open." + MutationAuditAnnotationPrefix
|
MutationAuditAnnotationFailedOpenKeyPrefix string = "failed-open." + MutationAuditAnnotationPrefix
|
||||||
)
|
)
|
||||||
|
|
||||||
var encodingjson = json.CaseSensitiveJSONIterator()
|
|
||||||
|
|
||||||
type mutatingDispatcher struct {
|
type mutatingDispatcher struct {
|
||||||
cm *webhookutil.ClientManager
|
cm *webhookutil.ClientManager
|
||||||
plugin *Plugin
|
plugin *Plugin
|
||||||
|
|
@ -444,7 +443,7 @@ func mutationAnnotationValue(configuration, webhook string, mutated bool) (strin
|
||||||
Webhook: webhook,
|
Webhook: webhook,
|
||||||
Mutated: mutated,
|
Mutated: mutated,
|
||||||
}
|
}
|
||||||
bytes, err := encodingjson.Marshal(m)
|
bytes, err := utiljson.Marshal(m)
|
||||||
return string(bytes), err
|
return string(bytes), err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -455,6 +454,6 @@ func jsonPatchAnnotationValue(configuration, webhook string, patch interface{})
|
||||||
Patch: patch,
|
Patch: patch,
|
||||||
PatchType: string(admissionv1.PatchTypeJSONPatch),
|
PatchType: string(admissionv1.PatchTypeJSONPatch),
|
||||||
}
|
}
|
||||||
bytes, err := encodingjson.Marshal(p)
|
bytes, err := utiljson.Marshal(p)
|
||||||
return string(bytes), err
|
return string(bytes), err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue