From 6f227af0dbe5d31ed6883c63dad208d3f287c37b Mon Sep 17 00:00:00 2001 From: STRRL Date: Thu, 3 Nov 2022 12:14:26 +0800 Subject: [PATCH] chore: refine implementing declaration, fix import cycle Signed-off-by: STRRL --- pkg/webhook/admission/admissiontest/doc.go | 18 ------------------ .../util.go => mock_validator.go} | 7 +++---- 2 files changed, 3 insertions(+), 22 deletions(-) delete mode 100644 pkg/webhook/admission/admissiontest/doc.go rename pkg/webhook/admission/{admissiontest/util.go => mock_validator.go} (95%) diff --git a/pkg/webhook/admission/admissiontest/doc.go b/pkg/webhook/admission/admissiontest/doc.go deleted file mode 100644 index b4a7a42191..0000000000 --- a/pkg/webhook/admission/admissiontest/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package admissiontest contains fake webhooks for validating admission webhooks -package admissiontest diff --git a/pkg/webhook/admission/admissiontest/util.go b/pkg/webhook/admission/mock_validator.go similarity index 95% rename from pkg/webhook/admission/admissiontest/util.go rename to pkg/webhook/admission/mock_validator.go index 38259e2bae..7bbf9225f7 100644 --- a/pkg/webhook/admission/admissiontest/util.go +++ b/pkg/webhook/admission/mock_validator.go @@ -14,17 +14,16 @@ See the License for the specific language governing permissions and limitations under the License. */ -package admissiontest +package admission import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/webhook" ) var _ runtime.Object = (*FakeValidator)(nil) var _ schema.ObjectKind = (*FakeValidator)(nil) -var _ webhook.Validator = (*FakeValidator)(nil) +var _ Validator = (*FakeValidator)(nil) // FakeValidator provides fake validating webhook functionality for testing // It implements the admission.Validator interface and @@ -72,7 +71,7 @@ func (v *FakeValidator) SetGroupVersionKind(gvk schema.GroupVersionKind) { var _ runtime.Object = (*FakeValidatorWarn)(nil) var _ schema.ObjectKind = (*FakeValidatorWarn)(nil) -var _ webhook.ValidatorWarn = (*FakeValidatorWarn)(nil) +var _ ValidatorWarn = (*FakeValidatorWarn)(nil) // FakeValidatorWarn provides fake validating webhook functionality for testing // It implements the admission.ValidatorWarn interface and