From ed5153b11f64e43a655ef945b981bc3fff9aa7e7 Mon Sep 17 00:00:00 2001 From: spacewander Date: Fri, 22 Mar 2024 13:57:02 +0800 Subject: [PATCH 1/2] generate clientset as the CRD's SDK Also have to rename api/ to apis/, so that client-gen can work. See https://github.com/kubernetes/code-generator/issues/167 The gateway-api also use apis/ as the directory to hold the CRD types, so I think this name is roburst enough in the k8s ecosystem. Signed-off-by: spacewander --- .github/workflows/lint.yml | 6 + controller/Makefile | 14 ++ controller/PROJECT | 6 +- controller/{api => apis}/v1/conditions.go | 0 .../{api => apis}/v1/conditions_test.go | 0 controller/{api => apis}/v1/consumer_types.go | 1 + .../{api => apis}/v1/consumer_webhook.go | 0 controller/{api => apis}/v1/customization.go | 0 .../{api => apis}/v1/groupversion_info.go | 5 + .../v1/httpfilterpolicy_types.go | 1 + .../v1/httpfilterpolicy_webhook.go | 0 controller/{api => apis}/v1/istio_webhook.go | 0 .../{api => apis}/v1/istio_webhook_test.go | 0 .../{api => apis}/v1/serviceregistry_types.go | 1 + .../v1/serviceregistry_webhook.go | 0 controller/{api => apis}/v1/types.go | 0 controller/{api => apis}/v1/validation.go | 0 .../{api => apis}/v1/validation_test.go | 0 .../{api => apis}/v1/zz_generated.deepcopy.go | 0 controller/cmd/main.go | 2 +- controller/hack/gen-crd-code.sh | 44 ++++ .../controller/consumer_controller.go | 2 +- .../controller/httpfilterpolicy_controller.go | 2 +- .../httpfilterpolicy_controller_test.go | 2 +- .../controller/serviceregistry_controller.go | 2 +- controller/internal/registry/registry.go | 2 +- controller/internal/translation/init_state.go | 2 +- .../internal/translation/merged_state.go | 2 +- .../internal/translation/translation.go | 2 +- .../internal/translation/translation_test.go | 2 +- .../client/clientset/versioned/clientset.go | 121 +++++++++++ .../versioned/fake/clientset_generated.go | 86 ++++++++ .../client/clientset/versioned/fake/doc.go | 20 ++ .../clientset/versioned/fake/register.go | 57 +++++ .../client/clientset/versioned/scheme/doc.go | 20 ++ .../clientset/versioned/scheme/register.go | 57 +++++ .../versioned/typed/apis/v1/apis_client.go | 118 +++++++++++ .../versioned/typed/apis/v1/consumer.go | 196 ++++++++++++++++++ .../clientset/versioned/typed/apis/v1/doc.go | 20 ++ .../versioned/typed/apis/v1/fake/doc.go | 20 ++ .../typed/apis/v1/fake/fake_apis_client.go | 49 +++++ .../typed/apis/v1/fake/fake_consumer.go | 142 +++++++++++++ .../apis/v1/fake/fake_httpfilterpolicy.go | 142 +++++++++++++ .../apis/v1/fake/fake_serviceregistry.go | 142 +++++++++++++ .../typed/apis/v1/generated_expansion.go | 25 +++ .../typed/apis/v1/httpfilterpolicy.go | 196 ++++++++++++++++++ .../typed/apis/v1/serviceregistry.go | 196 ++++++++++++++++++ .../httpfilterpolicy_controller_test.go | 2 +- controller/tests/benchmark/suite_test.go | 2 +- .../controller/consumer_controller_test.go | 2 +- .../httpfilterpolicy_controller_test.go | 2 +- .../serviceregistry_controller_test.go | 2 +- .../integration/controller/suite_test.go | 2 +- .../integration/registries/nacos_test.go | 2 +- .../integration/registries/suite_test.go | 2 +- .../integration/webhook/webhook_suite_test.go | 2 +- controller/tests/pkg/utils.go | 2 +- e2e/e2e_test.go | 2 +- e2e/pkg/k8s/k8s.go | 2 +- e2e/tests/consumer.go | 2 +- go.mod | 1 + 61 files changed, 1706 insertions(+), 26 deletions(-) rename controller/{api => apis}/v1/conditions.go (100%) rename controller/{api => apis}/v1/conditions_test.go (100%) rename controller/{api => apis}/v1/consumer_types.go (99%) rename controller/{api => apis}/v1/consumer_webhook.go (100%) rename controller/{api => apis}/v1/customization.go (100%) rename controller/{api => apis}/v1/groupversion_info.go (85%) rename controller/{api => apis}/v1/httpfilterpolicy_types.go (99%) rename controller/{api => apis}/v1/httpfilterpolicy_webhook.go (100%) rename controller/{api => apis}/v1/istio_webhook.go (100%) rename controller/{api => apis}/v1/istio_webhook_test.go (100%) rename controller/{api => apis}/v1/serviceregistry_types.go (99%) rename controller/{api => apis}/v1/serviceregistry_webhook.go (100%) rename controller/{api => apis}/v1/types.go (100%) rename controller/{api => apis}/v1/validation.go (100%) rename controller/{api => apis}/v1/validation_test.go (100%) rename controller/{api => apis}/v1/zz_generated.deepcopy.go (100%) create mode 100755 controller/hack/gen-crd-code.sh create mode 100644 controller/pkg/client/clientset/versioned/clientset.go create mode 100644 controller/pkg/client/clientset/versioned/fake/clientset_generated.go create mode 100644 controller/pkg/client/clientset/versioned/fake/doc.go create mode 100644 controller/pkg/client/clientset/versioned/fake/register.go create mode 100644 controller/pkg/client/clientset/versioned/scheme/doc.go create mode 100644 controller/pkg/client/clientset/versioned/scheme/register.go create mode 100644 controller/pkg/client/clientset/versioned/typed/apis/v1/apis_client.go create mode 100644 controller/pkg/client/clientset/versioned/typed/apis/v1/consumer.go create mode 100644 controller/pkg/client/clientset/versioned/typed/apis/v1/doc.go create mode 100644 controller/pkg/client/clientset/versioned/typed/apis/v1/fake/doc.go create mode 100644 controller/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_apis_client.go create mode 100644 controller/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_consumer.go create mode 100644 controller/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_httpfilterpolicy.go create mode 100644 controller/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_serviceregistry.go create mode 100644 controller/pkg/client/clientset/versioned/typed/apis/v1/generated_expansion.go create mode 100644 controller/pkg/client/clientset/versioned/typed/apis/v1/httpfilterpolicy.go create mode 100644 controller/pkg/client/clientset/versioned/typed/apis/v1/serviceregistry.go diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index c41273f0..8d049837 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -51,6 +51,12 @@ jobs: echo "Generated files are not up-to-date. Please run 'make gen-proto' and commit changes." exit 1 fi + cd controller + make gen-crd-code + if ! git diff --exit-code; then + echo "Generated files are not up-to-date. Please run 'make gen-crd-code' and commit changes." + exit 1 + fi - name: lint go run: make lint-go diff --git a/controller/Makefile b/controller/Makefile index 306af431..a45a220c 100644 --- a/controller/Makefile +++ b/controller/Makefile @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +PROJECT_NAME = mosn.io/htnn # Image URL to use all building/pushing image targets IMG ?= htnn-controller:latest # Use distroless as minimal base image to package the manager binary @@ -196,3 +197,16 @@ $(ENVTEST): $(LOCALBIN) .PHONY: start-controller-service start-controller-service: cd ./tests/testdata/services && docker-compose up -d + +GO_FMTTER_VERSION = 0.3.8 +.PHONY: install-go-fmtter +install-go-fmtter: $(LOCALBIN) + if ! test -x $(LOCALBIN)/gosimports || ! $(LOCALBIN)/gosimports -version | grep $(GO_FMTTER_VERSION) >/dev/null; then \ + GOBIN=$(LOCALBIN) go install github.com/rinchsan/gosimports/cmd/gosimports@v$(GO_FMTTER_VERSION); \ + fi + +.PHONY: gen-crd-code +gen-crd-code: $(LOCALBIN) install-go-fmtter + test -s $(LOCALBIN)/client-gen || GOBIN=$(LOCALBIN) go install k8s.io/code-generator/cmd/client-gen@v0.29.3 + LOCALBIN=$(LOCALBIN) ./hack/gen-crd-code.sh + $(LOCALBIN)/gosimports -w -local ${PROJECT_NAME} ./pkg/client diff --git a/controller/PROJECT b/controller/PROJECT index 0efb5e81..2ae0f512 100644 --- a/controller/PROJECT +++ b/controller/PROJECT @@ -13,7 +13,7 @@ resources: controller: true group: mosn.io kind: HTTPFilterPolicy - path: mosn.io/htnn/controller/api/v1 + path: mosn.io/htnn/controller/apis/v1 version: v1 webhooks: defaulting: true @@ -25,7 +25,7 @@ resources: controller: true group: mosn.io kind: Consumer - path: mosn.io/htnn/controller/api/v1 + path: mosn.io/htnn/controller/apis/v1 version: v1 webhooks: defaulting: true @@ -37,7 +37,7 @@ resources: controller: true group: mosn.io kind: ServiceRegistry - path: mosn.io/htnn/controller/api/v1 + path: mosn.io/htnn/controller/apis/v1 version: v1 webhooks: defaulting: true diff --git a/controller/api/v1/conditions.go b/controller/apis/v1/conditions.go similarity index 100% rename from controller/api/v1/conditions.go rename to controller/apis/v1/conditions.go diff --git a/controller/api/v1/conditions_test.go b/controller/apis/v1/conditions_test.go similarity index 100% rename from controller/api/v1/conditions_test.go rename to controller/apis/v1/conditions_test.go diff --git a/controller/api/v1/consumer_types.go b/controller/apis/v1/consumer_types.go similarity index 99% rename from controller/api/v1/consumer_types.go rename to controller/apis/v1/consumer_types.go index 8468265d..86220a1b 100644 --- a/controller/api/v1/consumer_types.go +++ b/controller/apis/v1/consumer_types.go @@ -67,6 +67,7 @@ func (s *ConsumerStatus) Reset() { s.changed = false } +//+genclient //+kubebuilder:object:root=true //+kubebuilder:subresource:status diff --git a/controller/api/v1/consumer_webhook.go b/controller/apis/v1/consumer_webhook.go similarity index 100% rename from controller/api/v1/consumer_webhook.go rename to controller/apis/v1/consumer_webhook.go diff --git a/controller/api/v1/customization.go b/controller/apis/v1/customization.go similarity index 100% rename from controller/api/v1/customization.go rename to controller/apis/v1/customization.go diff --git a/controller/api/v1/groupversion_info.go b/controller/apis/v1/groupversion_info.go similarity index 85% rename from controller/api/v1/groupversion_info.go rename to controller/apis/v1/groupversion_info.go index de2cd3d2..3a6f93b8 100644 --- a/controller/api/v1/groupversion_info.go +++ b/controller/apis/v1/groupversion_info.go @@ -33,4 +33,9 @@ var ( // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme + + // SchemeGroupVersion is group version used to register these objects + // Deprecated: use GroupVersion instead. + // Here we keep it for compatibility with client-gen. + SchemeGroupVersion = GroupVersion ) diff --git a/controller/api/v1/httpfilterpolicy_types.go b/controller/apis/v1/httpfilterpolicy_types.go similarity index 99% rename from controller/api/v1/httpfilterpolicy_types.go rename to controller/apis/v1/httpfilterpolicy_types.go index 07e66e6f..b4d48ac3 100644 --- a/controller/api/v1/httpfilterpolicy_types.go +++ b/controller/apis/v1/httpfilterpolicy_types.go @@ -65,6 +65,7 @@ func (s *HTTPFilterPolicyStatus) Reset() { s.changed = false } +//+genclient //+kubebuilder:object:root=true //+kubebuilder:subresource:status //+kubebuilder:metadata:labels=gateway.networking.k8s.io/policy=direct diff --git a/controller/api/v1/httpfilterpolicy_webhook.go b/controller/apis/v1/httpfilterpolicy_webhook.go similarity index 100% rename from controller/api/v1/httpfilterpolicy_webhook.go rename to controller/apis/v1/httpfilterpolicy_webhook.go diff --git a/controller/api/v1/istio_webhook.go b/controller/apis/v1/istio_webhook.go similarity index 100% rename from controller/api/v1/istio_webhook.go rename to controller/apis/v1/istio_webhook.go diff --git a/controller/api/v1/istio_webhook_test.go b/controller/apis/v1/istio_webhook_test.go similarity index 100% rename from controller/api/v1/istio_webhook_test.go rename to controller/apis/v1/istio_webhook_test.go diff --git a/controller/api/v1/serviceregistry_types.go b/controller/apis/v1/serviceregistry_types.go similarity index 99% rename from controller/api/v1/serviceregistry_types.go rename to controller/apis/v1/serviceregistry_types.go index ffc190bf..d322ac3b 100644 --- a/controller/api/v1/serviceregistry_types.go +++ b/controller/apis/v1/serviceregistry_types.go @@ -42,6 +42,7 @@ type ServiceRegistryStatus struct { Conditions []metav1.Condition `json:"conditions,omitempty"` } +//+genclient //+kubebuilder:object:root=true //+kubebuilder:subresource:status diff --git a/controller/api/v1/serviceregistry_webhook.go b/controller/apis/v1/serviceregistry_webhook.go similarity index 100% rename from controller/api/v1/serviceregistry_webhook.go rename to controller/apis/v1/serviceregistry_webhook.go diff --git a/controller/api/v1/types.go b/controller/apis/v1/types.go similarity index 100% rename from controller/api/v1/types.go rename to controller/apis/v1/types.go diff --git a/controller/api/v1/validation.go b/controller/apis/v1/validation.go similarity index 100% rename from controller/api/v1/validation.go rename to controller/apis/v1/validation.go diff --git a/controller/api/v1/validation_test.go b/controller/apis/v1/validation_test.go similarity index 100% rename from controller/api/v1/validation_test.go rename to controller/apis/v1/validation_test.go diff --git a/controller/api/v1/zz_generated.deepcopy.go b/controller/apis/v1/zz_generated.deepcopy.go similarity index 100% rename from controller/api/v1/zz_generated.deepcopy.go rename to controller/apis/v1/zz_generated.deepcopy.go diff --git a/controller/cmd/main.go b/controller/cmd/main.go index 3b56fbaa..29ce102a 100644 --- a/controller/cmd/main.go +++ b/controller/cmd/main.go @@ -31,7 +31,7 @@ import ( metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server" gwapiv1 "sigs.k8s.io/gateway-api/apis/v1" - mosniov1 "mosn.io/htnn/controller/api/v1" + mosniov1 "mosn.io/htnn/controller/apis/v1" "mosn.io/htnn/controller/internal/config" "mosn.io/htnn/controller/internal/controller" "mosn.io/htnn/controller/internal/log" diff --git a/controller/hack/gen-crd-code.sh b/controller/hack/gen-crd-code.sh new file mode 100755 index 00000000..54e82f18 --- /dev/null +++ b/controller/hack/gen-crd-code.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +# Copyright The HTNN 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. + + +set -euo pipefail + +readonly REPO=mosn.io/htnn +readonly OUTPUT_PKG=${REPO}/controller/pkg/client +readonly APIS_PKG=${REPO}/controller +readonly CLIENTSET_NAME=versioned +readonly CLIENTSET_PKG_NAME=clientset +readonly GOPATH="$(mktemp -d)" +readonly SCRIPT_ROOT="$(pwd)" + +export GOPATH +mkdir -p "$GOPATH/src/$REPO" +ln -s "${SCRIPT_ROOT}" "$GOPATH/src/$APIS_PKG" + +if [[ "${VERIFY_CODEGEN:-}" == "true" ]]; then + echo "Running in verification mode" + readonly VERIFY_FLAG="--verify-only" +fi + +readonly COMMON_FLAGS="${VERIFY_FLAG:-} --go-header-file ${SCRIPT_ROOT}/hack/boilerplate.go.txt" + +echo "Generating clientset at ${OUTPUT_PKG}/${CLIENTSET_PKG_NAME}" +"${LOCALBIN}"/client-gen \ + --clientset-name "${CLIENTSET_NAME}" \ + --input-base "" \ + --input "${APIS_PKG}/apis/v1" \ + --output-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME}" \ + ${COMMON_FLAGS} diff --git a/controller/internal/controller/consumer_controller.go b/controller/internal/controller/consumer_controller.go index 9763d5ca..062880d2 100644 --- a/controller/internal/controller/consumer_controller.go +++ b/controller/internal/controller/consumer_controller.go @@ -32,7 +32,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/predicate" "sigs.k8s.io/controller-runtime/pkg/reconcile" - mosniov1 "mosn.io/htnn/controller/api/v1" + mosniov1 "mosn.io/htnn/controller/apis/v1" "mosn.io/htnn/controller/internal/config" "mosn.io/htnn/controller/internal/istio" "mosn.io/htnn/controller/internal/model" diff --git a/controller/internal/controller/httpfilterpolicy_controller.go b/controller/internal/controller/httpfilterpolicy_controller.go index 7f00469a..b467e35c 100644 --- a/controller/internal/controller/httpfilterpolicy_controller.go +++ b/controller/internal/controller/httpfilterpolicy_controller.go @@ -42,7 +42,7 @@ import ( gwapiv1 "sigs.k8s.io/gateway-api/apis/v1" gwapiv1a2 "sigs.k8s.io/gateway-api/apis/v1alpha2" - mosniov1 "mosn.io/htnn/controller/api/v1" + mosniov1 "mosn.io/htnn/controller/apis/v1" "mosn.io/htnn/controller/internal/config" "mosn.io/htnn/controller/internal/k8s" "mosn.io/htnn/controller/internal/metrics" diff --git a/controller/internal/controller/httpfilterpolicy_controller_test.go b/controller/internal/controller/httpfilterpolicy_controller_test.go index e333c226..e55203c6 100644 --- a/controller/internal/controller/httpfilterpolicy_controller_test.go +++ b/controller/internal/controller/httpfilterpolicy_controller_test.go @@ -27,7 +27,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" gwapiv1a2 "sigs.k8s.io/gateway-api/apis/v1alpha2" - mosniov1 "mosn.io/htnn/controller/api/v1" + mosniov1 "mosn.io/htnn/controller/apis/v1" "mosn.io/htnn/controller/tests/pkg" ) diff --git a/controller/internal/controller/serviceregistry_controller.go b/controller/internal/controller/serviceregistry_controller.go index e0fc92ad..6b2e7cc3 100644 --- a/controller/internal/controller/serviceregistry_controller.go +++ b/controller/internal/controller/serviceregistry_controller.go @@ -31,7 +31,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/predicate" "sigs.k8s.io/controller-runtime/pkg/reconcile" - mosniov1 "mosn.io/htnn/controller/api/v1" + mosniov1 "mosn.io/htnn/controller/apis/v1" "mosn.io/htnn/controller/internal/registry" ) diff --git a/controller/internal/registry/registry.go b/controller/internal/registry/registry.go index fa3c8dc6..5f625bf6 100644 --- a/controller/internal/registry/registry.go +++ b/controller/internal/registry/registry.go @@ -18,7 +18,7 @@ import ( "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" - mosniov1 "mosn.io/htnn/controller/api/v1" + mosniov1 "mosn.io/htnn/controller/apis/v1" "mosn.io/htnn/controller/internal/log" pkgRegistry "mosn.io/htnn/controller/pkg/registry" ) diff --git a/controller/internal/translation/init_state.go b/controller/internal/translation/init_state.go index 12ae3874..03c67374 100644 --- a/controller/internal/translation/init_state.go +++ b/controller/internal/translation/init_state.go @@ -23,7 +23,7 @@ import ( "k8s.io/apimachinery/pkg/types" gwapiv1 "sigs.k8s.io/gateway-api/apis/v1" - mosniov1 "mosn.io/htnn/controller/api/v1" + mosniov1 "mosn.io/htnn/controller/apis/v1" ) type VirtualServicePolicies struct { diff --git a/controller/internal/translation/merged_state.go b/controller/internal/translation/merged_state.go index f107a164..d70d7f28 100644 --- a/controller/internal/translation/merged_state.go +++ b/controller/internal/translation/merged_state.go @@ -21,7 +21,7 @@ import ( "k8s.io/apimachinery/pkg/types" - mosniov1 "mosn.io/htnn/controller/api/v1" + mosniov1 "mosn.io/htnn/controller/apis/v1" "mosn.io/htnn/controller/internal/model" "mosn.io/htnn/pkg/filtermanager" fmModel "mosn.io/htnn/pkg/filtermanager/model" diff --git a/controller/internal/translation/translation.go b/controller/internal/translation/translation.go index a0ee04da..8ffc9a4d 100644 --- a/controller/internal/translation/translation.go +++ b/controller/internal/translation/translation.go @@ -22,7 +22,7 @@ import ( "github.com/go-logr/logr" - mosniov1 "mosn.io/htnn/controller/api/v1" + mosniov1 "mosn.io/htnn/controller/apis/v1" ) type Ctx struct { diff --git a/controller/internal/translation/translation_test.go b/controller/internal/translation/translation_test.go index 9199c690..d6eea6a6 100644 --- a/controller/internal/translation/translation_test.go +++ b/controller/internal/translation/translation_test.go @@ -32,7 +32,7 @@ import ( gwapiv1 "sigs.k8s.io/gateway-api/apis/v1" "sigs.k8s.io/yaml" - mosniov1 "mosn.io/htnn/controller/api/v1" + mosniov1 "mosn.io/htnn/controller/apis/v1" "mosn.io/htnn/controller/internal/istio" "mosn.io/htnn/controller/tests/pkg" ) diff --git a/controller/pkg/client/clientset/versioned/clientset.go b/controller/pkg/client/clientset/versioned/clientset.go new file mode 100644 index 00000000..77f38b63 --- /dev/null +++ b/controller/pkg/client/clientset/versioned/clientset.go @@ -0,0 +1,121 @@ +/* +Copyright The HTNN 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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package versioned + +import ( + "fmt" + "net/http" + + discovery "k8s.io/client-go/discovery" + rest "k8s.io/client-go/rest" + flowcontrol "k8s.io/client-go/util/flowcontrol" + + apisv1 "mosn.io/htnn/controller/pkg/client/clientset/versioned/typed/apis/v1" +) + +type Interface interface { + Discovery() discovery.DiscoveryInterface + ApisV1() apisv1.ApisV1Interface +} + +// Clientset contains the clients for groups. +type Clientset struct { + *discovery.DiscoveryClient + apisV1 *apisv1.ApisV1Client +} + +// ApisV1 retrieves the ApisV1Client +func (c *Clientset) ApisV1() apisv1.ApisV1Interface { + return c.apisV1 +} + +// Discovery retrieves the DiscoveryClient +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + if c == nil { + return nil + } + return c.DiscoveryClient +} + +// NewForConfig creates a new Clientset for the given config. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfig will generate a rate-limiter in configShallowCopy. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*Clientset, error) { + configShallowCopy := *c + + if configShallowCopy.UserAgent == "" { + configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent() + } + + // share the transport between all clients + httpClient, err := rest.HTTPClientFor(&configShallowCopy) + if err != nil { + return nil, err + } + + return NewForConfigAndClient(&configShallowCopy, httpClient) +} + +// NewForConfigAndClient creates a new Clientset for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfigAndClient will generate a rate-limiter in configShallowCopy. +func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, error) { + configShallowCopy := *c + if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { + if configShallowCopy.Burst <= 0 { + return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") + } + configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) + } + + var cs Clientset + var err error + cs.apisV1, err = apisv1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + + cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + return &cs, nil +} + +// NewForConfigOrDie creates a new Clientset for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *Clientset { + cs, err := NewForConfig(c) + if err != nil { + panic(err) + } + return cs +} + +// New creates a new Clientset for the given RESTClient. +func New(c rest.Interface) *Clientset { + var cs Clientset + cs.apisV1 = apisv1.New(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClient(c) + return &cs +} diff --git a/controller/pkg/client/clientset/versioned/fake/clientset_generated.go b/controller/pkg/client/clientset/versioned/fake/clientset_generated.go new file mode 100644 index 00000000..cf272693 --- /dev/null +++ b/controller/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -0,0 +1,86 @@ +/* +Copyright The HTNN 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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/discovery" + fakediscovery "k8s.io/client-go/discovery/fake" + "k8s.io/client-go/testing" + + clientset "mosn.io/htnn/controller/pkg/client/clientset/versioned" + apisv1 "mosn.io/htnn/controller/pkg/client/clientset/versioned/typed/apis/v1" + fakeapisv1 "mosn.io/htnn/controller/pkg/client/clientset/versioned/typed/apis/v1/fake" +) + +// NewSimpleClientset returns a clientset that will respond with the provided objects. +// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, +// without applying any validations and/or defaults. It shouldn't be considered a replacement +// for a real clientset and is mostly useful in simple unit tests. +func NewSimpleClientset(objects ...runtime.Object) *Clientset { + o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) + for _, obj := range objects { + if err := o.Add(obj); err != nil { + panic(err) + } + } + + cs := &Clientset{tracker: o} + cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} + cs.AddReactor("*", "*", testing.ObjectReaction(o)) + cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) + + return cs +} + +// Clientset implements clientset.Interface. Meant to be embedded into a +// struct to get a default implementation. This makes faking out just the method +// you want to test easier. +type Clientset struct { + testing.Fake + discovery *fakediscovery.FakeDiscovery + tracker testing.ObjectTracker +} + +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + return c.discovery +} + +func (c *Clientset) Tracker() testing.ObjectTracker { + return c.tracker +} + +var ( + _ clientset.Interface = &Clientset{} + _ testing.FakeClient = &Clientset{} +) + +// ApisV1 retrieves the ApisV1Client +func (c *Clientset) ApisV1() apisv1.ApisV1Interface { + return &fakeapisv1.FakeApisV1{Fake: &c.Fake} +} diff --git a/controller/pkg/client/clientset/versioned/fake/doc.go b/controller/pkg/client/clientset/versioned/fake/doc.go new file mode 100644 index 00000000..5c27ea03 --- /dev/null +++ b/controller/pkg/client/clientset/versioned/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The HTNN 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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated fake clientset. +package fake diff --git a/controller/pkg/client/clientset/versioned/fake/register.go b/controller/pkg/client/clientset/versioned/fake/register.go new file mode 100644 index 00000000..60e5360e --- /dev/null +++ b/controller/pkg/client/clientset/versioned/fake/register.go @@ -0,0 +1,57 @@ +/* +Copyright The HTNN 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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" + + apisv1 "mosn.io/htnn/controller/apis/v1" +) + +var scheme = runtime.NewScheme() +var codecs = serializer.NewCodecFactory(scheme) + +var localSchemeBuilder = runtime.SchemeBuilder{ + apisv1.AddToScheme, +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(scheme)) +} diff --git a/controller/pkg/client/clientset/versioned/scheme/doc.go b/controller/pkg/client/clientset/versioned/scheme/doc.go new file mode 100644 index 00000000..0ad828f1 --- /dev/null +++ b/controller/pkg/client/clientset/versioned/scheme/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The HTNN 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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package contains the scheme of the automatically generated clientset. +package scheme diff --git a/controller/pkg/client/clientset/versioned/scheme/register.go b/controller/pkg/client/clientset/versioned/scheme/register.go new file mode 100644 index 00000000..5286c308 --- /dev/null +++ b/controller/pkg/client/clientset/versioned/scheme/register.go @@ -0,0 +1,57 @@ +/* +Copyright The HTNN 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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package scheme + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" + + apisv1 "mosn.io/htnn/controller/apis/v1" +) + +var Scheme = runtime.NewScheme() +var Codecs = serializer.NewCodecFactory(Scheme) +var ParameterCodec = runtime.NewParameterCodec(Scheme) +var localSchemeBuilder = runtime.SchemeBuilder{ + apisv1.AddToScheme, +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(Scheme)) +} diff --git a/controller/pkg/client/clientset/versioned/typed/apis/v1/apis_client.go b/controller/pkg/client/clientset/versioned/typed/apis/v1/apis_client.go new file mode 100644 index 00000000..a58a1d67 --- /dev/null +++ b/controller/pkg/client/clientset/versioned/typed/apis/v1/apis_client.go @@ -0,0 +1,118 @@ +/* +Copyright The HTNN 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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "net/http" + + rest "k8s.io/client-go/rest" + + v1 "mosn.io/htnn/controller/apis/v1" + "mosn.io/htnn/controller/pkg/client/clientset/versioned/scheme" +) + +type ApisV1Interface interface { + RESTClient() rest.Interface + ConsumersGetter + HTTPFilterPoliciesGetter + ServiceRegistriesGetter +} + +// ApisV1Client is used to interact with features provided by the apis group. +type ApisV1Client struct { + restClient rest.Interface +} + +func (c *ApisV1Client) Consumers(namespace string) ConsumerInterface { + return newConsumers(c, namespace) +} + +func (c *ApisV1Client) HTTPFilterPolicies(namespace string) HTTPFilterPolicyInterface { + return newHTTPFilterPolicies(c, namespace) +} + +func (c *ApisV1Client) ServiceRegistries(namespace string) ServiceRegistryInterface { + return newServiceRegistries(c, namespace) +} + +// NewForConfig creates a new ApisV1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*ApisV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new ApisV1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*ApisV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &ApisV1Client{client}, nil +} + +// NewForConfigOrDie creates a new ApisV1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *ApisV1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new ApisV1Client for the given RESTClient. +func New(c rest.Interface) *ApisV1Client { + return &ApisV1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *ApisV1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/controller/pkg/client/clientset/versioned/typed/apis/v1/consumer.go b/controller/pkg/client/clientset/versioned/typed/apis/v1/consumer.go new file mode 100644 index 00000000..5a89dea9 --- /dev/null +++ b/controller/pkg/client/clientset/versioned/typed/apis/v1/consumer.go @@ -0,0 +1,196 @@ +/* +Copyright The HTNN 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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + + v1 "mosn.io/htnn/controller/apis/v1" + scheme "mosn.io/htnn/controller/pkg/client/clientset/versioned/scheme" +) + +// ConsumersGetter has a method to return a ConsumerInterface. +// A group's client should implement this interface. +type ConsumersGetter interface { + Consumers(namespace string) ConsumerInterface +} + +// ConsumerInterface has methods to work with Consumer resources. +type ConsumerInterface interface { + Create(ctx context.Context, consumer *v1.Consumer, opts metav1.CreateOptions) (*v1.Consumer, error) + Update(ctx context.Context, consumer *v1.Consumer, opts metav1.UpdateOptions) (*v1.Consumer, error) + UpdateStatus(ctx context.Context, consumer *v1.Consumer, opts metav1.UpdateOptions) (*v1.Consumer, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Consumer, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ConsumerList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Consumer, err error) + ConsumerExpansion +} + +// consumers implements ConsumerInterface +type consumers struct { + client rest.Interface + ns string +} + +// newConsumers returns a Consumers +func newConsumers(c *ApisV1Client, namespace string) *consumers { + return &consumers{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the consumer, and returns the corresponding consumer object, and an error if there is any. +func (c *consumers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Consumer, err error) { + result = &v1.Consumer{} + err = c.client.Get(). + Namespace(c.ns). + Resource("consumers"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Consumers that match those selectors. +func (c *consumers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ConsumerList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ConsumerList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("consumers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested consumers. +func (c *consumers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("consumers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a consumer and creates it. Returns the server's representation of the consumer, and an error, if there is any. +func (c *consumers) Create(ctx context.Context, consumer *v1.Consumer, opts metav1.CreateOptions) (result *v1.Consumer, err error) { + result = &v1.Consumer{} + err = c.client.Post(). + Namespace(c.ns). + Resource("consumers"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(consumer). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a consumer and updates it. Returns the server's representation of the consumer, and an error, if there is any. +func (c *consumers) Update(ctx context.Context, consumer *v1.Consumer, opts metav1.UpdateOptions) (result *v1.Consumer, err error) { + result = &v1.Consumer{} + err = c.client.Put(). + Namespace(c.ns). + Resource("consumers"). + Name(consumer.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(consumer). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *consumers) UpdateStatus(ctx context.Context, consumer *v1.Consumer, opts metav1.UpdateOptions) (result *v1.Consumer, err error) { + result = &v1.Consumer{} + err = c.client.Put(). + Namespace(c.ns). + Resource("consumers"). + Name(consumer.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(consumer). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the consumer and deletes it. Returns an error if one occurs. +func (c *consumers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("consumers"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *consumers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("consumers"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched consumer. +func (c *consumers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Consumer, err error) { + result = &v1.Consumer{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("consumers"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/controller/pkg/client/clientset/versioned/typed/apis/v1/doc.go b/controller/pkg/client/clientset/versioned/typed/apis/v1/doc.go new file mode 100644 index 00000000..1719329b --- /dev/null +++ b/controller/pkg/client/clientset/versioned/typed/apis/v1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The HTNN 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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1 diff --git a/controller/pkg/client/clientset/versioned/typed/apis/v1/fake/doc.go b/controller/pkg/client/clientset/versioned/typed/apis/v1/fake/doc.go new file mode 100644 index 00000000..b63a885b --- /dev/null +++ b/controller/pkg/client/clientset/versioned/typed/apis/v1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The HTNN 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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/controller/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_apis_client.go b/controller/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_apis_client.go new file mode 100644 index 00000000..14ad88ef --- /dev/null +++ b/controller/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_apis_client.go @@ -0,0 +1,49 @@ +/* +Copyright The HTNN 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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" + + v1 "mosn.io/htnn/controller/pkg/client/clientset/versioned/typed/apis/v1" +) + +type FakeApisV1 struct { + *testing.Fake +} + +func (c *FakeApisV1) Consumers(namespace string) v1.ConsumerInterface { + return &FakeConsumers{c, namespace} +} + +func (c *FakeApisV1) HTTPFilterPolicies(namespace string) v1.HTTPFilterPolicyInterface { + return &FakeHTTPFilterPolicies{c, namespace} +} + +func (c *FakeApisV1) ServiceRegistries(namespace string) v1.ServiceRegistryInterface { + return &FakeServiceRegistries{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeApisV1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/controller/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_consumer.go b/controller/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_consumer.go new file mode 100644 index 00000000..59774f88 --- /dev/null +++ b/controller/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_consumer.go @@ -0,0 +1,142 @@ +/* +Copyright The HTNN 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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + + v1 "mosn.io/htnn/controller/apis/v1" +) + +// FakeConsumers implements ConsumerInterface +type FakeConsumers struct { + Fake *FakeApisV1 + ns string +} + +var consumersResource = v1.SchemeGroupVersion.WithResource("consumers") + +var consumersKind = v1.SchemeGroupVersion.WithKind("Consumer") + +// Get takes name of the consumer, and returns the corresponding consumer object, and an error if there is any. +func (c *FakeConsumers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Consumer, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(consumersResource, c.ns, name), &v1.Consumer{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.Consumer), err +} + +// List takes label and field selectors, and returns the list of Consumers that match those selectors. +func (c *FakeConsumers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ConsumerList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(consumersResource, consumersKind, c.ns, opts), &v1.ConsumerList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1.ConsumerList{ListMeta: obj.(*v1.ConsumerList).ListMeta} + for _, item := range obj.(*v1.ConsumerList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested consumers. +func (c *FakeConsumers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(consumersResource, c.ns, opts)) + +} + +// Create takes the representation of a consumer and creates it. Returns the server's representation of the consumer, and an error, if there is any. +func (c *FakeConsumers) Create(ctx context.Context, consumer *v1.Consumer, opts metav1.CreateOptions) (result *v1.Consumer, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(consumersResource, c.ns, consumer), &v1.Consumer{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.Consumer), err +} + +// Update takes the representation of a consumer and updates it. Returns the server's representation of the consumer, and an error, if there is any. +func (c *FakeConsumers) Update(ctx context.Context, consumer *v1.Consumer, opts metav1.UpdateOptions) (result *v1.Consumer, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(consumersResource, c.ns, consumer), &v1.Consumer{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.Consumer), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeConsumers) UpdateStatus(ctx context.Context, consumer *v1.Consumer, opts metav1.UpdateOptions) (*v1.Consumer, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(consumersResource, "status", c.ns, consumer), &v1.Consumer{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.Consumer), err +} + +// Delete takes name of the consumer and deletes it. Returns an error if one occurs. +func (c *FakeConsumers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(consumersResource, c.ns, name, opts), &v1.Consumer{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeConsumers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + action := testing.NewDeleteCollectionAction(consumersResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1.ConsumerList{}) + return err +} + +// Patch applies the patch and returns the patched consumer. +func (c *FakeConsumers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Consumer, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(consumersResource, c.ns, name, pt, data, subresources...), &v1.Consumer{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.Consumer), err +} diff --git a/controller/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_httpfilterpolicy.go b/controller/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_httpfilterpolicy.go new file mode 100644 index 00000000..e8b63559 --- /dev/null +++ b/controller/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_httpfilterpolicy.go @@ -0,0 +1,142 @@ +/* +Copyright The HTNN 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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + + v1 "mosn.io/htnn/controller/apis/v1" +) + +// FakeHTTPFilterPolicies implements HTTPFilterPolicyInterface +type FakeHTTPFilterPolicies struct { + Fake *FakeApisV1 + ns string +} + +var httpfilterpoliciesResource = v1.SchemeGroupVersion.WithResource("httpfilterpolicies") + +var httpfilterpoliciesKind = v1.SchemeGroupVersion.WithKind("HTTPFilterPolicy") + +// Get takes name of the hTTPFilterPolicy, and returns the corresponding hTTPFilterPolicy object, and an error if there is any. +func (c *FakeHTTPFilterPolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.HTTPFilterPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(httpfilterpoliciesResource, c.ns, name), &v1.HTTPFilterPolicy{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.HTTPFilterPolicy), err +} + +// List takes label and field selectors, and returns the list of HTTPFilterPolicies that match those selectors. +func (c *FakeHTTPFilterPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.HTTPFilterPolicyList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(httpfilterpoliciesResource, httpfilterpoliciesKind, c.ns, opts), &v1.HTTPFilterPolicyList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1.HTTPFilterPolicyList{ListMeta: obj.(*v1.HTTPFilterPolicyList).ListMeta} + for _, item := range obj.(*v1.HTTPFilterPolicyList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested hTTPFilterPolicies. +func (c *FakeHTTPFilterPolicies) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(httpfilterpoliciesResource, c.ns, opts)) + +} + +// Create takes the representation of a hTTPFilterPolicy and creates it. Returns the server's representation of the hTTPFilterPolicy, and an error, if there is any. +func (c *FakeHTTPFilterPolicies) Create(ctx context.Context, hTTPFilterPolicy *v1.HTTPFilterPolicy, opts metav1.CreateOptions) (result *v1.HTTPFilterPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(httpfilterpoliciesResource, c.ns, hTTPFilterPolicy), &v1.HTTPFilterPolicy{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.HTTPFilterPolicy), err +} + +// Update takes the representation of a hTTPFilterPolicy and updates it. Returns the server's representation of the hTTPFilterPolicy, and an error, if there is any. +func (c *FakeHTTPFilterPolicies) Update(ctx context.Context, hTTPFilterPolicy *v1.HTTPFilterPolicy, opts metav1.UpdateOptions) (result *v1.HTTPFilterPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(httpfilterpoliciesResource, c.ns, hTTPFilterPolicy), &v1.HTTPFilterPolicy{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.HTTPFilterPolicy), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeHTTPFilterPolicies) UpdateStatus(ctx context.Context, hTTPFilterPolicy *v1.HTTPFilterPolicy, opts metav1.UpdateOptions) (*v1.HTTPFilterPolicy, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(httpfilterpoliciesResource, "status", c.ns, hTTPFilterPolicy), &v1.HTTPFilterPolicy{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.HTTPFilterPolicy), err +} + +// Delete takes name of the hTTPFilterPolicy and deletes it. Returns an error if one occurs. +func (c *FakeHTTPFilterPolicies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(httpfilterpoliciesResource, c.ns, name, opts), &v1.HTTPFilterPolicy{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeHTTPFilterPolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + action := testing.NewDeleteCollectionAction(httpfilterpoliciesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1.HTTPFilterPolicyList{}) + return err +} + +// Patch applies the patch and returns the patched hTTPFilterPolicy. +func (c *FakeHTTPFilterPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HTTPFilterPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(httpfilterpoliciesResource, c.ns, name, pt, data, subresources...), &v1.HTTPFilterPolicy{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.HTTPFilterPolicy), err +} diff --git a/controller/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_serviceregistry.go b/controller/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_serviceregistry.go new file mode 100644 index 00000000..b430bd85 --- /dev/null +++ b/controller/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_serviceregistry.go @@ -0,0 +1,142 @@ +/* +Copyright The HTNN 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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + + v1 "mosn.io/htnn/controller/apis/v1" +) + +// FakeServiceRegistries implements ServiceRegistryInterface +type FakeServiceRegistries struct { + Fake *FakeApisV1 + ns string +} + +var serviceregistriesResource = v1.SchemeGroupVersion.WithResource("serviceregistries") + +var serviceregistriesKind = v1.SchemeGroupVersion.WithKind("ServiceRegistry") + +// Get takes name of the serviceRegistry, and returns the corresponding serviceRegistry object, and an error if there is any. +func (c *FakeServiceRegistries) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceRegistry, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(serviceregistriesResource, c.ns, name), &v1.ServiceRegistry{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.ServiceRegistry), err +} + +// List takes label and field selectors, and returns the list of ServiceRegistries that match those selectors. +func (c *FakeServiceRegistries) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceRegistryList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(serviceregistriesResource, serviceregistriesKind, c.ns, opts), &v1.ServiceRegistryList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1.ServiceRegistryList{ListMeta: obj.(*v1.ServiceRegistryList).ListMeta} + for _, item := range obj.(*v1.ServiceRegistryList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested serviceRegistries. +func (c *FakeServiceRegistries) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(serviceregistriesResource, c.ns, opts)) + +} + +// Create takes the representation of a serviceRegistry and creates it. Returns the server's representation of the serviceRegistry, and an error, if there is any. +func (c *FakeServiceRegistries) Create(ctx context.Context, serviceRegistry *v1.ServiceRegistry, opts metav1.CreateOptions) (result *v1.ServiceRegistry, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(serviceregistriesResource, c.ns, serviceRegistry), &v1.ServiceRegistry{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.ServiceRegistry), err +} + +// Update takes the representation of a serviceRegistry and updates it. Returns the server's representation of the serviceRegistry, and an error, if there is any. +func (c *FakeServiceRegistries) Update(ctx context.Context, serviceRegistry *v1.ServiceRegistry, opts metav1.UpdateOptions) (result *v1.ServiceRegistry, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(serviceregistriesResource, c.ns, serviceRegistry), &v1.ServiceRegistry{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.ServiceRegistry), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeServiceRegistries) UpdateStatus(ctx context.Context, serviceRegistry *v1.ServiceRegistry, opts metav1.UpdateOptions) (*v1.ServiceRegistry, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(serviceregistriesResource, "status", c.ns, serviceRegistry), &v1.ServiceRegistry{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.ServiceRegistry), err +} + +// Delete takes name of the serviceRegistry and deletes it. Returns an error if one occurs. +func (c *FakeServiceRegistries) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(serviceregistriesResource, c.ns, name, opts), &v1.ServiceRegistry{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeServiceRegistries) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + action := testing.NewDeleteCollectionAction(serviceregistriesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1.ServiceRegistryList{}) + return err +} + +// Patch applies the patch and returns the patched serviceRegistry. +func (c *FakeServiceRegistries) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceRegistry, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(serviceregistriesResource, c.ns, name, pt, data, subresources...), &v1.ServiceRegistry{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.ServiceRegistry), err +} diff --git a/controller/pkg/client/clientset/versioned/typed/apis/v1/generated_expansion.go b/controller/pkg/client/clientset/versioned/typed/apis/v1/generated_expansion.go new file mode 100644 index 00000000..37e2b325 --- /dev/null +++ b/controller/pkg/client/clientset/versioned/typed/apis/v1/generated_expansion.go @@ -0,0 +1,25 @@ +/* +Copyright The HTNN 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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +type ConsumerExpansion interface{} + +type HTTPFilterPolicyExpansion interface{} + +type ServiceRegistryExpansion interface{} diff --git a/controller/pkg/client/clientset/versioned/typed/apis/v1/httpfilterpolicy.go b/controller/pkg/client/clientset/versioned/typed/apis/v1/httpfilterpolicy.go new file mode 100644 index 00000000..adabbf7b --- /dev/null +++ b/controller/pkg/client/clientset/versioned/typed/apis/v1/httpfilterpolicy.go @@ -0,0 +1,196 @@ +/* +Copyright The HTNN 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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + + v1 "mosn.io/htnn/controller/apis/v1" + scheme "mosn.io/htnn/controller/pkg/client/clientset/versioned/scheme" +) + +// HTTPFilterPoliciesGetter has a method to return a HTTPFilterPolicyInterface. +// A group's client should implement this interface. +type HTTPFilterPoliciesGetter interface { + HTTPFilterPolicies(namespace string) HTTPFilterPolicyInterface +} + +// HTTPFilterPolicyInterface has methods to work with HTTPFilterPolicy resources. +type HTTPFilterPolicyInterface interface { + Create(ctx context.Context, hTTPFilterPolicy *v1.HTTPFilterPolicy, opts metav1.CreateOptions) (*v1.HTTPFilterPolicy, error) + Update(ctx context.Context, hTTPFilterPolicy *v1.HTTPFilterPolicy, opts metav1.UpdateOptions) (*v1.HTTPFilterPolicy, error) + UpdateStatus(ctx context.Context, hTTPFilterPolicy *v1.HTTPFilterPolicy, opts metav1.UpdateOptions) (*v1.HTTPFilterPolicy, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.HTTPFilterPolicy, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.HTTPFilterPolicyList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HTTPFilterPolicy, err error) + HTTPFilterPolicyExpansion +} + +// hTTPFilterPolicies implements HTTPFilterPolicyInterface +type hTTPFilterPolicies struct { + client rest.Interface + ns string +} + +// newHTTPFilterPolicies returns a HTTPFilterPolicies +func newHTTPFilterPolicies(c *ApisV1Client, namespace string) *hTTPFilterPolicies { + return &hTTPFilterPolicies{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the hTTPFilterPolicy, and returns the corresponding hTTPFilterPolicy object, and an error if there is any. +func (c *hTTPFilterPolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.HTTPFilterPolicy, err error) { + result = &v1.HTTPFilterPolicy{} + err = c.client.Get(). + Namespace(c.ns). + Resource("httpfilterpolicies"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of HTTPFilterPolicies that match those selectors. +func (c *hTTPFilterPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.HTTPFilterPolicyList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.HTTPFilterPolicyList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("httpfilterpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested hTTPFilterPolicies. +func (c *hTTPFilterPolicies) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("httpfilterpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a hTTPFilterPolicy and creates it. Returns the server's representation of the hTTPFilterPolicy, and an error, if there is any. +func (c *hTTPFilterPolicies) Create(ctx context.Context, hTTPFilterPolicy *v1.HTTPFilterPolicy, opts metav1.CreateOptions) (result *v1.HTTPFilterPolicy, err error) { + result = &v1.HTTPFilterPolicy{} + err = c.client.Post(). + Namespace(c.ns). + Resource("httpfilterpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(hTTPFilterPolicy). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a hTTPFilterPolicy and updates it. Returns the server's representation of the hTTPFilterPolicy, and an error, if there is any. +func (c *hTTPFilterPolicies) Update(ctx context.Context, hTTPFilterPolicy *v1.HTTPFilterPolicy, opts metav1.UpdateOptions) (result *v1.HTTPFilterPolicy, err error) { + result = &v1.HTTPFilterPolicy{} + err = c.client.Put(). + Namespace(c.ns). + Resource("httpfilterpolicies"). + Name(hTTPFilterPolicy.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(hTTPFilterPolicy). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *hTTPFilterPolicies) UpdateStatus(ctx context.Context, hTTPFilterPolicy *v1.HTTPFilterPolicy, opts metav1.UpdateOptions) (result *v1.HTTPFilterPolicy, err error) { + result = &v1.HTTPFilterPolicy{} + err = c.client.Put(). + Namespace(c.ns). + Resource("httpfilterpolicies"). + Name(hTTPFilterPolicy.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(hTTPFilterPolicy). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the hTTPFilterPolicy and deletes it. Returns an error if one occurs. +func (c *hTTPFilterPolicies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("httpfilterpolicies"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *hTTPFilterPolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("httpfilterpolicies"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched hTTPFilterPolicy. +func (c *hTTPFilterPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HTTPFilterPolicy, err error) { + result = &v1.HTTPFilterPolicy{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("httpfilterpolicies"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/controller/pkg/client/clientset/versioned/typed/apis/v1/serviceregistry.go b/controller/pkg/client/clientset/versioned/typed/apis/v1/serviceregistry.go new file mode 100644 index 00000000..a8b96a62 --- /dev/null +++ b/controller/pkg/client/clientset/versioned/typed/apis/v1/serviceregistry.go @@ -0,0 +1,196 @@ +/* +Copyright The HTNN 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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + + v1 "mosn.io/htnn/controller/apis/v1" + scheme "mosn.io/htnn/controller/pkg/client/clientset/versioned/scheme" +) + +// ServiceRegistriesGetter has a method to return a ServiceRegistryInterface. +// A group's client should implement this interface. +type ServiceRegistriesGetter interface { + ServiceRegistries(namespace string) ServiceRegistryInterface +} + +// ServiceRegistryInterface has methods to work with ServiceRegistry resources. +type ServiceRegistryInterface interface { + Create(ctx context.Context, serviceRegistry *v1.ServiceRegistry, opts metav1.CreateOptions) (*v1.ServiceRegistry, error) + Update(ctx context.Context, serviceRegistry *v1.ServiceRegistry, opts metav1.UpdateOptions) (*v1.ServiceRegistry, error) + UpdateStatus(ctx context.Context, serviceRegistry *v1.ServiceRegistry, opts metav1.UpdateOptions) (*v1.ServiceRegistry, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ServiceRegistry, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceRegistryList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceRegistry, err error) + ServiceRegistryExpansion +} + +// serviceRegistries implements ServiceRegistryInterface +type serviceRegistries struct { + client rest.Interface + ns string +} + +// newServiceRegistries returns a ServiceRegistries +func newServiceRegistries(c *ApisV1Client, namespace string) *serviceRegistries { + return &serviceRegistries{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the serviceRegistry, and returns the corresponding serviceRegistry object, and an error if there is any. +func (c *serviceRegistries) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceRegistry, err error) { + result = &v1.ServiceRegistry{} + err = c.client.Get(). + Namespace(c.ns). + Resource("serviceregistries"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ServiceRegistries that match those selectors. +func (c *serviceRegistries) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceRegistryList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ServiceRegistryList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("serviceregistries"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested serviceRegistries. +func (c *serviceRegistries) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("serviceregistries"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a serviceRegistry and creates it. Returns the server's representation of the serviceRegistry, and an error, if there is any. +func (c *serviceRegistries) Create(ctx context.Context, serviceRegistry *v1.ServiceRegistry, opts metav1.CreateOptions) (result *v1.ServiceRegistry, err error) { + result = &v1.ServiceRegistry{} + err = c.client.Post(). + Namespace(c.ns). + Resource("serviceregistries"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceRegistry). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a serviceRegistry and updates it. Returns the server's representation of the serviceRegistry, and an error, if there is any. +func (c *serviceRegistries) Update(ctx context.Context, serviceRegistry *v1.ServiceRegistry, opts metav1.UpdateOptions) (result *v1.ServiceRegistry, err error) { + result = &v1.ServiceRegistry{} + err = c.client.Put(). + Namespace(c.ns). + Resource("serviceregistries"). + Name(serviceRegistry.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceRegistry). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *serviceRegistries) UpdateStatus(ctx context.Context, serviceRegistry *v1.ServiceRegistry, opts metav1.UpdateOptions) (result *v1.ServiceRegistry, err error) { + result = &v1.ServiceRegistry{} + err = c.client.Put(). + Namespace(c.ns). + Resource("serviceregistries"). + Name(serviceRegistry.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceRegistry). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the serviceRegistry and deletes it. Returns an error if one occurs. +func (c *serviceRegistries) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("serviceregistries"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *serviceRegistries) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("serviceregistries"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched serviceRegistry. +func (c *serviceRegistries) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceRegistry, err error) { + result = &v1.ServiceRegistry{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("serviceregistries"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/controller/tests/benchmark/httpfilterpolicy_controller_test.go b/controller/tests/benchmark/httpfilterpolicy_controller_test.go index 93b7b836..86c0233d 100644 --- a/controller/tests/benchmark/httpfilterpolicy_controller_test.go +++ b/controller/tests/benchmark/httpfilterpolicy_controller_test.go @@ -33,7 +33,7 @@ import ( controllerruntime "sigs.k8s.io/controller-runtime" gwapiv1a2 "sigs.k8s.io/gateway-api/apis/v1alpha2" - mosniov1 "mosn.io/htnn/controller/api/v1" + mosniov1 "mosn.io/htnn/controller/apis/v1" "mosn.io/htnn/controller/tests/pkg" ) diff --git a/controller/tests/benchmark/suite_test.go b/controller/tests/benchmark/suite_test.go index c829864a..4d9f8ef7 100644 --- a/controller/tests/benchmark/suite_test.go +++ b/controller/tests/benchmark/suite_test.go @@ -47,7 +47,7 @@ import ( gwapiv1 "sigs.k8s.io/gateway-api/apis/v1" "sigs.k8s.io/yaml" - mosniov1 "mosn.io/htnn/controller/api/v1" + mosniov1 "mosn.io/htnn/controller/apis/v1" "mosn.io/htnn/controller/internal/config" "mosn.io/htnn/controller/internal/controller" ) diff --git a/controller/tests/integration/controller/consumer_controller_test.go b/controller/tests/integration/controller/consumer_controller_test.go index 2163b685..022c775e 100644 --- a/controller/tests/integration/controller/consumer_controller_test.go +++ b/controller/tests/integration/controller/consumer_controller_test.go @@ -28,7 +28,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" "sigs.k8s.io/controller-runtime/pkg/client" - mosniov1 "mosn.io/htnn/controller/api/v1" + mosniov1 "mosn.io/htnn/controller/apis/v1" "mosn.io/htnn/controller/tests/integration/helper" "mosn.io/htnn/controller/tests/pkg" ) diff --git a/controller/tests/integration/controller/httpfilterpolicy_controller_test.go b/controller/tests/integration/controller/httpfilterpolicy_controller_test.go index b2942bc3..2b47441a 100644 --- a/controller/tests/integration/controller/httpfilterpolicy_controller_test.go +++ b/controller/tests/integration/controller/httpfilterpolicy_controller_test.go @@ -31,7 +31,7 @@ import ( gwapiv1 "sigs.k8s.io/gateway-api/apis/v1" gwapiv1a2 "sigs.k8s.io/gateway-api/apis/v1alpha2" - mosniov1 "mosn.io/htnn/controller/api/v1" + mosniov1 "mosn.io/htnn/controller/apis/v1" "mosn.io/htnn/controller/tests/integration/helper" "mosn.io/htnn/controller/tests/pkg" ) diff --git a/controller/tests/integration/controller/serviceregistry_controller_test.go b/controller/tests/integration/controller/serviceregistry_controller_test.go index e2d0cbea..2a01f3c9 100644 --- a/controller/tests/integration/controller/serviceregistry_controller_test.go +++ b/controller/tests/integration/controller/serviceregistry_controller_test.go @@ -24,7 +24,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" - mosniov1 "mosn.io/htnn/controller/api/v1" + mosniov1 "mosn.io/htnn/controller/apis/v1" "mosn.io/htnn/controller/tests/integration/helper" "mosn.io/htnn/controller/tests/pkg" ) diff --git a/controller/tests/integration/controller/suite_test.go b/controller/tests/integration/controller/suite_test.go index 502adafc..43375022 100644 --- a/controller/tests/integration/controller/suite_test.go +++ b/controller/tests/integration/controller/suite_test.go @@ -40,7 +40,7 @@ import ( metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server" gwapiv1 "sigs.k8s.io/gateway-api/apis/v1" - mosniov1 "mosn.io/htnn/controller/api/v1" + mosniov1 "mosn.io/htnn/controller/apis/v1" "mosn.io/htnn/controller/internal/config" "mosn.io/htnn/controller/internal/controller" "mosn.io/htnn/controller/internal/registry" diff --git a/controller/tests/integration/registries/nacos_test.go b/controller/tests/integration/registries/nacos_test.go index fad3a902..53529681 100644 --- a/controller/tests/integration/registries/nacos_test.go +++ b/controller/tests/integration/registries/nacos_test.go @@ -29,7 +29,7 @@ import ( istiov1b1 "istio.io/client-go/pkg/apis/networking/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" - mosniov1 "mosn.io/htnn/controller/api/v1" + mosniov1 "mosn.io/htnn/controller/apis/v1" "mosn.io/htnn/controller/internal/model" "mosn.io/htnn/controller/tests/integration/helper" "mosn.io/htnn/controller/tests/pkg" diff --git a/controller/tests/integration/registries/suite_test.go b/controller/tests/integration/registries/suite_test.go index 95aa8203..3e3da5c4 100644 --- a/controller/tests/integration/registries/suite_test.go +++ b/controller/tests/integration/registries/suite_test.go @@ -40,7 +40,7 @@ import ( metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server" gwapiv1 "sigs.k8s.io/gateway-api/apis/v1" - mosniov1 "mosn.io/htnn/controller/api/v1" + mosniov1 "mosn.io/htnn/controller/apis/v1" "mosn.io/htnn/controller/internal/config" "mosn.io/htnn/controller/internal/controller" "mosn.io/htnn/controller/internal/registry" diff --git a/controller/tests/integration/webhook/webhook_suite_test.go b/controller/tests/integration/webhook/webhook_suite_test.go index c6f58a55..60d7b96a 100644 --- a/controller/tests/integration/webhook/webhook_suite_test.go +++ b/controller/tests/integration/webhook/webhook_suite_test.go @@ -40,7 +40,7 @@ import ( metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server" "sigs.k8s.io/controller-runtime/pkg/webhook" - mosniov1 "mosn.io/htnn/controller/api/v1" + mosniov1 "mosn.io/htnn/controller/apis/v1" ) // These tests use Ginkgo (BDD-style Go testing framework). Refer to diff --git a/controller/tests/pkg/utils.go b/controller/tests/pkg/utils.go index 70daac86..cb5c94ef 100644 --- a/controller/tests/pkg/utils.go +++ b/controller/tests/pkg/utils.go @@ -29,7 +29,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" gwapiv1 "sigs.k8s.io/gateway-api/apis/v1" - mosniov1 "mosn.io/htnn/controller/api/v1" + mosniov1 "mosn.io/htnn/controller/apis/v1" ) // MapToObj convert the Go struct to k8s client.Object diff --git a/e2e/e2e_test.go b/e2e/e2e_test.go index 5891feb3..5b584e5e 100644 --- a/e2e/e2e_test.go +++ b/e2e/e2e_test.go @@ -23,7 +23,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/config" gwapiv1 "sigs.k8s.io/gateway-api/apis/v1" - mosniov1 "mosn.io/htnn/controller/api/v1" + mosniov1 "mosn.io/htnn/controller/apis/v1" "mosn.io/htnn/e2e/pkg/suite" _ "mosn.io/htnn/e2e/tests" // import all tests ) diff --git a/e2e/pkg/k8s/k8s.go b/e2e/pkg/k8s/k8s.go index 27739cbb..c9cac234 100644 --- a/e2e/pkg/k8s/k8s.go +++ b/e2e/pkg/k8s/k8s.go @@ -32,7 +32,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" gwapiv1 "sigs.k8s.io/gateway-api/apis/v1" - mosniov1 "mosn.io/htnn/controller/api/v1" + mosniov1 "mosn.io/htnn/controller/apis/v1" "mosn.io/htnn/pkg/log" ) diff --git a/e2e/tests/consumer.go b/e2e/tests/consumer.go index 158d81db..5fc07593 100644 --- a/e2e/tests/consumer.go +++ b/e2e/tests/consumer.go @@ -25,7 +25,7 @@ import ( "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" - mosniov1 "mosn.io/htnn/controller/api/v1" + mosniov1 "mosn.io/htnn/controller/apis/v1" "mosn.io/htnn/e2e/pkg/k8s" "mosn.io/htnn/e2e/pkg/suite" ) diff --git a/go.mod b/go.mod index 56864ee2..4b099ef4 100644 --- a/go.mod +++ b/go.mod @@ -64,6 +64,7 @@ require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect + github.com/evanphx/json-patch v5.7.0+incompatible // indirect github.com/evanphx/json-patch/v5 v5.8.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-errors/errors v1.0.1 // indirect From 71ab4e87777a872ec221ddfb81d603e3ff7697f4 Mon Sep 17 00:00:00 2001 From: spacewander Date: Mon, 25 Mar 2024 10:08:27 +0800 Subject: [PATCH 2/2] ignore pkg client Signed-off-by: spacewander --- .github/codecov.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/codecov.yml b/.github/codecov.yml index f651b518..47f3ca58 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -24,3 +24,4 @@ ignore: - "**/*.pb.go" - "**/*.pb.validate.go" - '**/zz_generated.deepcopy.go' + - "controller/pkg/client"