Skip to content

Commit

Permalink
Remove direct dep on kubernetes
Browse files Browse the repository at this point in the history
  • Loading branch information
xing-yang committed Sep 13, 2023
1 parent 3cccd02 commit fd03420
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 212 deletions.
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ require (
k8s.io/component-base v0.28.0
k8s.io/component-helpers v0.28.0
k8s.io/klog/v2 v2.100.1
k8s.io/kubernetes v1.28.0
)

require (
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,6 @@ k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg=
k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5OhxCKlKJy0sHc+PcDwFB24dQ=
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9/go.mod h1:wZK2AVp1uHCp4VamDVgBP2COHZjqD1T68Rf0CM3YjSM=
k8s.io/kubernetes v1.28.0 h1:p8qq/VoNHnBWinLEi5LO2IvCfzFouN7Jhdz8+L++V+U=
k8s.io/kubernetes v1.28.0/go.mod h1:rBQpjGYlLBV0KuOLw8EG45N5EBCskWiPpi0xy5liHMI=
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 h1:qY1Ad8PODbnymg2pRbkyMT/ylpTrCM8P2RJ0yroCyIk=
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
Expand Down
3 changes: 1 addition & 2 deletions pkg/validation-webhook/convert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/serializer"
"k8s.io/apimachinery/pkg/util/diff"
admissionfuzzer "k8s.io/kubernetes/pkg/apis/admission/fuzzer"
)

func TestConvertAdmissionRequestToV1(t *testing.T) {
f := fuzzer.FuzzerFor(admissionfuzzer.Funcs, rand.NewSource(rand.Int63()), serializer.NewCodecFactory(runtime.NewScheme()))
f := fuzzer.FuzzerFor(AdmissionfuzzerFuncs, rand.NewSource(rand.Int63()), serializer.NewCodecFactory(runtime.NewScheme()))
for i := 0; i < 100; i++ {
t.Run(fmt.Sprintf("Run %d/100", i), func(t *testing.T) {
orig := &v1beta1.AdmissionRequest{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package fuzzer
// NOTE: This file is copied from
// https://github.com/kubernetes/kubernetes/blob/v1.29.0-alpha.0/pkg/apis/admission/fuzzer/fuzzer.go
// so that external-snapshotter no longer needs to depend on k8s.io/kubernetes

package webhook

import (
fuzz "github.com/google/gofuzz"
Expand All @@ -25,7 +29,7 @@ import (
)

// Funcs returns the fuzzer functions for the admission api group.
var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} {
var AdmissionfuzzerFuncs = func(codecs runtimeserializer.CodecFactory) []interface{} {
return []interface{}{
func(s *runtime.RawExtension, c fuzz.Continue) {
u := &unstructured.Unstructured{Object: map[string]interface{}{
Expand Down
202 changes: 0 additions & 202 deletions vendor/k8s.io/kubernetes/LICENSE

This file was deleted.

3 changes: 0 additions & 3 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -745,9 +745,6 @@ k8s.io/kube-openapi/pkg/schemamutation
k8s.io/kube-openapi/pkg/spec3
k8s.io/kube-openapi/pkg/util/proto
k8s.io/kube-openapi/pkg/validation/spec
# k8s.io/kubernetes v1.28.0
## explicit; go 1.20
k8s.io/kubernetes/pkg/apis/admission/fuzzer
# k8s.io/utils v0.0.0-20230406110748-d93618cff8a2
## explicit; go 1.18
k8s.io/utils/buffer
Expand Down

0 comments on commit fd03420

Please sign in to comment.