├── .gitignore ├── README.md ├── Dockerfile.builder ├── Jenkinsfile ├── aspenmesh-boilerplate.go.txt ├── pkg ├── apis │ ├── rbac │ │ ├── register.go │ │ └── v1alpha1 │ │ │ ├── doc.go │ │ │ ├── register.go │ │ │ ├── rbac_config.go │ │ │ ├── service_role.go │ │ │ └── service_role_binding.go │ ├── networking │ │ ├── register.go │ │ └── v1alpha3 │ │ │ ├── doc.go │ │ │ ├── register.go │ │ │ ├── envoy_filter_test.go │ │ │ ├── envoy_filter.go │ │ │ ├── gateway.go │ │ │ ├── service_entry.go │ │ │ ├── virtual_service.go │ │ │ └── destination_rule.go │ └── authentication │ │ ├── register.go │ │ └── v1alpha1 │ │ ├── doc.go │ │ ├── register.go │ │ ├── policy.go │ │ ├── meshpolicy.go │ │ └── zz_generated.deepcopy.go └── client │ ├── clientset │ └── versioned │ │ ├── doc.go │ │ ├── fake │ │ ├── doc.go │ │ ├── register.go │ │ └── clientset_generated.go │ │ ├── typed │ │ ├── rbac │ │ │ └── v1alpha1 │ │ │ │ ├── fake │ │ │ │ ├── doc.go │ │ │ │ ├── fake_rbac_client.go │ │ │ │ └── fake_rbacconfig.go │ │ │ │ ├── doc.go │ │ │ │ ├── generated_expansion.go │ │ │ │ └── rbac_client.go │ │ ├── networking │ │ │ └── v1alpha3 │ │ │ │ ├── fake │ │ │ │ ├── doc.go │ │ │ │ ├── fake_networking_client.go │ │ │ │ └── fake_gateway.go │ │ │ │ ├── doc.go │ │ │ │ ├── generated_expansion.go │ │ │ │ └── networking_client.go │ │ └── authentication │ │ │ └── v1alpha1 │ │ │ ├── fake │ │ │ ├── doc.go │ │ │ ├── fake_authentication_client.go │ │ │ ├── fake_policy.go │ │ │ └── fake_meshpolicy.go │ │ │ ├── doc.go │ │ │ ├── generated_expansion.go │ │ │ └── authentication_client.go │ │ ├── scheme │ │ ├── doc.go │ │ └── register.go │ │ └── clientset.go │ ├── listers │ ├── authentication │ │ └── v1alpha1 │ │ │ ├── expansion_generated.go │ │ │ ├── meshpolicy.go │ │ │ └── policy.go │ ├── rbac │ │ └── v1alpha1 │ │ │ ├── expansion_generated.go │ │ │ ├── rbacconfig.go │ │ │ ├── servicerole.go │ │ │ └── servicerolebinding.go │ └── networking │ │ └── v1alpha3 │ │ ├── expansion_generated.go │ │ ├── gateway.go │ │ ├── envoyfilter.go │ │ ├── serviceentry.go │ │ ├── virtualservice.go │ │ └── destinationrule.go │ └── informers │ └── externalversions │ ├── internalinterfaces │ └── factory_interfaces.go │ ├── rbac │ ├── interface.go │ └── v1alpha1 │ │ ├── interface.go │ │ ├── rbacconfig.go │ │ ├── servicerole.go │ │ └── servicerolebinding.go │ ├── networking │ ├── interface.go │ └── v1alpha3 │ │ ├── interface.go │ │ ├── gateway.go │ │ ├── envoyfilter.go │ │ ├── serviceentry.go │ │ ├── virtualservice.go │ │ └── destinationrule.go │ ├── authentication │ ├── interface.go │ └── v1alpha1 │ │ ├── interface.go │ │ ├── meshpolicy.go │ │ └── policy.go │ └── generic.go ├── scripts └── generate-clientset.sh ├── Makefile ├── go.mod └── cmd └── example-client └── client.go /.gitignore: -------------------------------------------------------------------------------- 1 | vendor 2 | *.swp 3 | _build 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Introduction 2 | 3 | This repository contains generated Go client code for Istio resources 4 | -------------------------------------------------------------------------------- /Dockerfile.builder: -------------------------------------------------------------------------------- 1 | FROM golang:1.12-stretch as builder 2 | 3 | WORKDIR /go/src/github.com/aspenmesh/istio-client-go 4 | 5 | COPY . . 6 | 7 | RUN make test 8 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | node('docker') { 2 | timestamps { 3 | properties([disableConcurrentBuilds()]) 4 | 5 | stage('Build') { 6 | checkout scm 7 | sh 'make docker-build' 8 | } 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /aspenmesh-boilerplate.go.txt: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright YEAR The Kubernetes Authors. 3 | Portions Copyright YEAR Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | -------------------------------------------------------------------------------- /pkg/apis/rbac/register.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2017 The Kubernetes Authors. 3 | Portions Copyright 2018 Aspen Mesh Authors. 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | Unless required by applicable law or agreed to in writing, software 9 | distributed under the License is distributed on an "AS IS" BASIS, 10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | See the License for the specific language governing permissions and 12 | limitations under the License. 13 | */ 14 | 15 | package rbaccontroller 16 | 17 | const ( 18 | GroupName = "rbac.istio.io" 19 | ) 20 | -------------------------------------------------------------------------------- /pkg/apis/networking/register.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2017 The Kubernetes Authors. 3 | Portions Copyright 2018 Aspen Mesh Authors. 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | Unless required by applicable law or agreed to in writing, software 9 | distributed under the License is distributed on an "AS IS" BASIS, 10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | See the License for the specific language governing permissions and 12 | limitations under the License. 13 | */ 14 | 15 | package networkingcontroller 16 | 17 | const ( 18 | GroupName = "networking.istio.io" 19 | ) 20 | -------------------------------------------------------------------------------- /pkg/apis/authentication/register.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2017 The Kubernetes Authors. 3 | Portions Copyright 2018 Aspen Mesh Authors. 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | Unless required by applicable law or agreed to in writing, software 9 | distributed under the License is distributed on an "AS IS" BASIS, 10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | See the License for the specific language governing permissions and 12 | limitations under the License. 13 | */ 14 | 15 | package authenticationcontroller 16 | 17 | const ( 18 | GroupName = "authentication.istio.io" 19 | ) 20 | -------------------------------------------------------------------------------- /scripts/generate-clientset.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -eEo pipefail 4 | 5 | if [[ ! $GOPATH ]]; then 6 | echo >&2 "GOPATH not defined. Must be run in a Go environment." 7 | exit 1 8 | fi 9 | 10 | SRC_DIR=$GOPATH/src 11 | CLIENT_DIR=$SRC_DIR/github.com/aspenmesh/istio-client-go 12 | 13 | go mod download 14 | 15 | go install k8s.io/code-generator/cmd/client-gen 16 | 17 | CODE_GEN=$(go list -f '{{ .Dir }}' -m k8s.io/code-generator) 18 | 19 | chmod +x $CODE_GEN/generate-groups.sh 20 | 21 | $CODE_GEN/generate-groups.sh all \ 22 | github.com/aspenmesh/istio-client-go/pkg/client github.com/aspenmesh/istio-client-go/pkg/apis \ 23 | "networking:v1alpha3, authentication:v1alpha1, rbac:v1alpha1" \ 24 | --output-base $CLIENT_DIR/../../.. \ 25 | --go-header-file $CLIENT_DIR/aspenmesh-boilerplate.go.txt 26 | -------------------------------------------------------------------------------- /pkg/apis/rbac/v1alpha1/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2017 The Kubernetes Authors. 3 | Portions Copyright 2018 Aspen Mesh Authors. 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | Unless required by applicable law or agreed to in writing, software 9 | distributed under the License is distributed on an "AS IS" BASIS, 10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | See the License for the specific language governing permissions and 12 | limitations under the License. 13 | */ 14 | 15 | // +k8s:deepcopy-gen=package 16 | 17 | // Package v1alpha1 is the v1alpha3 version of the rbac.istio.io API. 18 | // +groupName=rbac.istio.io 19 | package v1alpha1 20 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by client-gen. DO NOT EDIT. 19 | 20 | // This package has the automatically generated clientset. 21 | package versioned 22 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/fake/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by client-gen. DO NOT EDIT. 19 | 20 | // This package has the automatically generated fake clientset. 21 | package fake 22 | -------------------------------------------------------------------------------- /pkg/apis/networking/v1alpha3/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2017 The Kubernetes Authors. 3 | Portions Copyright 2018 Aspen Mesh Authors. 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | Unless required by applicable law or agreed to in writing, software 9 | distributed under the License is distributed on an "AS IS" BASIS, 10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | See the License for the specific language governing permissions and 12 | limitations under the License. 13 | */ 14 | 15 | // +k8s:deepcopy-gen=package 16 | 17 | // Package v1alpha3 is the v1alpha3 version of the networking.istio.io API. 18 | // +groupName=networking.istio.io 19 | package v1alpha3 20 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/rbac/v1alpha1/fake/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by client-gen. DO NOT EDIT. 19 | 20 | // Package fake has the automatically generated clients. 21 | package fake 22 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/scheme/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by client-gen. DO NOT EDIT. 19 | 20 | // This package contains the scheme of the automatically generated clientset. 21 | package scheme 22 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/networking/v1alpha3/fake/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by client-gen. DO NOT EDIT. 19 | 20 | // Package fake has the automatically generated clients. 21 | package fake 22 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/rbac/v1alpha1/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by client-gen. DO NOT EDIT. 19 | 20 | // This package has the automatically generated typed clients. 21 | package v1alpha1 22 | -------------------------------------------------------------------------------- /pkg/apis/authentication/v1alpha1/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2017 The Kubernetes Authors. 3 | Portions Copyright 2018 Aspen Mesh Authors. 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | Unless required by applicable law or agreed to in writing, software 9 | distributed under the License is distributed on an "AS IS" BASIS, 10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | See the License for the specific language governing permissions and 12 | limitations under the License. 13 | */ 14 | 15 | // +k8s:deepcopy-gen=package 16 | 17 | // Package v1alpha1 is the v1alpha1 version of the authentication.istio.io API. 18 | // +groupName=authentication.istio.io 19 | package v1alpha1 20 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/authentication/v1alpha1/fake/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by client-gen. DO NOT EDIT. 19 | 20 | // Package fake has the automatically generated clients. 21 | package fake 22 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/networking/v1alpha3/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by client-gen. DO NOT EDIT. 19 | 20 | // This package has the automatically generated typed clients. 21 | package v1alpha3 22 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/authentication/v1alpha1/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by client-gen. DO NOT EDIT. 19 | 20 | // This package has the automatically generated typed clients. 21 | package v1alpha1 22 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/authentication/v1alpha1/generated_expansion.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by client-gen. DO NOT EDIT. 19 | 20 | package v1alpha1 21 | 22 | type MeshPolicyExpansion interface{} 23 | 24 | type PolicyExpansion interface{} 25 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/rbac/v1alpha1/generated_expansion.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by client-gen. DO NOT EDIT. 19 | 20 | package v1alpha1 21 | 22 | type RbacConfigExpansion interface{} 23 | 24 | type ServiceRoleExpansion interface{} 25 | 26 | type ServiceRoleBindingExpansion interface{} 27 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/networking/v1alpha3/generated_expansion.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by client-gen. DO NOT EDIT. 19 | 20 | package v1alpha3 21 | 22 | type DestinationRuleExpansion interface{} 23 | 24 | type EnvoyFilterExpansion interface{} 25 | 26 | type GatewayExpansion interface{} 27 | 28 | type ServiceEntryExpansion interface{} 29 | 30 | type VirtualServiceExpansion interface{} 31 | -------------------------------------------------------------------------------- /pkg/client/listers/authentication/v1alpha1/expansion_generated.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by lister-gen. DO NOT EDIT. 19 | 20 | package v1alpha1 21 | 22 | // MeshPolicyListerExpansion allows custom methods to be added to 23 | // MeshPolicyLister. 24 | type MeshPolicyListerExpansion interface{} 25 | 26 | // PolicyListerExpansion allows custom methods to be added to 27 | // PolicyLister. 28 | type PolicyListerExpansion interface{} 29 | 30 | // PolicyNamespaceListerExpansion allows custom methods to be added to 31 | // PolicyNamespaceLister. 32 | type PolicyNamespaceListerExpansion interface{} 33 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | ifeq ($(BRANCH_NAME)$(BUILD_ID),) 2 | BUILDER_TAG := istio-client-go-builder 3 | else 4 | BUILDER_TAG := localhost:5000/istio-client-go:${BRANCH_NAME}-${BUILD_ID} 5 | endif 6 | 7 | # pkg/apis is the location for CRD APIs. 8 | # pkg/client is auto generated code 9 | # zz_generated.deepcopy.go under pkg/apis/// is also generated 10 | # code 11 | DIRS := pkg/apis/networking pkg/apis/networking/v1alpha3 pkg/apis/authentication pkg/apis/authentication/v1alpha1 pkg/apis/rbac pkg/apis/rbac/v1alpha1 12 | DEPS_ALL := $(foreach dir, $(DIRS), $(wildcard $(dir)/*.go)) 13 | GENERATED_FILES_PATTERN := %zz_generated.deepcopy.go 14 | DEPS := $(filter-out $(GENERATED_FILES_PATTERN), $(DEPS_ALL)) 15 | GENERATED_FILES := $(filter $(GENERATED_FILES_PATTERN), $(DEPS_ALL)) 16 | 17 | all: generate-code test 18 | 19 | # print-% is used to aid troubleshooting. Type `make print-XYZ` to print the value of XYZ. 20 | print-% : ; @echo $* = $($*) 21 | 22 | generate-code: 23 | GO111MODULE=on ./scripts/generate-clientset.sh 24 | 25 | clean-generated: 26 | rm -rf pkg/client 27 | rm -rf $(GENERATED_FILES) 28 | 29 | clean: 30 | rm -rf _build 31 | 32 | docker-build: 33 | docker build --target=builder -t $(BUILDER_TAG) \ 34 | -f Dockerfile.builder . 35 | 36 | test: 37 | GO111MODULE=on go build -v -o ${PWD}/_build/example-client ./cmd/example-client/... 38 | GO111MODULE=on go test ./pkg/apis/... 39 | 40 | print-%: 41 | @echo '$*=$($*)' 42 | 43 | .PHONY: all clean-generated print-% docker-build 44 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/authentication/v1alpha1/fake/fake_authentication_client.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by client-gen. DO NOT EDIT. 19 | 20 | package fake 21 | 22 | import ( 23 | v1alpha1 "github.com/aspenmesh/istio-client-go/pkg/client/clientset/versioned/typed/authentication/v1alpha1" 24 | rest "k8s.io/client-go/rest" 25 | testing "k8s.io/client-go/testing" 26 | ) 27 | 28 | type FakeAuthenticationV1alpha1 struct { 29 | *testing.Fake 30 | } 31 | 32 | func (c *FakeAuthenticationV1alpha1) MeshPolicies() v1alpha1.MeshPolicyInterface { 33 | return &FakeMeshPolicies{c} 34 | } 35 | 36 | func (c *FakeAuthenticationV1alpha1) Policies(namespace string) v1alpha1.PolicyInterface { 37 | return &FakePolicies{c, namespace} 38 | } 39 | 40 | // RESTClient returns a RESTClient that is used to communicate 41 | // with API server by this client implementation. 42 | func (c *FakeAuthenticationV1alpha1) RESTClient() rest.Interface { 43 | var ret *rest.RESTClient 44 | return ret 45 | } 46 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/aspenmesh/istio-client-go 2 | 3 | go 1.12 4 | 5 | require ( 6 | github.com/evanphx/json-patch v4.5.0+incompatible // indirect 7 | github.com/gogo/protobuf v1.3.0 8 | github.com/golang/groupcache v0.0.0-20191002201903-404acd9df4cc // indirect 9 | github.com/golang/protobuf v1.3.2 10 | github.com/googleapis/gnostic v0.3.1 // indirect 11 | github.com/hashicorp/golang-lru v0.5.3 // indirect 12 | github.com/imdario/mergo v0.3.7 // indirect 13 | github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect 14 | github.com/pkg/errors v0.8.1 // indirect 15 | github.com/sirupsen/logrus v1.4.2 16 | github.com/stretchr/testify v1.4.0 17 | golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7 // indirect 18 | golang.org/x/net v0.0.0-20190912160710-24e19bdeb0f2 // indirect 19 | golang.org/x/sys v0.0.0-20190912141932-bc967efca4b8 // indirect 20 | golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect 21 | google.golang.org/appengine v1.6.2 // indirect 22 | gopkg.in/inf.v0 v0.9.1 // indirect 23 | istio.io/api v0.0.0-20191115173247-e1a1952e5b81 24 | k8s.io/apimachinery v0.0.0-20190913080033-27d36303b655 25 | k8s.io/client-go v0.0.0-20190620085101-78d2af792bab 26 | k8s.io/code-generator v0.0.0-20190612205613-18da4a14b22b // indirect 27 | ) 28 | 29 | replace ( 30 | github.com/golang/protobuf => github.com/golang/protobuf v1.3.2 31 | k8s.io/api => k8s.io/api v0.0.0-20191003000013-35e20aa79eb8 32 | k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20190913080033-27d36303b655 33 | k8s.io/client-go => k8s.io/client-go v0.0.0-20190918200256-06eb1244587a 34 | k8s.io/code-generator => k8s.io/code-generator v0.0.0-20190927045949-f81bca4f5e85 35 | ) 36 | -------------------------------------------------------------------------------- /pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by informer-gen. DO NOT EDIT. 19 | 20 | package internalinterfaces 21 | 22 | import ( 23 | time "time" 24 | 25 | versioned "github.com/aspenmesh/istio-client-go/pkg/client/clientset/versioned" 26 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 27 | runtime "k8s.io/apimachinery/pkg/runtime" 28 | cache "k8s.io/client-go/tools/cache" 29 | ) 30 | 31 | // NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer. 32 | type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer 33 | 34 | // SharedInformerFactory a small interface to allow for adding an informer without an import cycle 35 | type SharedInformerFactory interface { 36 | Start(stopCh <-chan struct{}) 37 | InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer 38 | } 39 | 40 | // TweakListOptionsFunc is a function that transforms a v1.ListOptions. 41 | type TweakListOptionsFunc func(*v1.ListOptions) 42 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/rbac/v1alpha1/fake/fake_rbac_client.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by client-gen. DO NOT EDIT. 19 | 20 | package fake 21 | 22 | import ( 23 | v1alpha1 "github.com/aspenmesh/istio-client-go/pkg/client/clientset/versioned/typed/rbac/v1alpha1" 24 | rest "k8s.io/client-go/rest" 25 | testing "k8s.io/client-go/testing" 26 | ) 27 | 28 | type FakeRbacV1alpha1 struct { 29 | *testing.Fake 30 | } 31 | 32 | func (c *FakeRbacV1alpha1) RbacConfigs(namespace string) v1alpha1.RbacConfigInterface { 33 | return &FakeRbacConfigs{c, namespace} 34 | } 35 | 36 | func (c *FakeRbacV1alpha1) ServiceRoles(namespace string) v1alpha1.ServiceRoleInterface { 37 | return &FakeServiceRoles{c, namespace} 38 | } 39 | 40 | func (c *FakeRbacV1alpha1) ServiceRoleBindings(namespace string) v1alpha1.ServiceRoleBindingInterface { 41 | return &FakeServiceRoleBindings{c, namespace} 42 | } 43 | 44 | // RESTClient returns a RESTClient that is used to communicate 45 | // with API server by this client implementation. 46 | func (c *FakeRbacV1alpha1) RESTClient() rest.Interface { 47 | var ret *rest.RESTClient 48 | return ret 49 | } 50 | -------------------------------------------------------------------------------- /pkg/client/listers/rbac/v1alpha1/expansion_generated.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by lister-gen. DO NOT EDIT. 19 | 20 | package v1alpha1 21 | 22 | // RbacConfigListerExpansion allows custom methods to be added to 23 | // RbacConfigLister. 24 | type RbacConfigListerExpansion interface{} 25 | 26 | // RbacConfigNamespaceListerExpansion allows custom methods to be added to 27 | // RbacConfigNamespaceLister. 28 | type RbacConfigNamespaceListerExpansion interface{} 29 | 30 | // ServiceRoleListerExpansion allows custom methods to be added to 31 | // ServiceRoleLister. 32 | type ServiceRoleListerExpansion interface{} 33 | 34 | // ServiceRoleNamespaceListerExpansion allows custom methods to be added to 35 | // ServiceRoleNamespaceLister. 36 | type ServiceRoleNamespaceListerExpansion interface{} 37 | 38 | // ServiceRoleBindingListerExpansion allows custom methods to be added to 39 | // ServiceRoleBindingLister. 40 | type ServiceRoleBindingListerExpansion interface{} 41 | 42 | // ServiceRoleBindingNamespaceListerExpansion allows custom methods to be added to 43 | // ServiceRoleBindingNamespaceLister. 44 | type ServiceRoleBindingNamespaceListerExpansion interface{} 45 | -------------------------------------------------------------------------------- /pkg/client/informers/externalversions/rbac/interface.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by informer-gen. DO NOT EDIT. 19 | 20 | package rbac 21 | 22 | import ( 23 | internalinterfaces "github.com/aspenmesh/istio-client-go/pkg/client/informers/externalversions/internalinterfaces" 24 | v1alpha1 "github.com/aspenmesh/istio-client-go/pkg/client/informers/externalversions/rbac/v1alpha1" 25 | ) 26 | 27 | // Interface provides access to each of this group's versions. 28 | type Interface interface { 29 | // V1alpha1 provides access to shared informers for resources in V1alpha1. 30 | V1alpha1() v1alpha1.Interface 31 | } 32 | 33 | type group struct { 34 | factory internalinterfaces.SharedInformerFactory 35 | namespace string 36 | tweakListOptions internalinterfaces.TweakListOptionsFunc 37 | } 38 | 39 | // New returns a new Interface. 40 | func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { 41 | return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} 42 | } 43 | 44 | // V1alpha1 returns a new v1alpha1.Interface. 45 | func (g *group) V1alpha1() v1alpha1.Interface { 46 | return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) 47 | } 48 | -------------------------------------------------------------------------------- /pkg/client/informers/externalversions/networking/interface.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by informer-gen. DO NOT EDIT. 19 | 20 | package networking 21 | 22 | import ( 23 | internalinterfaces "github.com/aspenmesh/istio-client-go/pkg/client/informers/externalversions/internalinterfaces" 24 | v1alpha3 "github.com/aspenmesh/istio-client-go/pkg/client/informers/externalversions/networking/v1alpha3" 25 | ) 26 | 27 | // Interface provides access to each of this group's versions. 28 | type Interface interface { 29 | // V1alpha3 provides access to shared informers for resources in V1alpha3. 30 | V1alpha3() v1alpha3.Interface 31 | } 32 | 33 | type group struct { 34 | factory internalinterfaces.SharedInformerFactory 35 | namespace string 36 | tweakListOptions internalinterfaces.TweakListOptionsFunc 37 | } 38 | 39 | // New returns a new Interface. 40 | func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { 41 | return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} 42 | } 43 | 44 | // V1alpha3 returns a new v1alpha3.Interface. 45 | func (g *group) V1alpha3() v1alpha3.Interface { 46 | return v1alpha3.New(g.factory, g.namespace, g.tweakListOptions) 47 | } 48 | -------------------------------------------------------------------------------- /pkg/client/informers/externalversions/authentication/interface.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by informer-gen. DO NOT EDIT. 19 | 20 | package authentication 21 | 22 | import ( 23 | v1alpha1 "github.com/aspenmesh/istio-client-go/pkg/client/informers/externalversions/authentication/v1alpha1" 24 | internalinterfaces "github.com/aspenmesh/istio-client-go/pkg/client/informers/externalversions/internalinterfaces" 25 | ) 26 | 27 | // Interface provides access to each of this group's versions. 28 | type Interface interface { 29 | // V1alpha1 provides access to shared informers for resources in V1alpha1. 30 | V1alpha1() v1alpha1.Interface 31 | } 32 | 33 | type group struct { 34 | factory internalinterfaces.SharedInformerFactory 35 | namespace string 36 | tweakListOptions internalinterfaces.TweakListOptionsFunc 37 | } 38 | 39 | // New returns a new Interface. 40 | func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { 41 | return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} 42 | } 43 | 44 | // V1alpha1 returns a new v1alpha1.Interface. 45 | func (g *group) V1alpha1() v1alpha1.Interface { 46 | return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) 47 | } 48 | -------------------------------------------------------------------------------- /pkg/apis/authentication/v1alpha1/register.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2017 The Kubernetes Authors. 3 | Portions Copyright 2018 Aspen Mesh Authors. 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | Unless required by applicable law or agreed to in writing, software 9 | distributed under the License is distributed on an "AS IS" BASIS, 10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | See the License for the specific language governing permissions and 12 | limitations under the License. 13 | */ 14 | 15 | package v1alpha1 16 | 17 | import ( 18 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 19 | "k8s.io/apimachinery/pkg/runtime" 20 | "k8s.io/apimachinery/pkg/runtime/schema" 21 | 22 | "github.com/aspenmesh/istio-client-go/pkg/apis/authentication" 23 | ) 24 | 25 | // SchemeGroupVersion is group version used to register these objects 26 | var SchemeGroupVersion = schema.GroupVersion{Group: authenticationcontroller.GroupName, Version: "v1alpha1"} 27 | 28 | // Kind takes an unqualified kind and returns back a Group qualified GroupKind 29 | func Kind(kind string) schema.GroupKind { 30 | return SchemeGroupVersion.WithKind(kind).GroupKind() 31 | } 32 | 33 | // Resource takes an unqualified resource and returns a Group qualified 34 | // GroupResource 35 | func Resource(resource string) schema.GroupResource { 36 | return SchemeGroupVersion.WithResource(resource).GroupResource() 37 | } 38 | 39 | var ( 40 | SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) 41 | AddToScheme = SchemeBuilder.AddToScheme 42 | ) 43 | 44 | // Adds the list of known types to Scheme. 45 | func addKnownTypes(scheme *runtime.Scheme) error { 46 | scheme.AddKnownTypes(SchemeGroupVersion, 47 | &Policy{}, 48 | &PolicyList{}, 49 | &MeshPolicy{}, 50 | &MeshPolicyList{}, 51 | ) 52 | metav1.AddToGroupVersion(scheme, SchemeGroupVersion) 53 | return nil 54 | } 55 | -------------------------------------------------------------------------------- /pkg/apis/rbac/v1alpha1/register.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2017 The Kubernetes Authors. 3 | Portions Copyright 2018 Aspen Mesh Authors. 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | Unless required by applicable law or agreed to in writing, software 9 | distributed under the License is distributed on an "AS IS" BASIS, 10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | See the License for the specific language governing permissions and 12 | limitations under the License. 13 | */ 14 | 15 | package v1alpha1 16 | 17 | import ( 18 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 19 | "k8s.io/apimachinery/pkg/runtime" 20 | "k8s.io/apimachinery/pkg/runtime/schema" 21 | 22 | rbaccontroller "github.com/aspenmesh/istio-client-go/pkg/apis/rbac" 23 | ) 24 | 25 | // SchemeGroupVersion is group version used to register these objects 26 | var SchemeGroupVersion = schema.GroupVersion{Group: rbaccontroller.GroupName, Version: "v1alpha1"} 27 | 28 | // Kind takes an unqualified kind and returns back a Group qualified GroupKind 29 | func Kind(kind string) schema.GroupKind { 30 | return SchemeGroupVersion.WithKind(kind).GroupKind() 31 | } 32 | 33 | // Resource takes an unqualified resource and returns a Group qualified 34 | // GroupResource 35 | func Resource(resource string) schema.GroupResource { 36 | return SchemeGroupVersion.WithResource(resource).GroupResource() 37 | } 38 | 39 | var ( 40 | SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) 41 | AddToScheme = SchemeBuilder.AddToScheme 42 | ) 43 | 44 | // Adds the list of known types to Scheme. 45 | func addKnownTypes(scheme *runtime.Scheme) error { 46 | scheme.AddKnownTypes(SchemeGroupVersion, 47 | &RbacConfig{}, 48 | &RbacConfigList{}, 49 | &ServiceRole{}, 50 | &ServiceRoleList{}, 51 | &ServiceRoleBinding{}, 52 | &ServiceRoleBindingList{}, 53 | ) 54 | metav1.AddToGroupVersion(scheme, SchemeGroupVersion) 55 | return nil 56 | } 57 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/networking/v1alpha3/fake/fake_networking_client.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by client-gen. DO NOT EDIT. 19 | 20 | package fake 21 | 22 | import ( 23 | v1alpha3 "github.com/aspenmesh/istio-client-go/pkg/client/clientset/versioned/typed/networking/v1alpha3" 24 | rest "k8s.io/client-go/rest" 25 | testing "k8s.io/client-go/testing" 26 | ) 27 | 28 | type FakeNetworkingV1alpha3 struct { 29 | *testing.Fake 30 | } 31 | 32 | func (c *FakeNetworkingV1alpha3) DestinationRules(namespace string) v1alpha3.DestinationRuleInterface { 33 | return &FakeDestinationRules{c, namespace} 34 | } 35 | 36 | func (c *FakeNetworkingV1alpha3) EnvoyFilters(namespace string) v1alpha3.EnvoyFilterInterface { 37 | return &FakeEnvoyFilters{c, namespace} 38 | } 39 | 40 | func (c *FakeNetworkingV1alpha3) Gateways(namespace string) v1alpha3.GatewayInterface { 41 | return &FakeGateways{c, namespace} 42 | } 43 | 44 | func (c *FakeNetworkingV1alpha3) ServiceEntries(namespace string) v1alpha3.ServiceEntryInterface { 45 | return &FakeServiceEntries{c, namespace} 46 | } 47 | 48 | func (c *FakeNetworkingV1alpha3) VirtualServices(namespace string) v1alpha3.VirtualServiceInterface { 49 | return &FakeVirtualServices{c, namespace} 50 | } 51 | 52 | // RESTClient returns a RESTClient that is used to communicate 53 | // with API server by this client implementation. 54 | func (c *FakeNetworkingV1alpha3) RESTClient() rest.Interface { 55 | var ret *rest.RESTClient 56 | return ret 57 | } 58 | -------------------------------------------------------------------------------- /pkg/client/informers/externalversions/authentication/v1alpha1/interface.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by informer-gen. DO NOT EDIT. 19 | 20 | package v1alpha1 21 | 22 | import ( 23 | internalinterfaces "github.com/aspenmesh/istio-client-go/pkg/client/informers/externalversions/internalinterfaces" 24 | ) 25 | 26 | // Interface provides access to all the informers in this group version. 27 | type Interface interface { 28 | // MeshPolicies returns a MeshPolicyInformer. 29 | MeshPolicies() MeshPolicyInformer 30 | // Policies returns a PolicyInformer. 31 | Policies() PolicyInformer 32 | } 33 | 34 | type version struct { 35 | factory internalinterfaces.SharedInformerFactory 36 | namespace string 37 | tweakListOptions internalinterfaces.TweakListOptionsFunc 38 | } 39 | 40 | // New returns a new Interface. 41 | func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { 42 | return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} 43 | } 44 | 45 | // MeshPolicies returns a MeshPolicyInformer. 46 | func (v *version) MeshPolicies() MeshPolicyInformer { 47 | return &meshPolicyInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} 48 | } 49 | 50 | // Policies returns a PolicyInformer. 51 | func (v *version) Policies() PolicyInformer { 52 | return &policyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} 53 | } 54 | -------------------------------------------------------------------------------- /pkg/apis/networking/v1alpha3/register.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2017 The Kubernetes Authors. 3 | Portions Copyright 2018 Aspen Mesh Authors. 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | Unless required by applicable law or agreed to in writing, software 9 | distributed under the License is distributed on an "AS IS" BASIS, 10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | See the License for the specific language governing permissions and 12 | limitations under the License. 13 | */ 14 | 15 | package v1alpha3 16 | 17 | import ( 18 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 19 | "k8s.io/apimachinery/pkg/runtime" 20 | "k8s.io/apimachinery/pkg/runtime/schema" 21 | 22 | "github.com/aspenmesh/istio-client-go/pkg/apis/networking" 23 | ) 24 | 25 | // SchemeGroupVersion is group version used to register these objects 26 | var SchemeGroupVersion = schema.GroupVersion{Group: networkingcontroller.GroupName, Version: "v1alpha3"} 27 | 28 | // Kind takes an unqualified kind and returns back a Group qualified GroupKind 29 | func Kind(kind string) schema.GroupKind { 30 | return SchemeGroupVersion.WithKind(kind).GroupKind() 31 | } 32 | 33 | // Resource takes an unqualified resource and returns a Group qualified 34 | // GroupResource 35 | func Resource(resource string) schema.GroupResource { 36 | return SchemeGroupVersion.WithResource(resource).GroupResource() 37 | } 38 | 39 | var ( 40 | SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) 41 | AddToScheme = SchemeBuilder.AddToScheme 42 | ) 43 | 44 | // Adds the list of known types to Scheme. 45 | func addKnownTypes(scheme *runtime.Scheme) error { 46 | scheme.AddKnownTypes(SchemeGroupVersion, 47 | &VirtualService{}, 48 | &VirtualServiceList{}, 49 | &DestinationRule{}, 50 | &DestinationRuleList{}, 51 | &Gateway{}, 52 | &GatewayList{}, 53 | &ServiceEntry{}, 54 | &ServiceEntryList{}, 55 | &EnvoyFilter{}, 56 | &EnvoyFilterList{}, 57 | ) 58 | metav1.AddToGroupVersion(scheme, SchemeGroupVersion) 59 | return nil 60 | } 61 | -------------------------------------------------------------------------------- /pkg/client/listers/authentication/v1alpha1/meshpolicy.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by lister-gen. DO NOT EDIT. 19 | 20 | package v1alpha1 21 | 22 | import ( 23 | v1alpha1 "github.com/aspenmesh/istio-client-go/pkg/apis/authentication/v1alpha1" 24 | "k8s.io/apimachinery/pkg/api/errors" 25 | "k8s.io/apimachinery/pkg/labels" 26 | "k8s.io/client-go/tools/cache" 27 | ) 28 | 29 | // MeshPolicyLister helps list MeshPolicies. 30 | type MeshPolicyLister interface { 31 | // List lists all MeshPolicies in the indexer. 32 | List(selector labels.Selector) (ret []*v1alpha1.MeshPolicy, err error) 33 | // Get retrieves the MeshPolicy from the index for a given name. 34 | Get(name string) (*v1alpha1.MeshPolicy, error) 35 | MeshPolicyListerExpansion 36 | } 37 | 38 | // meshPolicyLister implements the MeshPolicyLister interface. 39 | type meshPolicyLister struct { 40 | indexer cache.Indexer 41 | } 42 | 43 | // NewMeshPolicyLister returns a new MeshPolicyLister. 44 | func NewMeshPolicyLister(indexer cache.Indexer) MeshPolicyLister { 45 | return &meshPolicyLister{indexer: indexer} 46 | } 47 | 48 | // List lists all MeshPolicies in the indexer. 49 | func (s *meshPolicyLister) List(selector labels.Selector) (ret []*v1alpha1.MeshPolicy, err error) { 50 | err = cache.ListAll(s.indexer, selector, func(m interface{}) { 51 | ret = append(ret, m.(*v1alpha1.MeshPolicy)) 52 | }) 53 | return ret, err 54 | } 55 | 56 | // Get retrieves the MeshPolicy from the index for a given name. 57 | func (s *meshPolicyLister) Get(name string) (*v1alpha1.MeshPolicy, error) { 58 | obj, exists, err := s.indexer.GetByKey(name) 59 | if err != nil { 60 | return nil, err 61 | } 62 | if !exists { 63 | return nil, errors.NewNotFound(v1alpha1.Resource("meshpolicy"), name) 64 | } 65 | return obj.(*v1alpha1.MeshPolicy), nil 66 | } 67 | -------------------------------------------------------------------------------- /pkg/client/listers/networking/v1alpha3/expansion_generated.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by lister-gen. DO NOT EDIT. 19 | 20 | package v1alpha3 21 | 22 | // DestinationRuleListerExpansion allows custom methods to be added to 23 | // DestinationRuleLister. 24 | type DestinationRuleListerExpansion interface{} 25 | 26 | // DestinationRuleNamespaceListerExpansion allows custom methods to be added to 27 | // DestinationRuleNamespaceLister. 28 | type DestinationRuleNamespaceListerExpansion interface{} 29 | 30 | // EnvoyFilterListerExpansion allows custom methods to be added to 31 | // EnvoyFilterLister. 32 | type EnvoyFilterListerExpansion interface{} 33 | 34 | // EnvoyFilterNamespaceListerExpansion allows custom methods to be added to 35 | // EnvoyFilterNamespaceLister. 36 | type EnvoyFilterNamespaceListerExpansion interface{} 37 | 38 | // GatewayListerExpansion allows custom methods to be added to 39 | // GatewayLister. 40 | type GatewayListerExpansion interface{} 41 | 42 | // GatewayNamespaceListerExpansion allows custom methods to be added to 43 | // GatewayNamespaceLister. 44 | type GatewayNamespaceListerExpansion interface{} 45 | 46 | // ServiceEntryListerExpansion allows custom methods to be added to 47 | // ServiceEntryLister. 48 | type ServiceEntryListerExpansion interface{} 49 | 50 | // ServiceEntryNamespaceListerExpansion allows custom methods to be added to 51 | // ServiceEntryNamespaceLister. 52 | type ServiceEntryNamespaceListerExpansion interface{} 53 | 54 | // VirtualServiceListerExpansion allows custom methods to be added to 55 | // VirtualServiceLister. 56 | type VirtualServiceListerExpansion interface{} 57 | 58 | // VirtualServiceNamespaceListerExpansion allows custom methods to be added to 59 | // VirtualServiceNamespaceLister. 60 | type VirtualServiceNamespaceListerExpansion interface{} 61 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/fake/register.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by client-gen. DO NOT EDIT. 19 | 20 | package fake 21 | 22 | import ( 23 | authenticationv1alpha1 "github.com/aspenmesh/istio-client-go/pkg/apis/authentication/v1alpha1" 24 | networkingv1alpha3 "github.com/aspenmesh/istio-client-go/pkg/apis/networking/v1alpha3" 25 | rbacv1alpha1 "github.com/aspenmesh/istio-client-go/pkg/apis/rbac/v1alpha1" 26 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 27 | runtime "k8s.io/apimachinery/pkg/runtime" 28 | schema "k8s.io/apimachinery/pkg/runtime/schema" 29 | serializer "k8s.io/apimachinery/pkg/runtime/serializer" 30 | utilruntime "k8s.io/apimachinery/pkg/util/runtime" 31 | ) 32 | 33 | var scheme = runtime.NewScheme() 34 | var codecs = serializer.NewCodecFactory(scheme) 35 | var parameterCodec = runtime.NewParameterCodec(scheme) 36 | var localSchemeBuilder = runtime.SchemeBuilder{ 37 | authenticationv1alpha1.AddToScheme, 38 | networkingv1alpha3.AddToScheme, 39 | rbacv1alpha1.AddToScheme, 40 | } 41 | 42 | // AddToScheme adds all types of this clientset into the given scheme. This allows composition 43 | // of clientsets, like in: 44 | // 45 | // import ( 46 | // "k8s.io/client-go/kubernetes" 47 | // clientsetscheme "k8s.io/client-go/kubernetes/scheme" 48 | // aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" 49 | // ) 50 | // 51 | // kclientset, _ := kubernetes.NewForConfig(c) 52 | // _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) 53 | // 54 | // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types 55 | // correctly. 56 | var AddToScheme = localSchemeBuilder.AddToScheme 57 | 58 | func init() { 59 | v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) 60 | utilruntime.Must(AddToScheme(scheme)) 61 | } 62 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/scheme/register.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by client-gen. DO NOT EDIT. 19 | 20 | package scheme 21 | 22 | import ( 23 | authenticationv1alpha1 "github.com/aspenmesh/istio-client-go/pkg/apis/authentication/v1alpha1" 24 | networkingv1alpha3 "github.com/aspenmesh/istio-client-go/pkg/apis/networking/v1alpha3" 25 | rbacv1alpha1 "github.com/aspenmesh/istio-client-go/pkg/apis/rbac/v1alpha1" 26 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 27 | runtime "k8s.io/apimachinery/pkg/runtime" 28 | schema "k8s.io/apimachinery/pkg/runtime/schema" 29 | serializer "k8s.io/apimachinery/pkg/runtime/serializer" 30 | utilruntime "k8s.io/apimachinery/pkg/util/runtime" 31 | ) 32 | 33 | var Scheme = runtime.NewScheme() 34 | var Codecs = serializer.NewCodecFactory(Scheme) 35 | var ParameterCodec = runtime.NewParameterCodec(Scheme) 36 | var localSchemeBuilder = runtime.SchemeBuilder{ 37 | authenticationv1alpha1.AddToScheme, 38 | networkingv1alpha3.AddToScheme, 39 | rbacv1alpha1.AddToScheme, 40 | } 41 | 42 | // AddToScheme adds all types of this clientset into the given scheme. This allows composition 43 | // of clientsets, like in: 44 | // 45 | // import ( 46 | // "k8s.io/client-go/kubernetes" 47 | // clientsetscheme "k8s.io/client-go/kubernetes/scheme" 48 | // aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" 49 | // ) 50 | // 51 | // kclientset, _ := kubernetes.NewForConfig(c) 52 | // _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) 53 | // 54 | // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types 55 | // correctly. 56 | var AddToScheme = localSchemeBuilder.AddToScheme 57 | 58 | func init() { 59 | v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) 60 | utilruntime.Must(AddToScheme(Scheme)) 61 | } 62 | -------------------------------------------------------------------------------- /pkg/apis/networking/v1alpha3/envoy_filter_test.go: -------------------------------------------------------------------------------- 1 | package v1alpha3 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | "fmt" 7 | "testing" 8 | 9 | log "github.com/sirupsen/logrus" 10 | "github.com/stretchr/testify/assert" 11 | istiov1alpha3 "istio.io/api/networking/v1alpha3" 12 | ) 13 | 14 | func Test_EnvoyFilter(t *testing.T) { 15 | buffer := bytes.NewBufferString(`{ 16 | "apiVersion":"networking.istio.io/v1alpha3", 17 | "kind":"EnvoyFilter", 18 | "metadata":{ 19 | "name":"test-envoy-filter", 20 | "namespace":"istio-system" 21 | }, 22 | "spec":{ 23 | "filters": [ 24 | { 25 | "filterConfig": { 26 | "cluster_pattern": "pattern_from.svc.cluster.local", 27 | "cluster_replacement": "pattern_to.svc.cluster.local" 28 | }, 29 | "filterName": "envoy.filters.network.tcp_cluster_rewrite", 30 | "filterType": "NETWORK", 31 | "insertPosition": { 32 | "index": "AFTER", 33 | "relativeTo": "envoy.filters.network.sni_cluster" 34 | }, 35 | "listenerMatch": { 36 | "listenerType": "GATEWAY", 37 | "portNumber": 15013 38 | } 39 | } 40 | ] 41 | } 42 | }`) 43 | 44 | envoyFilter := EnvoyFilter{} 45 | err := json.Unmarshal(buffer.Bytes(), &envoyFilter) 46 | assert.Equal(t, nil, err, "Could not unmarshal message") 47 | vss := envoyFilter.GetSpecMessage().(*istiov1alpha3.EnvoyFilter) 48 | 49 | log.WithFields(log.Fields{ 50 | "obj": fmt.Sprintf("%+v", envoyFilter), 51 | "spec": vss.String(), 52 | }).Info("Unmarshalled message") 53 | 54 | // metadata 55 | assert.Equal(t, "networking.istio.io/v1alpha3", envoyFilter.TypeMeta.APIVersion) 56 | assert.Equal(t, "EnvoyFilter", envoyFilter.TypeMeta.Kind) 57 | assert.Equal(t, "test-envoy-filter", envoyFilter.GetObjectMeta().GetName()) 58 | 59 | // TODO: Not clear how read FilterConfig 60 | 61 | // FilterName 62 | assert.Equal(t, "envoy.filters.network.tcp_cluster_rewrite", envoyFilter.Spec.Filters[0].FilterName) 63 | 64 | // FilterType 65 | assert.Equal(t, istiov1alpha3.EnvoyFilter_Filter_NETWORK, envoyFilter.Spec.Filters[0].FilterType) 66 | 67 | // InsertPosition 68 | assert.Equal(t, istiov1alpha3.EnvoyFilter_InsertPosition_AFTER, envoyFilter.Spec.Filters[0].InsertPosition.Index) 69 | assert.Equal(t, "envoy.filters.network.sni_cluster", envoyFilter.Spec.Filters[0].InsertPosition.RelativeTo) 70 | 71 | // ListenerMatch 72 | assert.Equal(t, istiov1alpha3.EnvoyFilter_DeprecatedListenerMatch_GATEWAY, envoyFilter.Spec.Filters[0].ListenerMatch.ListenerType) 73 | assert.Equal(t, uint32(15013), envoyFilter.Spec.Filters[0].ListenerMatch.PortNumber) 74 | } 75 | -------------------------------------------------------------------------------- /pkg/client/informers/externalversions/rbac/v1alpha1/interface.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by informer-gen. DO NOT EDIT. 19 | 20 | package v1alpha1 21 | 22 | import ( 23 | internalinterfaces "github.com/aspenmesh/istio-client-go/pkg/client/informers/externalversions/internalinterfaces" 24 | ) 25 | 26 | // Interface provides access to all the informers in this group version. 27 | type Interface interface { 28 | // RbacConfigs returns a RbacConfigInformer. 29 | RbacConfigs() RbacConfigInformer 30 | // ServiceRoles returns a ServiceRoleInformer. 31 | ServiceRoles() ServiceRoleInformer 32 | // ServiceRoleBindings returns a ServiceRoleBindingInformer. 33 | ServiceRoleBindings() ServiceRoleBindingInformer 34 | } 35 | 36 | type version struct { 37 | factory internalinterfaces.SharedInformerFactory 38 | namespace string 39 | tweakListOptions internalinterfaces.TweakListOptionsFunc 40 | } 41 | 42 | // New returns a new Interface. 43 | func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { 44 | return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} 45 | } 46 | 47 | // RbacConfigs returns a RbacConfigInformer. 48 | func (v *version) RbacConfigs() RbacConfigInformer { 49 | return &rbacConfigInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} 50 | } 51 | 52 | // ServiceRoles returns a ServiceRoleInformer. 53 | func (v *version) ServiceRoles() ServiceRoleInformer { 54 | return &serviceRoleInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} 55 | } 56 | 57 | // ServiceRoleBindings returns a ServiceRoleBindingInformer. 58 | func (v *version) ServiceRoleBindings() ServiceRoleBindingInformer { 59 | return &serviceRoleBindingInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} 60 | } 61 | -------------------------------------------------------------------------------- /pkg/apis/networking/v1alpha3/envoy_filter.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2017 The Kubernetes Authors. 3 | Portions Copyright 2018 Aspen Mesh Authors. 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | Unless required by applicable law or agreed to in writing, software 9 | distributed under the License is distributed on an "AS IS" BASIS, 10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | See the License for the specific language governing permissions and 12 | limitations under the License. 13 | */ 14 | 15 | package v1alpha3 16 | 17 | import ( 18 | "bufio" 19 | "bytes" 20 | 21 | "github.com/gogo/protobuf/jsonpb" 22 | "github.com/gogo/protobuf/proto" 23 | istiov1alpha3 "istio.io/api/networking/v1alpha3" 24 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 25 | ) 26 | 27 | // +genclient 28 | // +genclient:noStatus 29 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 30 | 31 | // EnvoyFilter is an Istio EnvoyFilter resource 32 | type EnvoyFilter struct { 33 | metav1.TypeMeta `json:",inline"` 34 | metav1.ObjectMeta `json:"metadata,omitempty"` 35 | 36 | Spec EnvoyFilterSpec `json:"spec"` 37 | } 38 | 39 | func (vs *EnvoyFilter) GetSpecMessage() proto.Message { 40 | return &vs.Spec.EnvoyFilter 41 | } 42 | 43 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 44 | 45 | // EnvoyFilterList is a list of EnvoyFilter resources 46 | type EnvoyFilterList struct { 47 | metav1.TypeMeta `json:",inline"` 48 | metav1.ListMeta `json:"metadata"` 49 | 50 | Items []EnvoyFilter `json:"items"` 51 | } 52 | 53 | // EnvoyFilterSpec is a wrapper around Istio EnvoyFilter 54 | type EnvoyFilterSpec struct { 55 | istiov1alpha3.EnvoyFilter 56 | } 57 | 58 | // DeepCopyInto is a deepcopy function, copying the receiver, writing into out. in must be non-nil. 59 | // Based of https://github.com/istio/istio/blob/release-0.8/pilot/pkg/config/kube/crd/types.go#L450 60 | func (in *EnvoyFilterSpec) DeepCopyInto(out *EnvoyFilterSpec) { 61 | *out = *in 62 | } 63 | 64 | func (vs *EnvoyFilterSpec) MarshalJSON() ([]byte, error) { 65 | buffer := bytes.Buffer{} 66 | writer := bufio.NewWriter(&buffer) 67 | marshaler := jsonpb.Marshaler{} 68 | err := marshaler.Marshal(writer, &vs.EnvoyFilter) 69 | if err != nil { 70 | return nil, err 71 | } 72 | 73 | writer.Flush() 74 | return buffer.Bytes(), nil 75 | } 76 | 77 | func (vs *EnvoyFilterSpec) UnmarshalJSON(b []byte) error { 78 | reader := bytes.NewReader(b) 79 | unmarshaler := jsonpb.Unmarshaler{} 80 | err := unmarshaler.Unmarshal(reader, &vs.EnvoyFilter) 81 | if err != nil { 82 | return err 83 | } 84 | return nil 85 | } 86 | -------------------------------------------------------------------------------- /pkg/apis/networking/v1alpha3/gateway.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2017 The Kubernetes Authors. 3 | Portions Copyright 2018 Aspen Mesh Authors. 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | Unless required by applicable law or agreed to in writing, software 9 | distributed under the License is distributed on an "AS IS" BASIS, 10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | See the License for the specific language governing permissions and 12 | limitations under the License. 13 | */ 14 | 15 | package v1alpha3 16 | 17 | import ( 18 | "bufio" 19 | "bytes" 20 | "github.com/gogo/protobuf/jsonpb" 21 | "github.com/golang/protobuf/proto" 22 | istiov1alpha3 "istio.io/api/networking/v1alpha3" 23 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 24 | "log" 25 | ) 26 | 27 | // +genclient 28 | // +genclient:noStatus 29 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 30 | 31 | // Gateway is a Istio Gateway resource 32 | type Gateway struct { 33 | metav1.TypeMeta `json:",inline"` 34 | metav1.ObjectMeta `json:"metadata,omitempty"` 35 | 36 | Spec GatewaySpec `json:"spec"` 37 | } 38 | 39 | func (vs *Gateway) GetSpecMessage() proto.Message { 40 | return &vs.Spec.Gateway 41 | } 42 | 43 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 44 | 45 | // GatewayList is a list of Gateway resources 46 | type GatewayList struct { 47 | metav1.TypeMeta `json:",inline"` 48 | metav1.ListMeta `json:"metadata"` 49 | 50 | Items []Gateway `json:"items"` 51 | } 52 | 53 | // GatewaySpec is a wrapper around Istio Gateway 54 | type GatewaySpec struct { 55 | istiov1alpha3.Gateway 56 | } 57 | 58 | func (p *GatewaySpec) MarshalJSON() ([]byte, error) { 59 | buffer := bytes.Buffer{} 60 | writer := bufio.NewWriter(&buffer) 61 | marshaler := jsonpb.Marshaler{} 62 | err := marshaler.Marshal(writer, &p.Gateway) 63 | if err != nil { 64 | log.Printf("Could not marshal GatewaySpec. Error: %v", err) 65 | return nil, err 66 | } 67 | 68 | writer.Flush() 69 | return buffer.Bytes(), nil 70 | } 71 | 72 | func (p *GatewaySpec) UnmarshalJSON(b []byte) error { 73 | reader := bytes.NewReader(b) 74 | unmarshaler := jsonpb.Unmarshaler{} 75 | err := unmarshaler.Unmarshal(reader, &p.Gateway) 76 | if err != nil { 77 | log.Printf("Could not unmarshal GatewaySpec. Error: %v", err) 78 | return err 79 | } 80 | return nil 81 | } 82 | 83 | // DeepCopyInto is a deepcopy function, copying the receiver, writing into out. in must be non-nil. 84 | // Based of https://github.com/istio/istio/blob/release-0.8/pilot/pkg/config/kube/crd/types.go#L450 85 | func (in *GatewaySpec) DeepCopyInto(out *GatewaySpec) { 86 | *out = *in 87 | } 88 | -------------------------------------------------------------------------------- /pkg/apis/networking/v1alpha3/service_entry.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2017 The Kubernetes Authors. 3 | Portions Copyright 2018 Aspen Mesh Authors. 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | Unless required by applicable law or agreed to in writing, software 9 | distributed under the License is distributed on an "AS IS" BASIS, 10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | See the License for the specific language governing permissions and 12 | limitations under the License. 13 | */ 14 | 15 | package v1alpha3 16 | 17 | import ( 18 | "bufio" 19 | "bytes" 20 | "github.com/gogo/protobuf/jsonpb" 21 | "github.com/golang/protobuf/proto" 22 | istiov1alpha3 "istio.io/api/networking/v1alpha3" 23 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 24 | "log" 25 | ) 26 | 27 | // +genclient 28 | // +genclient:noStatus 29 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 30 | 31 | // ServiceEntry is a Istio ServiceEntry resource 32 | type ServiceEntry struct { 33 | metav1.TypeMeta `json:",inline"` 34 | metav1.ObjectMeta `json:"metadata,omitempty"` 35 | 36 | Spec ServiceEntrySpec `json:"spec"` 37 | } 38 | 39 | func (vs *ServiceEntry) GetSpecMessage() proto.Message { 40 | return &vs.Spec.ServiceEntry 41 | } 42 | 43 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 44 | 45 | // ServiceEntryList is a list of ServiceEntry resources 46 | type ServiceEntryList struct { 47 | metav1.TypeMeta `json:",inline"` 48 | metav1.ListMeta `json:"metadata"` 49 | 50 | Items []ServiceEntry `json:"items"` 51 | } 52 | 53 | // ServiceEntrySpec is a wrapper around Istio ServiceEntry 54 | type ServiceEntrySpec struct { 55 | istiov1alpha3.ServiceEntry 56 | } 57 | 58 | func (p *ServiceEntrySpec) MarshalJSON() ([]byte, error) { 59 | buffer := bytes.Buffer{} 60 | writer := bufio.NewWriter(&buffer) 61 | marshaler := jsonpb.Marshaler{} 62 | err := marshaler.Marshal(writer, &p.ServiceEntry) 63 | if err != nil { 64 | log.Printf("Could not marshal ServiceEntrySpec. Error: %v", err) 65 | return nil, err 66 | } 67 | 68 | writer.Flush() 69 | return buffer.Bytes(), nil 70 | } 71 | 72 | func (p *ServiceEntrySpec) UnmarshalJSON(b []byte) error { 73 | reader := bytes.NewReader(b) 74 | unmarshaler := jsonpb.Unmarshaler{} 75 | err := unmarshaler.Unmarshal(reader, &p.ServiceEntry) 76 | if err != nil { 77 | log.Printf("Could not unmarshal ServiceEntrySpec. Error: %v", err) 78 | return err 79 | } 80 | return nil 81 | } 82 | 83 | // DeepCopyInto is a deepcopy function, copying the receiver, writing into out. in must be non-nil. 84 | // Based of https://github.com/istio/istio/blob/release-0.8/pilot/pkg/config/kube/crd/types.go#L450 85 | func (in *ServiceEntrySpec) DeepCopyInto(out *ServiceEntrySpec) { 86 | *out = *in 87 | } 88 | -------------------------------------------------------------------------------- /pkg/apis/authentication/v1alpha1/policy.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2017 The Kubernetes Authors. 3 | Portions Copyright 2018 Aspen Mesh Authors. 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | Unless required by applicable law or agreed to in writing, software 9 | distributed under the License is distributed on an "AS IS" BASIS, 10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | See the License for the specific language governing permissions and 12 | limitations under the License. 13 | */ 14 | 15 | package v1alpha1 16 | 17 | import ( 18 | "bufio" 19 | "bytes" 20 | "log" 21 | 22 | "github.com/gogo/protobuf/jsonpb" 23 | "github.com/golang/protobuf/proto" 24 | istiov1alpha1 "istio.io/api/authentication/v1alpha1" 25 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 26 | ) 27 | 28 | // +genclient 29 | // +genclient:noStatus 30 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 31 | 32 | // Policy is a Istio Policy resource 33 | type Policy struct { 34 | metav1.TypeMeta `json:",inline"` 35 | metav1.ObjectMeta `json:"metadata,omitempty"` 36 | 37 | Spec PolicySpec `json:"spec"` 38 | } 39 | 40 | func (p *Policy) GetSpecMessage() proto.Message { 41 | return &p.Spec.Policy 42 | } 43 | 44 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 45 | 46 | // PolicyList is a list of Policy resources 47 | type PolicyList struct { 48 | metav1.TypeMeta `json:",inline"` 49 | metav1.ListMeta `json:"metadata"` 50 | 51 | Items []Policy `json:"items"` 52 | } 53 | 54 | // PolicySpec in a wrapper around Istio Policy 55 | type PolicySpec struct { 56 | istiov1alpha1.Policy 57 | } 58 | 59 | // Taken from https://github.com/michaelkipper/istio-client-go/commit/7c8e95b5d9220d47c107bb6f3b0b71fbc8af3ef7#diff-1c6fa6bfc320013a249f4b6d0ccdd928R65 60 | func (p *PolicySpec) MarshalJSON() ([]byte, error) { 61 | buffer := bytes.Buffer{} 62 | writer := bufio.NewWriter(&buffer) 63 | marshaler := jsonpb.Marshaler{} 64 | err := marshaler.Marshal(writer, &p.Policy) 65 | if err != nil { 66 | log.Printf("Could not marshal PolicySpec. Error: %v", err) 67 | return nil, err 68 | } 69 | 70 | writer.Flush() 71 | return buffer.Bytes(), nil 72 | } 73 | 74 | func (p *PolicySpec) UnmarshalJSON(b []byte) error { 75 | reader := bytes.NewReader(b) 76 | unmarshaler := jsonpb.Unmarshaler{} 77 | err := unmarshaler.Unmarshal(reader, &p.Policy) 78 | if err != nil { 79 | log.Printf("Could not unmarshal PolicySpec. Error: %v", err) 80 | return err 81 | } 82 | return nil 83 | } 84 | 85 | // DeepCopyInto is a deepcopy function, copying the receiver, writing into out. in must be non-nil. 86 | // Based of https://github.com/istio/istio/blob/release-0.8/pilot/pkg/config/kube/crd/types.go#L450 87 | func (in *PolicySpec) DeepCopyInto(out *PolicySpec) { 88 | *out = *in 89 | } 90 | -------------------------------------------------------------------------------- /pkg/apis/rbac/v1alpha1/rbac_config.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2017 The Kubernetes Authors. 3 | Portions Copyright 2018 Aspen Mesh Authors. 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | Unless required by applicable law or agreed to in writing, software 9 | distributed under the License is distributed on an "AS IS" BASIS, 10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | See the License for the specific language governing permissions and 12 | limitations under the License. 13 | */ 14 | 15 | package v1alpha1 16 | 17 | import ( 18 | "bufio" 19 | "bytes" 20 | "log" 21 | 22 | "github.com/gogo/protobuf/jsonpb" 23 | "github.com/golang/protobuf/proto" 24 | istiov1alpha1 "istio.io/api/rbac/v1alpha1" 25 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 26 | ) 27 | 28 | // +genclient 29 | // +genclient:noStatus 30 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 31 | 32 | // RbacConfig is a Istio RbacConfig resource 33 | type RbacConfig struct { 34 | metav1.TypeMeta `json:",inline"` 35 | metav1.ObjectMeta `json:"metadata,omitempty"` 36 | 37 | Spec RbacConfigSpec `json:"spec"` 38 | } 39 | 40 | func (p *RbacConfig) GetSpecMessage() proto.Message { 41 | return &p.Spec.RbacConfig 42 | } 43 | 44 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 45 | 46 | // RbacConfigList is a list of RbacConfig resources 47 | type RbacConfigList struct { 48 | metav1.TypeMeta `json:",inline"` 49 | metav1.ListMeta `json:"metadata"` 50 | 51 | Items []RbacConfig `json:"items"` 52 | } 53 | 54 | // RbacConfigSpec in a wrapper around Istio RbacConfig 55 | type RbacConfigSpec struct { 56 | istiov1alpha1.RbacConfig 57 | } 58 | 59 | // Taken from https://github.com/michaelkipper/istio-client-go/commit/7c8e95b5d9220d47c107bb6f3b0b71fbc8af3ef7#diff-1c6fa6bfc320013a249f4b6d0ccdd928R65 60 | func (p *RbacConfigSpec) MarshalJSON() ([]byte, error) { 61 | buffer := bytes.Buffer{} 62 | writer := bufio.NewWriter(&buffer) 63 | marshaler := jsonpb.Marshaler{} 64 | err := marshaler.Marshal(writer, &p.RbacConfig) 65 | if err != nil { 66 | log.Printf("Could not marshal RbacConfig. Error: %v", err) 67 | return nil, err 68 | } 69 | 70 | writer.Flush() 71 | return buffer.Bytes(), nil 72 | } 73 | 74 | func (p *RbacConfigSpec) UnmarshalJSON(b []byte) error { 75 | reader := bytes.NewReader(b) 76 | unmarshaler := jsonpb.Unmarshaler{} 77 | err := unmarshaler.Unmarshal(reader, &p.RbacConfig) 78 | if err != nil { 79 | log.Printf("Could not unmarshal RbacConfig. Error: %v", err) 80 | return err 81 | } 82 | return nil 83 | } 84 | 85 | // DeepCopyInto is a deepcopy function, copying the receiver, writing into out. in must be non-nil. 86 | // Based of https://github.com/istio/istio/blob/release-0.8/pilot/pkg/config/kube/crd/types.go#L450 87 | func (in *RbacConfigSpec) DeepCopyInto(out *RbacConfigSpec) { 88 | *out = *in 89 | } 90 | -------------------------------------------------------------------------------- /pkg/apis/rbac/v1alpha1/service_role.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2017 The Kubernetes Authors. 3 | Portions Copyright 2018 Aspen Mesh Authors. 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | Unless required by applicable law or agreed to in writing, software 9 | distributed under the License is distributed on an "AS IS" BASIS, 10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | See the License for the specific language governing permissions and 12 | limitations under the License. 13 | */ 14 | 15 | package v1alpha1 16 | 17 | import ( 18 | "bufio" 19 | "bytes" 20 | "log" 21 | 22 | "github.com/gogo/protobuf/jsonpb" 23 | "github.com/golang/protobuf/proto" 24 | istiov1alpha1 "istio.io/api/rbac/v1alpha1" 25 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 26 | ) 27 | 28 | // +genclient 29 | // +genclient:noStatus 30 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 31 | 32 | // ServiceRole is a Istio ServiceRole resource 33 | type ServiceRole struct { 34 | metav1.TypeMeta `json:",inline"` 35 | metav1.ObjectMeta `json:"metadata,omitempty"` 36 | 37 | Spec ServiceRoleSpec `json:"spec"` 38 | } 39 | 40 | func (p *ServiceRole) GetSpecMessage() proto.Message { 41 | return &p.Spec.ServiceRole 42 | } 43 | 44 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 45 | 46 | // ServiceRoleList is a list of ServiceRole resources 47 | type ServiceRoleList struct { 48 | metav1.TypeMeta `json:",inline"` 49 | metav1.ListMeta `json:"metadata"` 50 | 51 | Items []ServiceRole `json:"items"` 52 | } 53 | 54 | // ServiceRoleSpec in a wrapper around Istio ServiceRole 55 | type ServiceRoleSpec struct { 56 | istiov1alpha1.ServiceRole 57 | } 58 | 59 | // Taken from https://github.com/michaelkipper/istio-client-go/commit/7c8e95b5d9220d47c107bb6f3b0b71fbc8af3ef7#diff-1c6fa6bfc320013a249f4b6d0ccdd928R65 60 | func (p *ServiceRoleSpec) MarshalJSON() ([]byte, error) { 61 | buffer := bytes.Buffer{} 62 | writer := bufio.NewWriter(&buffer) 63 | marshaler := jsonpb.Marshaler{} 64 | err := marshaler.Marshal(writer, &p.ServiceRole) 65 | if err != nil { 66 | log.Printf("Could not marshal ServiceRole. Error: %v", err) 67 | return nil, err 68 | } 69 | 70 | writer.Flush() 71 | return buffer.Bytes(), nil 72 | } 73 | 74 | func (p *ServiceRoleSpec) UnmarshalJSON(b []byte) error { 75 | reader := bytes.NewReader(b) 76 | unmarshaler := jsonpb.Unmarshaler{} 77 | err := unmarshaler.Unmarshal(reader, &p.ServiceRole) 78 | if err != nil { 79 | log.Printf("Could not unmarshal ServiceRole. Error: %v", err) 80 | return err 81 | } 82 | return nil 83 | } 84 | 85 | // DeepCopyInto is a deepcopy function, copying the receiver, writing into out. in must be non-nil. 86 | // Based of https://github.com/istio/istio/blob/release-0.8/pilot/pkg/config/kube/crd/types.go#L450 87 | func (in *ServiceRoleSpec) DeepCopyInto(out *ServiceRoleSpec) { 88 | *out = *in 89 | } 90 | -------------------------------------------------------------------------------- /pkg/apis/authentication/v1alpha1/meshpolicy.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2017 The Kubernetes Authors. 3 | Portions Copyright 2018 Aspen Mesh Authors. 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | Unless required by applicable law or agreed to in writing, software 9 | distributed under the License is distributed on an "AS IS" BASIS, 10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | See the License for the specific language governing permissions and 12 | limitations under the License. 13 | */ 14 | 15 | package v1alpha1 16 | 17 | import ( 18 | "bufio" 19 | "bytes" 20 | "github.com/gogo/protobuf/jsonpb" 21 | "github.com/golang/protobuf/proto" 22 | istiov1alpha1 "istio.io/api/authentication/v1alpha1" 23 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 24 | "log" 25 | ) 26 | 27 | // +genclient 28 | // +genclient:noStatus 29 | // +genclient:nonNamespaced 30 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 31 | 32 | // MeshPolicy is a Istio MeshPolicy resource 33 | type MeshPolicy struct { 34 | metav1.TypeMeta `json:",inline"` 35 | metav1.ObjectMeta `json:"metadata,omitempty"` 36 | 37 | Spec MeshPolicySpec `json:"spec"` 38 | } 39 | 40 | // GetSpecMessage gets the Policy in the MeshPolicy Spec 41 | func (p *MeshPolicy) GetSpecMessage() proto.Message { 42 | return &p.Spec.Policy 43 | } 44 | 45 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 46 | 47 | // MeshPolicyList is a list of MeshPolicy resources 48 | type MeshPolicyList struct { 49 | metav1.TypeMeta `json:",inline"` 50 | metav1.ListMeta `json:"metadata"` 51 | 52 | Items []MeshPolicy `json:"items"` 53 | } 54 | 55 | // MeshPolicySpec in a wrapper around Istio Policy 56 | type MeshPolicySpec struct { 57 | istiov1alpha1.Policy 58 | } 59 | 60 | // Taken from https://github.com/michaelkipper/istio-client-go/commit/7c8e95b5d9220d47c107bb6f3b0b71fbc8af3ef7#diff-1c6fa6bfc320013a249f4b6d0ccdd928R65 61 | func (p *MeshPolicySpec) MarshalJSON() ([]byte, error) { 62 | buffer := bytes.Buffer{} 63 | writer := bufio.NewWriter(&buffer) 64 | marshaler := jsonpb.Marshaler{} 65 | err := marshaler.Marshal(writer, &p.Policy) 66 | if err != nil { 67 | log.Printf("Could not marshal PolicySpec. Error: %v", err) 68 | return nil, err 69 | } 70 | 71 | writer.Flush() 72 | return buffer.Bytes(), nil 73 | } 74 | 75 | func (p *MeshPolicySpec) UnmarshalJSON(b []byte) error { 76 | reader := bytes.NewReader(b) 77 | unmarshaler := jsonpb.Unmarshaler{} 78 | err := unmarshaler.Unmarshal(reader, &p.Policy) 79 | if err != nil { 80 | log.Printf("Could not unmarshal PolicySpec. Error: %v", err) 81 | return err 82 | } 83 | return nil 84 | } 85 | 86 | // DeepCopyInto is a deepcopy function, copying the receiver, writing into out. in must be non-nil. 87 | // Based of https://github.com/istio/istio/blob/release-0.8/pilot/pkg/config/kube/crd/types.go#L450 88 | func (in *MeshPolicySpec) DeepCopyInto(out *MeshPolicySpec) { 89 | *out = *in 90 | } 91 | -------------------------------------------------------------------------------- /pkg/apis/networking/v1alpha3/virtual_service.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2017 The Kubernetes Authors. 3 | Portions Copyright 2018 Aspen Mesh Authors. 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | Unless required by applicable law or agreed to in writing, software 9 | distributed under the License is distributed on an "AS IS" BASIS, 10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | See the License for the specific language governing permissions and 12 | limitations under the License. 13 | */ 14 | 15 | package v1alpha3 16 | 17 | import ( 18 | "bufio" 19 | "bytes" 20 | "github.com/gogo/protobuf/jsonpb" 21 | "github.com/golang/protobuf/proto" 22 | istiov1alpha3 "istio.io/api/networking/v1alpha3" 23 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 24 | "log" 25 | ) 26 | 27 | // +genclient 28 | // +genclient:noStatus 29 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 30 | 31 | // VirtualService is a Istio VirtualService resource 32 | type VirtualService struct { 33 | metav1.TypeMeta `json:",inline"` 34 | metav1.ObjectMeta `json:"metadata,omitempty"` 35 | 36 | Spec VirtualServiceSpec `json:"spec"` 37 | } 38 | 39 | func (vs *VirtualService) GetSpecMessage() proto.Message { 40 | return &vs.Spec.VirtualService 41 | } 42 | 43 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 44 | 45 | // VirtualServiceList is a list of VirtualService resources 46 | type VirtualServiceList struct { 47 | metav1.TypeMeta `json:",inline"` 48 | metav1.ListMeta `json:"metadata"` 49 | 50 | Items []VirtualService `json:"items"` 51 | } 52 | 53 | // VirtualServiceSpec is a wrapper around Istio VirtualService 54 | type VirtualServiceSpec struct { 55 | istiov1alpha3.VirtualService 56 | } 57 | 58 | // Adapted from https://github.com/michaelkipper/istio-client-go/commit/7c8e95b5d9220d47c107bb6f3b0b71fbc8af3ef7#diff-1c6fa6bfc320013a249f4b6d0ccdd928R65 59 | func (p *VirtualServiceSpec) MarshalJSON() ([]byte, error) { 60 | buffer := bytes.Buffer{} 61 | writer := bufio.NewWriter(&buffer) 62 | marshaler := jsonpb.Marshaler{} 63 | err := marshaler.Marshal(writer, &p.VirtualService) 64 | if err != nil { 65 | log.Printf("Could not marshal PolicySpec. Error: %v", err) 66 | return nil, err 67 | } 68 | 69 | writer.Flush() 70 | return buffer.Bytes(), nil 71 | } 72 | 73 | func (p *VirtualServiceSpec) UnmarshalJSON(b []byte) error { 74 | reader := bytes.NewReader(b) 75 | unmarshaler := jsonpb.Unmarshaler{} 76 | err := unmarshaler.Unmarshal(reader, &p.VirtualService) 77 | if err != nil { 78 | log.Printf("Could not unmarshal PolicySpec. Error: %v", err) 79 | return err 80 | } 81 | return nil 82 | } 83 | 84 | // DeepCopyInto is a deepcopy function, copying the receiver, writing into out. in must be non-nil. 85 | // Based of https://github.com/istio/istio/blob/release-0.8/pilot/pkg/config/kube/crd/types.go#L450 86 | func (in *VirtualServiceSpec) DeepCopyInto(out *VirtualServiceSpec) { 87 | *out = *in 88 | } 89 | -------------------------------------------------------------------------------- /pkg/apis/networking/v1alpha3/destination_rule.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2017 The Kubernetes Authors. 3 | Portions Copyright 2018 Aspen Mesh Authors. 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | Unless required by applicable law or agreed to in writing, software 9 | distributed under the License is distributed on an "AS IS" BASIS, 10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | See the License for the specific language governing permissions and 12 | limitations under the License. 13 | */ 14 | 15 | package v1alpha3 16 | 17 | import ( 18 | "bufio" 19 | "bytes" 20 | "github.com/gogo/protobuf/jsonpb" 21 | "github.com/golang/protobuf/proto" 22 | istiov1alpha3 "istio.io/api/networking/v1alpha3" 23 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 24 | "log" 25 | ) 26 | 27 | // +genclient 28 | // +genclient:noStatus 29 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 30 | 31 | // DestinationRule is a Istio DestinationRule resource 32 | type DestinationRule struct { 33 | metav1.TypeMeta `json:",inline"` 34 | metav1.ObjectMeta `json:"metadata,omitempty"` 35 | 36 | Spec DestinationRuleSpec `json:"spec"` 37 | } 38 | 39 | func (dr *DestinationRule) GetSpecMessage() proto.Message { 40 | return &dr.Spec.DestinationRule 41 | } 42 | 43 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 44 | 45 | // DestinationRuleList is a list of DestinationRule resources 46 | type DestinationRuleList struct { 47 | metav1.TypeMeta `json:",inline"` 48 | metav1.ListMeta `json:"metadata"` 49 | 50 | Items []DestinationRule `json:"items"` 51 | } 52 | 53 | // DestinationRuleSpec is a wrapper around Istio DestinationRule 54 | type DestinationRuleSpec struct { 55 | istiov1alpha3.DestinationRule 56 | } 57 | 58 | // Adapted from https://github.com/michaelkipper/istio-client-go/commit/7c8e95b5d9220d47c107bb6f3b0b71fbc8af3ef7#diff-1c6fa6bfc320013a249f4b6d0ccdd928R65 59 | func (p *DestinationRuleSpec) MarshalJSON() ([]byte, error) { 60 | buffer := bytes.Buffer{} 61 | writer := bufio.NewWriter(&buffer) 62 | marshaler := jsonpb.Marshaler{} 63 | err := marshaler.Marshal(writer, &p.DestinationRule) 64 | if err != nil { 65 | log.Printf("Could not marshal PolicySpec. Error: %v", err) 66 | return nil, err 67 | } 68 | 69 | writer.Flush() 70 | return buffer.Bytes(), nil 71 | } 72 | 73 | func (p *DestinationRuleSpec) UnmarshalJSON(b []byte) error { 74 | reader := bytes.NewReader(b) 75 | unmarshaler := jsonpb.Unmarshaler{} 76 | err := unmarshaler.Unmarshal(reader, &p.DestinationRule) 77 | if err != nil { 78 | log.Printf("Could not unmarshal PolicySpec. Error: %v", err) 79 | return err 80 | } 81 | return nil 82 | } 83 | 84 | 85 | // DeepCopyInto is a deepcopy function, copying the receiver, writing into out. in must be non-nil. 86 | // Based of https://github.com/istio/istio/blob/release-0.8/pilot/pkg/config/kube/crd/types.go#L450 87 | func (in *DestinationRuleSpec) DeepCopyInto(out *DestinationRuleSpec) { 88 | *out = *in 89 | } 90 | -------------------------------------------------------------------------------- /pkg/apis/rbac/v1alpha1/service_role_binding.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2017 The Kubernetes Authors. 3 | Portions Copyright 2018 Aspen Mesh Authors. 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | Unless required by applicable law or agreed to in writing, software 9 | distributed under the License is distributed on an "AS IS" BASIS, 10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | See the License for the specific language governing permissions and 12 | limitations under the License. 13 | */ 14 | 15 | package v1alpha1 16 | 17 | import ( 18 | "bufio" 19 | "bytes" 20 | "log" 21 | 22 | "github.com/gogo/protobuf/jsonpb" 23 | "github.com/golang/protobuf/proto" 24 | istiov1alpha1 "istio.io/api/rbac/v1alpha1" 25 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 26 | ) 27 | 28 | // +genclient 29 | // +genclient:noStatus 30 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 31 | 32 | // ServiceRoleBinding is a Istio ServiceRoleBinding resource 33 | type ServiceRoleBinding struct { 34 | metav1.TypeMeta `json:",inline"` 35 | metav1.ObjectMeta `json:"metadata,omitempty"` 36 | 37 | Spec ServiceRoleBindingSpec `json:"spec"` 38 | } 39 | 40 | func (p *ServiceRoleBinding) GetSpecMessage() proto.Message { 41 | return &p.Spec.ServiceRoleBinding 42 | } 43 | 44 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 45 | 46 | // ServiceRoleBindingList is a list of ServiceRoleBinding resources 47 | type ServiceRoleBindingList struct { 48 | metav1.TypeMeta `json:",inline"` 49 | metav1.ListMeta `json:"metadata"` 50 | 51 | Items []ServiceRoleBinding `json:"items"` 52 | } 53 | 54 | // ServiceRoleBindingSpec in a wrapper around Istio ServiceRoleBinding 55 | type ServiceRoleBindingSpec struct { 56 | istiov1alpha1.ServiceRoleBinding 57 | } 58 | 59 | // Taken from https://github.com/michaelkipper/istio-client-go/commit/7c8e95b5d9220d47c107bb6f3b0b71fbc8af3ef7#diff-1c6fa6bfc320013a249f4b6d0ccdd928R65 60 | func (p *ServiceRoleBindingSpec) MarshalJSON() ([]byte, error) { 61 | buffer := bytes.Buffer{} 62 | writer := bufio.NewWriter(&buffer) 63 | marshaler := jsonpb.Marshaler{} 64 | err := marshaler.Marshal(writer, &p.ServiceRoleBinding) 65 | if err != nil { 66 | log.Printf("Could not marshal ServiceRoleBinding. Error: %v", err) 67 | return nil, err 68 | } 69 | 70 | writer.Flush() 71 | return buffer.Bytes(), nil 72 | } 73 | 74 | func (p *ServiceRoleBindingSpec) UnmarshalJSON(b []byte) error { 75 | reader := bytes.NewReader(b) 76 | unmarshaler := jsonpb.Unmarshaler{} 77 | err := unmarshaler.Unmarshal(reader, &p.ServiceRoleBinding) 78 | if err != nil { 79 | log.Printf("Could not unmarshal ServiceRoleBinding. Error: %v", err) 80 | return err 81 | } 82 | return nil 83 | } 84 | 85 | // DeepCopyInto is a deepcopy function, copying the receiver, writing into out. in must be non-nil. 86 | // Based of https://github.com/istio/istio/blob/release-0.8/pilot/pkg/config/kube/crd/types.go#L450 87 | func (in *ServiceRoleBindingSpec) DeepCopyInto(out *ServiceRoleBindingSpec) { 88 | *out = *in 89 | } 90 | -------------------------------------------------------------------------------- /pkg/client/informers/externalversions/networking/v1alpha3/interface.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by informer-gen. DO NOT EDIT. 19 | 20 | package v1alpha3 21 | 22 | import ( 23 | internalinterfaces "github.com/aspenmesh/istio-client-go/pkg/client/informers/externalversions/internalinterfaces" 24 | ) 25 | 26 | // Interface provides access to all the informers in this group version. 27 | type Interface interface { 28 | // DestinationRules returns a DestinationRuleInformer. 29 | DestinationRules() DestinationRuleInformer 30 | // EnvoyFilters returns a EnvoyFilterInformer. 31 | EnvoyFilters() EnvoyFilterInformer 32 | // Gateways returns a GatewayInformer. 33 | Gateways() GatewayInformer 34 | // ServiceEntries returns a ServiceEntryInformer. 35 | ServiceEntries() ServiceEntryInformer 36 | // VirtualServices returns a VirtualServiceInformer. 37 | VirtualServices() VirtualServiceInformer 38 | } 39 | 40 | type version struct { 41 | factory internalinterfaces.SharedInformerFactory 42 | namespace string 43 | tweakListOptions internalinterfaces.TweakListOptionsFunc 44 | } 45 | 46 | // New returns a new Interface. 47 | func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { 48 | return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} 49 | } 50 | 51 | // DestinationRules returns a DestinationRuleInformer. 52 | func (v *version) DestinationRules() DestinationRuleInformer { 53 | return &destinationRuleInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} 54 | } 55 | 56 | // EnvoyFilters returns a EnvoyFilterInformer. 57 | func (v *version) EnvoyFilters() EnvoyFilterInformer { 58 | return &envoyFilterInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} 59 | } 60 | 61 | // Gateways returns a GatewayInformer. 62 | func (v *version) Gateways() GatewayInformer { 63 | return &gatewayInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} 64 | } 65 | 66 | // ServiceEntries returns a ServiceEntryInformer. 67 | func (v *version) ServiceEntries() ServiceEntryInformer { 68 | return &serviceEntryInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} 69 | } 70 | 71 | // VirtualServices returns a VirtualServiceInformer. 72 | func (v *version) VirtualServices() VirtualServiceInformer { 73 | return &virtualServiceInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} 74 | } 75 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/authentication/v1alpha1/authentication_client.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by client-gen. DO NOT EDIT. 19 | 20 | package v1alpha1 21 | 22 | import ( 23 | v1alpha1 "github.com/aspenmesh/istio-client-go/pkg/apis/authentication/v1alpha1" 24 | "github.com/aspenmesh/istio-client-go/pkg/client/clientset/versioned/scheme" 25 | rest "k8s.io/client-go/rest" 26 | ) 27 | 28 | type AuthenticationV1alpha1Interface interface { 29 | RESTClient() rest.Interface 30 | MeshPoliciesGetter 31 | PoliciesGetter 32 | } 33 | 34 | // AuthenticationV1alpha1Client is used to interact with features provided by the authentication.istio.io group. 35 | type AuthenticationV1alpha1Client struct { 36 | restClient rest.Interface 37 | } 38 | 39 | func (c *AuthenticationV1alpha1Client) MeshPolicies() MeshPolicyInterface { 40 | return newMeshPolicies(c) 41 | } 42 | 43 | func (c *AuthenticationV1alpha1Client) Policies(namespace string) PolicyInterface { 44 | return newPolicies(c, namespace) 45 | } 46 | 47 | // NewForConfig creates a new AuthenticationV1alpha1Client for the given config. 48 | func NewForConfig(c *rest.Config) (*AuthenticationV1alpha1Client, error) { 49 | config := *c 50 | if err := setConfigDefaults(&config); err != nil { 51 | return nil, err 52 | } 53 | client, err := rest.RESTClientFor(&config) 54 | if err != nil { 55 | return nil, err 56 | } 57 | return &AuthenticationV1alpha1Client{client}, nil 58 | } 59 | 60 | // NewForConfigOrDie creates a new AuthenticationV1alpha1Client for the given config and 61 | // panics if there is an error in the config. 62 | func NewForConfigOrDie(c *rest.Config) *AuthenticationV1alpha1Client { 63 | client, err := NewForConfig(c) 64 | if err != nil { 65 | panic(err) 66 | } 67 | return client 68 | } 69 | 70 | // New creates a new AuthenticationV1alpha1Client for the given RESTClient. 71 | func New(c rest.Interface) *AuthenticationV1alpha1Client { 72 | return &AuthenticationV1alpha1Client{c} 73 | } 74 | 75 | func setConfigDefaults(config *rest.Config) error { 76 | gv := v1alpha1.SchemeGroupVersion 77 | config.GroupVersion = &gv 78 | config.APIPath = "/apis" 79 | config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() 80 | 81 | if config.UserAgent == "" { 82 | config.UserAgent = rest.DefaultKubernetesUserAgent() 83 | } 84 | 85 | return nil 86 | } 87 | 88 | // RESTClient returns a RESTClient that is used to communicate 89 | // with API server by this client implementation. 90 | func (c *AuthenticationV1alpha1Client) RESTClient() rest.Interface { 91 | if c == nil { 92 | return nil 93 | } 94 | return c.restClient 95 | } 96 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/rbac/v1alpha1/rbac_client.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by client-gen. DO NOT EDIT. 19 | 20 | package v1alpha1 21 | 22 | import ( 23 | v1alpha1 "github.com/aspenmesh/istio-client-go/pkg/apis/rbac/v1alpha1" 24 | "github.com/aspenmesh/istio-client-go/pkg/client/clientset/versioned/scheme" 25 | rest "k8s.io/client-go/rest" 26 | ) 27 | 28 | type RbacV1alpha1Interface interface { 29 | RESTClient() rest.Interface 30 | RbacConfigsGetter 31 | ServiceRolesGetter 32 | ServiceRoleBindingsGetter 33 | } 34 | 35 | // RbacV1alpha1Client is used to interact with features provided by the rbac.istio.io group. 36 | type RbacV1alpha1Client struct { 37 | restClient rest.Interface 38 | } 39 | 40 | func (c *RbacV1alpha1Client) RbacConfigs(namespace string) RbacConfigInterface { 41 | return newRbacConfigs(c, namespace) 42 | } 43 | 44 | func (c *RbacV1alpha1Client) ServiceRoles(namespace string) ServiceRoleInterface { 45 | return newServiceRoles(c, namespace) 46 | } 47 | 48 | func (c *RbacV1alpha1Client) ServiceRoleBindings(namespace string) ServiceRoleBindingInterface { 49 | return newServiceRoleBindings(c, namespace) 50 | } 51 | 52 | // NewForConfig creates a new RbacV1alpha1Client for the given config. 53 | func NewForConfig(c *rest.Config) (*RbacV1alpha1Client, error) { 54 | config := *c 55 | if err := setConfigDefaults(&config); err != nil { 56 | return nil, err 57 | } 58 | client, err := rest.RESTClientFor(&config) 59 | if err != nil { 60 | return nil, err 61 | } 62 | return &RbacV1alpha1Client{client}, nil 63 | } 64 | 65 | // NewForConfigOrDie creates a new RbacV1alpha1Client for the given config and 66 | // panics if there is an error in the config. 67 | func NewForConfigOrDie(c *rest.Config) *RbacV1alpha1Client { 68 | client, err := NewForConfig(c) 69 | if err != nil { 70 | panic(err) 71 | } 72 | return client 73 | } 74 | 75 | // New creates a new RbacV1alpha1Client for the given RESTClient. 76 | func New(c rest.Interface) *RbacV1alpha1Client { 77 | return &RbacV1alpha1Client{c} 78 | } 79 | 80 | func setConfigDefaults(config *rest.Config) error { 81 | gv := v1alpha1.SchemeGroupVersion 82 | config.GroupVersion = &gv 83 | config.APIPath = "/apis" 84 | config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() 85 | 86 | if config.UserAgent == "" { 87 | config.UserAgent = rest.DefaultKubernetesUserAgent() 88 | } 89 | 90 | return nil 91 | } 92 | 93 | // RESTClient returns a RESTClient that is used to communicate 94 | // with API server by this client implementation. 95 | func (c *RbacV1alpha1Client) RESTClient() rest.Interface { 96 | if c == nil { 97 | return nil 98 | } 99 | return c.restClient 100 | } 101 | -------------------------------------------------------------------------------- /pkg/client/listers/authentication/v1alpha1/policy.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by lister-gen. DO NOT EDIT. 19 | 20 | package v1alpha1 21 | 22 | import ( 23 | v1alpha1 "github.com/aspenmesh/istio-client-go/pkg/apis/authentication/v1alpha1" 24 | "k8s.io/apimachinery/pkg/api/errors" 25 | "k8s.io/apimachinery/pkg/labels" 26 | "k8s.io/client-go/tools/cache" 27 | ) 28 | 29 | // PolicyLister helps list Policies. 30 | type PolicyLister interface { 31 | // List lists all Policies in the indexer. 32 | List(selector labels.Selector) (ret []*v1alpha1.Policy, err error) 33 | // Policies returns an object that can list and get Policies. 34 | Policies(namespace string) PolicyNamespaceLister 35 | PolicyListerExpansion 36 | } 37 | 38 | // policyLister implements the PolicyLister interface. 39 | type policyLister struct { 40 | indexer cache.Indexer 41 | } 42 | 43 | // NewPolicyLister returns a new PolicyLister. 44 | func NewPolicyLister(indexer cache.Indexer) PolicyLister { 45 | return &policyLister{indexer: indexer} 46 | } 47 | 48 | // List lists all Policies in the indexer. 49 | func (s *policyLister) List(selector labels.Selector) (ret []*v1alpha1.Policy, err error) { 50 | err = cache.ListAll(s.indexer, selector, func(m interface{}) { 51 | ret = append(ret, m.(*v1alpha1.Policy)) 52 | }) 53 | return ret, err 54 | } 55 | 56 | // Policies returns an object that can list and get Policies. 57 | func (s *policyLister) Policies(namespace string) PolicyNamespaceLister { 58 | return policyNamespaceLister{indexer: s.indexer, namespace: namespace} 59 | } 60 | 61 | // PolicyNamespaceLister helps list and get Policies. 62 | type PolicyNamespaceLister interface { 63 | // List lists all Policies in the indexer for a given namespace. 64 | List(selector labels.Selector) (ret []*v1alpha1.Policy, err error) 65 | // Get retrieves the Policy from the indexer for a given namespace and name. 66 | Get(name string) (*v1alpha1.Policy, error) 67 | PolicyNamespaceListerExpansion 68 | } 69 | 70 | // policyNamespaceLister implements the PolicyNamespaceLister 71 | // interface. 72 | type policyNamespaceLister struct { 73 | indexer cache.Indexer 74 | namespace string 75 | } 76 | 77 | // List lists all Policies in the indexer for a given namespace. 78 | func (s policyNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.Policy, err error) { 79 | err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { 80 | ret = append(ret, m.(*v1alpha1.Policy)) 81 | }) 82 | return ret, err 83 | } 84 | 85 | // Get retrieves the Policy from the indexer for a given namespace and name. 86 | func (s policyNamespaceLister) Get(name string) (*v1alpha1.Policy, error) { 87 | obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) 88 | if err != nil { 89 | return nil, err 90 | } 91 | if !exists { 92 | return nil, errors.NewNotFound(v1alpha1.Resource("policy"), name) 93 | } 94 | return obj.(*v1alpha1.Policy), nil 95 | } 96 | -------------------------------------------------------------------------------- /pkg/client/listers/networking/v1alpha3/gateway.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by lister-gen. DO NOT EDIT. 19 | 20 | package v1alpha3 21 | 22 | import ( 23 | v1alpha3 "github.com/aspenmesh/istio-client-go/pkg/apis/networking/v1alpha3" 24 | "k8s.io/apimachinery/pkg/api/errors" 25 | "k8s.io/apimachinery/pkg/labels" 26 | "k8s.io/client-go/tools/cache" 27 | ) 28 | 29 | // GatewayLister helps list Gateways. 30 | type GatewayLister interface { 31 | // List lists all Gateways in the indexer. 32 | List(selector labels.Selector) (ret []*v1alpha3.Gateway, err error) 33 | // Gateways returns an object that can list and get Gateways. 34 | Gateways(namespace string) GatewayNamespaceLister 35 | GatewayListerExpansion 36 | } 37 | 38 | // gatewayLister implements the GatewayLister interface. 39 | type gatewayLister struct { 40 | indexer cache.Indexer 41 | } 42 | 43 | // NewGatewayLister returns a new GatewayLister. 44 | func NewGatewayLister(indexer cache.Indexer) GatewayLister { 45 | return &gatewayLister{indexer: indexer} 46 | } 47 | 48 | // List lists all Gateways in the indexer. 49 | func (s *gatewayLister) List(selector labels.Selector) (ret []*v1alpha3.Gateway, err error) { 50 | err = cache.ListAll(s.indexer, selector, func(m interface{}) { 51 | ret = append(ret, m.(*v1alpha3.Gateway)) 52 | }) 53 | return ret, err 54 | } 55 | 56 | // Gateways returns an object that can list and get Gateways. 57 | func (s *gatewayLister) Gateways(namespace string) GatewayNamespaceLister { 58 | return gatewayNamespaceLister{indexer: s.indexer, namespace: namespace} 59 | } 60 | 61 | // GatewayNamespaceLister helps list and get Gateways. 62 | type GatewayNamespaceLister interface { 63 | // List lists all Gateways in the indexer for a given namespace. 64 | List(selector labels.Selector) (ret []*v1alpha3.Gateway, err error) 65 | // Get retrieves the Gateway from the indexer for a given namespace and name. 66 | Get(name string) (*v1alpha3.Gateway, error) 67 | GatewayNamespaceListerExpansion 68 | } 69 | 70 | // gatewayNamespaceLister implements the GatewayNamespaceLister 71 | // interface. 72 | type gatewayNamespaceLister struct { 73 | indexer cache.Indexer 74 | namespace string 75 | } 76 | 77 | // List lists all Gateways in the indexer for a given namespace. 78 | func (s gatewayNamespaceLister) List(selector labels.Selector) (ret []*v1alpha3.Gateway, err error) { 79 | err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { 80 | ret = append(ret, m.(*v1alpha3.Gateway)) 81 | }) 82 | return ret, err 83 | } 84 | 85 | // Get retrieves the Gateway from the indexer for a given namespace and name. 86 | func (s gatewayNamespaceLister) Get(name string) (*v1alpha3.Gateway, error) { 87 | obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) 88 | if err != nil { 89 | return nil, err 90 | } 91 | if !exists { 92 | return nil, errors.NewNotFound(v1alpha3.Resource("gateway"), name) 93 | } 94 | return obj.(*v1alpha3.Gateway), nil 95 | } 96 | -------------------------------------------------------------------------------- /pkg/client/listers/rbac/v1alpha1/rbacconfig.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by lister-gen. DO NOT EDIT. 19 | 20 | package v1alpha1 21 | 22 | import ( 23 | v1alpha1 "github.com/aspenmesh/istio-client-go/pkg/apis/rbac/v1alpha1" 24 | "k8s.io/apimachinery/pkg/api/errors" 25 | "k8s.io/apimachinery/pkg/labels" 26 | "k8s.io/client-go/tools/cache" 27 | ) 28 | 29 | // RbacConfigLister helps list RbacConfigs. 30 | type RbacConfigLister interface { 31 | // List lists all RbacConfigs in the indexer. 32 | List(selector labels.Selector) (ret []*v1alpha1.RbacConfig, err error) 33 | // RbacConfigs returns an object that can list and get RbacConfigs. 34 | RbacConfigs(namespace string) RbacConfigNamespaceLister 35 | RbacConfigListerExpansion 36 | } 37 | 38 | // rbacConfigLister implements the RbacConfigLister interface. 39 | type rbacConfigLister struct { 40 | indexer cache.Indexer 41 | } 42 | 43 | // NewRbacConfigLister returns a new RbacConfigLister. 44 | func NewRbacConfigLister(indexer cache.Indexer) RbacConfigLister { 45 | return &rbacConfigLister{indexer: indexer} 46 | } 47 | 48 | // List lists all RbacConfigs in the indexer. 49 | func (s *rbacConfigLister) List(selector labels.Selector) (ret []*v1alpha1.RbacConfig, err error) { 50 | err = cache.ListAll(s.indexer, selector, func(m interface{}) { 51 | ret = append(ret, m.(*v1alpha1.RbacConfig)) 52 | }) 53 | return ret, err 54 | } 55 | 56 | // RbacConfigs returns an object that can list and get RbacConfigs. 57 | func (s *rbacConfigLister) RbacConfigs(namespace string) RbacConfigNamespaceLister { 58 | return rbacConfigNamespaceLister{indexer: s.indexer, namespace: namespace} 59 | } 60 | 61 | // RbacConfigNamespaceLister helps list and get RbacConfigs. 62 | type RbacConfigNamespaceLister interface { 63 | // List lists all RbacConfigs in the indexer for a given namespace. 64 | List(selector labels.Selector) (ret []*v1alpha1.RbacConfig, err error) 65 | // Get retrieves the RbacConfig from the indexer for a given namespace and name. 66 | Get(name string) (*v1alpha1.RbacConfig, error) 67 | RbacConfigNamespaceListerExpansion 68 | } 69 | 70 | // rbacConfigNamespaceLister implements the RbacConfigNamespaceLister 71 | // interface. 72 | type rbacConfigNamespaceLister struct { 73 | indexer cache.Indexer 74 | namespace string 75 | } 76 | 77 | // List lists all RbacConfigs in the indexer for a given namespace. 78 | func (s rbacConfigNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.RbacConfig, err error) { 79 | err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { 80 | ret = append(ret, m.(*v1alpha1.RbacConfig)) 81 | }) 82 | return ret, err 83 | } 84 | 85 | // Get retrieves the RbacConfig from the indexer for a given namespace and name. 86 | func (s rbacConfigNamespaceLister) Get(name string) (*v1alpha1.RbacConfig, error) { 87 | obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) 88 | if err != nil { 89 | return nil, err 90 | } 91 | if !exists { 92 | return nil, errors.NewNotFound(v1alpha1.Resource("rbacconfig"), name) 93 | } 94 | return obj.(*v1alpha1.RbacConfig), nil 95 | } 96 | -------------------------------------------------------------------------------- /pkg/client/listers/rbac/v1alpha1/servicerole.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by lister-gen. DO NOT EDIT. 19 | 20 | package v1alpha1 21 | 22 | import ( 23 | v1alpha1 "github.com/aspenmesh/istio-client-go/pkg/apis/rbac/v1alpha1" 24 | "k8s.io/apimachinery/pkg/api/errors" 25 | "k8s.io/apimachinery/pkg/labels" 26 | "k8s.io/client-go/tools/cache" 27 | ) 28 | 29 | // ServiceRoleLister helps list ServiceRoles. 30 | type ServiceRoleLister interface { 31 | // List lists all ServiceRoles in the indexer. 32 | List(selector labels.Selector) (ret []*v1alpha1.ServiceRole, err error) 33 | // ServiceRoles returns an object that can list and get ServiceRoles. 34 | ServiceRoles(namespace string) ServiceRoleNamespaceLister 35 | ServiceRoleListerExpansion 36 | } 37 | 38 | // serviceRoleLister implements the ServiceRoleLister interface. 39 | type serviceRoleLister struct { 40 | indexer cache.Indexer 41 | } 42 | 43 | // NewServiceRoleLister returns a new ServiceRoleLister. 44 | func NewServiceRoleLister(indexer cache.Indexer) ServiceRoleLister { 45 | return &serviceRoleLister{indexer: indexer} 46 | } 47 | 48 | // List lists all ServiceRoles in the indexer. 49 | func (s *serviceRoleLister) List(selector labels.Selector) (ret []*v1alpha1.ServiceRole, err error) { 50 | err = cache.ListAll(s.indexer, selector, func(m interface{}) { 51 | ret = append(ret, m.(*v1alpha1.ServiceRole)) 52 | }) 53 | return ret, err 54 | } 55 | 56 | // ServiceRoles returns an object that can list and get ServiceRoles. 57 | func (s *serviceRoleLister) ServiceRoles(namespace string) ServiceRoleNamespaceLister { 58 | return serviceRoleNamespaceLister{indexer: s.indexer, namespace: namespace} 59 | } 60 | 61 | // ServiceRoleNamespaceLister helps list and get ServiceRoles. 62 | type ServiceRoleNamespaceLister interface { 63 | // List lists all ServiceRoles in the indexer for a given namespace. 64 | List(selector labels.Selector) (ret []*v1alpha1.ServiceRole, err error) 65 | // Get retrieves the ServiceRole from the indexer for a given namespace and name. 66 | Get(name string) (*v1alpha1.ServiceRole, error) 67 | ServiceRoleNamespaceListerExpansion 68 | } 69 | 70 | // serviceRoleNamespaceLister implements the ServiceRoleNamespaceLister 71 | // interface. 72 | type serviceRoleNamespaceLister struct { 73 | indexer cache.Indexer 74 | namespace string 75 | } 76 | 77 | // List lists all ServiceRoles in the indexer for a given namespace. 78 | func (s serviceRoleNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.ServiceRole, err error) { 79 | err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { 80 | ret = append(ret, m.(*v1alpha1.ServiceRole)) 81 | }) 82 | return ret, err 83 | } 84 | 85 | // Get retrieves the ServiceRole from the indexer for a given namespace and name. 86 | func (s serviceRoleNamespaceLister) Get(name string) (*v1alpha1.ServiceRole, error) { 87 | obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) 88 | if err != nil { 89 | return nil, err 90 | } 91 | if !exists { 92 | return nil, errors.NewNotFound(v1alpha1.Resource("servicerole"), name) 93 | } 94 | return obj.(*v1alpha1.ServiceRole), nil 95 | } 96 | -------------------------------------------------------------------------------- /pkg/client/listers/networking/v1alpha3/envoyfilter.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by lister-gen. DO NOT EDIT. 19 | 20 | package v1alpha3 21 | 22 | import ( 23 | v1alpha3 "github.com/aspenmesh/istio-client-go/pkg/apis/networking/v1alpha3" 24 | "k8s.io/apimachinery/pkg/api/errors" 25 | "k8s.io/apimachinery/pkg/labels" 26 | "k8s.io/client-go/tools/cache" 27 | ) 28 | 29 | // EnvoyFilterLister helps list EnvoyFilters. 30 | type EnvoyFilterLister interface { 31 | // List lists all EnvoyFilters in the indexer. 32 | List(selector labels.Selector) (ret []*v1alpha3.EnvoyFilter, err error) 33 | // EnvoyFilters returns an object that can list and get EnvoyFilters. 34 | EnvoyFilters(namespace string) EnvoyFilterNamespaceLister 35 | EnvoyFilterListerExpansion 36 | } 37 | 38 | // envoyFilterLister implements the EnvoyFilterLister interface. 39 | type envoyFilterLister struct { 40 | indexer cache.Indexer 41 | } 42 | 43 | // NewEnvoyFilterLister returns a new EnvoyFilterLister. 44 | func NewEnvoyFilterLister(indexer cache.Indexer) EnvoyFilterLister { 45 | return &envoyFilterLister{indexer: indexer} 46 | } 47 | 48 | // List lists all EnvoyFilters in the indexer. 49 | func (s *envoyFilterLister) List(selector labels.Selector) (ret []*v1alpha3.EnvoyFilter, err error) { 50 | err = cache.ListAll(s.indexer, selector, func(m interface{}) { 51 | ret = append(ret, m.(*v1alpha3.EnvoyFilter)) 52 | }) 53 | return ret, err 54 | } 55 | 56 | // EnvoyFilters returns an object that can list and get EnvoyFilters. 57 | func (s *envoyFilterLister) EnvoyFilters(namespace string) EnvoyFilterNamespaceLister { 58 | return envoyFilterNamespaceLister{indexer: s.indexer, namespace: namespace} 59 | } 60 | 61 | // EnvoyFilterNamespaceLister helps list and get EnvoyFilters. 62 | type EnvoyFilterNamespaceLister interface { 63 | // List lists all EnvoyFilters in the indexer for a given namespace. 64 | List(selector labels.Selector) (ret []*v1alpha3.EnvoyFilter, err error) 65 | // Get retrieves the EnvoyFilter from the indexer for a given namespace and name. 66 | Get(name string) (*v1alpha3.EnvoyFilter, error) 67 | EnvoyFilterNamespaceListerExpansion 68 | } 69 | 70 | // envoyFilterNamespaceLister implements the EnvoyFilterNamespaceLister 71 | // interface. 72 | type envoyFilterNamespaceLister struct { 73 | indexer cache.Indexer 74 | namespace string 75 | } 76 | 77 | // List lists all EnvoyFilters in the indexer for a given namespace. 78 | func (s envoyFilterNamespaceLister) List(selector labels.Selector) (ret []*v1alpha3.EnvoyFilter, err error) { 79 | err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { 80 | ret = append(ret, m.(*v1alpha3.EnvoyFilter)) 81 | }) 82 | return ret, err 83 | } 84 | 85 | // Get retrieves the EnvoyFilter from the indexer for a given namespace and name. 86 | func (s envoyFilterNamespaceLister) Get(name string) (*v1alpha3.EnvoyFilter, error) { 87 | obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) 88 | if err != nil { 89 | return nil, err 90 | } 91 | if !exists { 92 | return nil, errors.NewNotFound(v1alpha3.Resource("envoyfilter"), name) 93 | } 94 | return obj.(*v1alpha3.EnvoyFilter), nil 95 | } 96 | -------------------------------------------------------------------------------- /pkg/client/listers/networking/v1alpha3/serviceentry.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by lister-gen. DO NOT EDIT. 19 | 20 | package v1alpha3 21 | 22 | import ( 23 | v1alpha3 "github.com/aspenmesh/istio-client-go/pkg/apis/networking/v1alpha3" 24 | "k8s.io/apimachinery/pkg/api/errors" 25 | "k8s.io/apimachinery/pkg/labels" 26 | "k8s.io/client-go/tools/cache" 27 | ) 28 | 29 | // ServiceEntryLister helps list ServiceEntries. 30 | type ServiceEntryLister interface { 31 | // List lists all ServiceEntries in the indexer. 32 | List(selector labels.Selector) (ret []*v1alpha3.ServiceEntry, err error) 33 | // ServiceEntries returns an object that can list and get ServiceEntries. 34 | ServiceEntries(namespace string) ServiceEntryNamespaceLister 35 | ServiceEntryListerExpansion 36 | } 37 | 38 | // serviceEntryLister implements the ServiceEntryLister interface. 39 | type serviceEntryLister struct { 40 | indexer cache.Indexer 41 | } 42 | 43 | // NewServiceEntryLister returns a new ServiceEntryLister. 44 | func NewServiceEntryLister(indexer cache.Indexer) ServiceEntryLister { 45 | return &serviceEntryLister{indexer: indexer} 46 | } 47 | 48 | // List lists all ServiceEntries in the indexer. 49 | func (s *serviceEntryLister) List(selector labels.Selector) (ret []*v1alpha3.ServiceEntry, err error) { 50 | err = cache.ListAll(s.indexer, selector, func(m interface{}) { 51 | ret = append(ret, m.(*v1alpha3.ServiceEntry)) 52 | }) 53 | return ret, err 54 | } 55 | 56 | // ServiceEntries returns an object that can list and get ServiceEntries. 57 | func (s *serviceEntryLister) ServiceEntries(namespace string) ServiceEntryNamespaceLister { 58 | return serviceEntryNamespaceLister{indexer: s.indexer, namespace: namespace} 59 | } 60 | 61 | // ServiceEntryNamespaceLister helps list and get ServiceEntries. 62 | type ServiceEntryNamespaceLister interface { 63 | // List lists all ServiceEntries in the indexer for a given namespace. 64 | List(selector labels.Selector) (ret []*v1alpha3.ServiceEntry, err error) 65 | // Get retrieves the ServiceEntry from the indexer for a given namespace and name. 66 | Get(name string) (*v1alpha3.ServiceEntry, error) 67 | ServiceEntryNamespaceListerExpansion 68 | } 69 | 70 | // serviceEntryNamespaceLister implements the ServiceEntryNamespaceLister 71 | // interface. 72 | type serviceEntryNamespaceLister struct { 73 | indexer cache.Indexer 74 | namespace string 75 | } 76 | 77 | // List lists all ServiceEntries in the indexer for a given namespace. 78 | func (s serviceEntryNamespaceLister) List(selector labels.Selector) (ret []*v1alpha3.ServiceEntry, err error) { 79 | err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { 80 | ret = append(ret, m.(*v1alpha3.ServiceEntry)) 81 | }) 82 | return ret, err 83 | } 84 | 85 | // Get retrieves the ServiceEntry from the indexer for a given namespace and name. 86 | func (s serviceEntryNamespaceLister) Get(name string) (*v1alpha3.ServiceEntry, error) { 87 | obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) 88 | if err != nil { 89 | return nil, err 90 | } 91 | if !exists { 92 | return nil, errors.NewNotFound(v1alpha3.Resource("serviceentry"), name) 93 | } 94 | return obj.(*v1alpha3.ServiceEntry), nil 95 | } 96 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/networking/v1alpha3/networking_client.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by client-gen. DO NOT EDIT. 19 | 20 | package v1alpha3 21 | 22 | import ( 23 | v1alpha3 "github.com/aspenmesh/istio-client-go/pkg/apis/networking/v1alpha3" 24 | "github.com/aspenmesh/istio-client-go/pkg/client/clientset/versioned/scheme" 25 | rest "k8s.io/client-go/rest" 26 | ) 27 | 28 | type NetworkingV1alpha3Interface interface { 29 | RESTClient() rest.Interface 30 | DestinationRulesGetter 31 | EnvoyFiltersGetter 32 | GatewaysGetter 33 | ServiceEntriesGetter 34 | VirtualServicesGetter 35 | } 36 | 37 | // NetworkingV1alpha3Client is used to interact with features provided by the networking.istio.io group. 38 | type NetworkingV1alpha3Client struct { 39 | restClient rest.Interface 40 | } 41 | 42 | func (c *NetworkingV1alpha3Client) DestinationRules(namespace string) DestinationRuleInterface { 43 | return newDestinationRules(c, namespace) 44 | } 45 | 46 | func (c *NetworkingV1alpha3Client) EnvoyFilters(namespace string) EnvoyFilterInterface { 47 | return newEnvoyFilters(c, namespace) 48 | } 49 | 50 | func (c *NetworkingV1alpha3Client) Gateways(namespace string) GatewayInterface { 51 | return newGateways(c, namespace) 52 | } 53 | 54 | func (c *NetworkingV1alpha3Client) ServiceEntries(namespace string) ServiceEntryInterface { 55 | return newServiceEntries(c, namespace) 56 | } 57 | 58 | func (c *NetworkingV1alpha3Client) VirtualServices(namespace string) VirtualServiceInterface { 59 | return newVirtualServices(c, namespace) 60 | } 61 | 62 | // NewForConfig creates a new NetworkingV1alpha3Client for the given config. 63 | func NewForConfig(c *rest.Config) (*NetworkingV1alpha3Client, error) { 64 | config := *c 65 | if err := setConfigDefaults(&config); err != nil { 66 | return nil, err 67 | } 68 | client, err := rest.RESTClientFor(&config) 69 | if err != nil { 70 | return nil, err 71 | } 72 | return &NetworkingV1alpha3Client{client}, nil 73 | } 74 | 75 | // NewForConfigOrDie creates a new NetworkingV1alpha3Client for the given config and 76 | // panics if there is an error in the config. 77 | func NewForConfigOrDie(c *rest.Config) *NetworkingV1alpha3Client { 78 | client, err := NewForConfig(c) 79 | if err != nil { 80 | panic(err) 81 | } 82 | return client 83 | } 84 | 85 | // New creates a new NetworkingV1alpha3Client for the given RESTClient. 86 | func New(c rest.Interface) *NetworkingV1alpha3Client { 87 | return &NetworkingV1alpha3Client{c} 88 | } 89 | 90 | func setConfigDefaults(config *rest.Config) error { 91 | gv := v1alpha3.SchemeGroupVersion 92 | config.GroupVersion = &gv 93 | config.APIPath = "/apis" 94 | config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() 95 | 96 | if config.UserAgent == "" { 97 | config.UserAgent = rest.DefaultKubernetesUserAgent() 98 | } 99 | 100 | return nil 101 | } 102 | 103 | // RESTClient returns a RESTClient that is used to communicate 104 | // with API server by this client implementation. 105 | func (c *NetworkingV1alpha3Client) RESTClient() rest.Interface { 106 | if c == nil { 107 | return nil 108 | } 109 | return c.restClient 110 | } 111 | -------------------------------------------------------------------------------- /pkg/client/listers/networking/v1alpha3/virtualservice.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by lister-gen. DO NOT EDIT. 19 | 20 | package v1alpha3 21 | 22 | import ( 23 | v1alpha3 "github.com/aspenmesh/istio-client-go/pkg/apis/networking/v1alpha3" 24 | "k8s.io/apimachinery/pkg/api/errors" 25 | "k8s.io/apimachinery/pkg/labels" 26 | "k8s.io/client-go/tools/cache" 27 | ) 28 | 29 | // VirtualServiceLister helps list VirtualServices. 30 | type VirtualServiceLister interface { 31 | // List lists all VirtualServices in the indexer. 32 | List(selector labels.Selector) (ret []*v1alpha3.VirtualService, err error) 33 | // VirtualServices returns an object that can list and get VirtualServices. 34 | VirtualServices(namespace string) VirtualServiceNamespaceLister 35 | VirtualServiceListerExpansion 36 | } 37 | 38 | // virtualServiceLister implements the VirtualServiceLister interface. 39 | type virtualServiceLister struct { 40 | indexer cache.Indexer 41 | } 42 | 43 | // NewVirtualServiceLister returns a new VirtualServiceLister. 44 | func NewVirtualServiceLister(indexer cache.Indexer) VirtualServiceLister { 45 | return &virtualServiceLister{indexer: indexer} 46 | } 47 | 48 | // List lists all VirtualServices in the indexer. 49 | func (s *virtualServiceLister) List(selector labels.Selector) (ret []*v1alpha3.VirtualService, err error) { 50 | err = cache.ListAll(s.indexer, selector, func(m interface{}) { 51 | ret = append(ret, m.(*v1alpha3.VirtualService)) 52 | }) 53 | return ret, err 54 | } 55 | 56 | // VirtualServices returns an object that can list and get VirtualServices. 57 | func (s *virtualServiceLister) VirtualServices(namespace string) VirtualServiceNamespaceLister { 58 | return virtualServiceNamespaceLister{indexer: s.indexer, namespace: namespace} 59 | } 60 | 61 | // VirtualServiceNamespaceLister helps list and get VirtualServices. 62 | type VirtualServiceNamespaceLister interface { 63 | // List lists all VirtualServices in the indexer for a given namespace. 64 | List(selector labels.Selector) (ret []*v1alpha3.VirtualService, err error) 65 | // Get retrieves the VirtualService from the indexer for a given namespace and name. 66 | Get(name string) (*v1alpha3.VirtualService, error) 67 | VirtualServiceNamespaceListerExpansion 68 | } 69 | 70 | // virtualServiceNamespaceLister implements the VirtualServiceNamespaceLister 71 | // interface. 72 | type virtualServiceNamespaceLister struct { 73 | indexer cache.Indexer 74 | namespace string 75 | } 76 | 77 | // List lists all VirtualServices in the indexer for a given namespace. 78 | func (s virtualServiceNamespaceLister) List(selector labels.Selector) (ret []*v1alpha3.VirtualService, err error) { 79 | err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { 80 | ret = append(ret, m.(*v1alpha3.VirtualService)) 81 | }) 82 | return ret, err 83 | } 84 | 85 | // Get retrieves the VirtualService from the indexer for a given namespace and name. 86 | func (s virtualServiceNamespaceLister) Get(name string) (*v1alpha3.VirtualService, error) { 87 | obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) 88 | if err != nil { 89 | return nil, err 90 | } 91 | if !exists { 92 | return nil, errors.NewNotFound(v1alpha3.Resource("virtualservice"), name) 93 | } 94 | return obj.(*v1alpha3.VirtualService), nil 95 | } 96 | -------------------------------------------------------------------------------- /pkg/client/listers/networking/v1alpha3/destinationrule.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by lister-gen. DO NOT EDIT. 19 | 20 | package v1alpha3 21 | 22 | import ( 23 | v1alpha3 "github.com/aspenmesh/istio-client-go/pkg/apis/networking/v1alpha3" 24 | "k8s.io/apimachinery/pkg/api/errors" 25 | "k8s.io/apimachinery/pkg/labels" 26 | "k8s.io/client-go/tools/cache" 27 | ) 28 | 29 | // DestinationRuleLister helps list DestinationRules. 30 | type DestinationRuleLister interface { 31 | // List lists all DestinationRules in the indexer. 32 | List(selector labels.Selector) (ret []*v1alpha3.DestinationRule, err error) 33 | // DestinationRules returns an object that can list and get DestinationRules. 34 | DestinationRules(namespace string) DestinationRuleNamespaceLister 35 | DestinationRuleListerExpansion 36 | } 37 | 38 | // destinationRuleLister implements the DestinationRuleLister interface. 39 | type destinationRuleLister struct { 40 | indexer cache.Indexer 41 | } 42 | 43 | // NewDestinationRuleLister returns a new DestinationRuleLister. 44 | func NewDestinationRuleLister(indexer cache.Indexer) DestinationRuleLister { 45 | return &destinationRuleLister{indexer: indexer} 46 | } 47 | 48 | // List lists all DestinationRules in the indexer. 49 | func (s *destinationRuleLister) List(selector labels.Selector) (ret []*v1alpha3.DestinationRule, err error) { 50 | err = cache.ListAll(s.indexer, selector, func(m interface{}) { 51 | ret = append(ret, m.(*v1alpha3.DestinationRule)) 52 | }) 53 | return ret, err 54 | } 55 | 56 | // DestinationRules returns an object that can list and get DestinationRules. 57 | func (s *destinationRuleLister) DestinationRules(namespace string) DestinationRuleNamespaceLister { 58 | return destinationRuleNamespaceLister{indexer: s.indexer, namespace: namespace} 59 | } 60 | 61 | // DestinationRuleNamespaceLister helps list and get DestinationRules. 62 | type DestinationRuleNamespaceLister interface { 63 | // List lists all DestinationRules in the indexer for a given namespace. 64 | List(selector labels.Selector) (ret []*v1alpha3.DestinationRule, err error) 65 | // Get retrieves the DestinationRule from the indexer for a given namespace and name. 66 | Get(name string) (*v1alpha3.DestinationRule, error) 67 | DestinationRuleNamespaceListerExpansion 68 | } 69 | 70 | // destinationRuleNamespaceLister implements the DestinationRuleNamespaceLister 71 | // interface. 72 | type destinationRuleNamespaceLister struct { 73 | indexer cache.Indexer 74 | namespace string 75 | } 76 | 77 | // List lists all DestinationRules in the indexer for a given namespace. 78 | func (s destinationRuleNamespaceLister) List(selector labels.Selector) (ret []*v1alpha3.DestinationRule, err error) { 79 | err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { 80 | ret = append(ret, m.(*v1alpha3.DestinationRule)) 81 | }) 82 | return ret, err 83 | } 84 | 85 | // Get retrieves the DestinationRule from the indexer for a given namespace and name. 86 | func (s destinationRuleNamespaceLister) Get(name string) (*v1alpha3.DestinationRule, error) { 87 | obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) 88 | if err != nil { 89 | return nil, err 90 | } 91 | if !exists { 92 | return nil, errors.NewNotFound(v1alpha3.Resource("destinationrule"), name) 93 | } 94 | return obj.(*v1alpha3.DestinationRule), nil 95 | } 96 | -------------------------------------------------------------------------------- /pkg/client/informers/externalversions/authentication/v1alpha1/meshpolicy.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by informer-gen. DO NOT EDIT. 19 | 20 | package v1alpha1 21 | 22 | import ( 23 | time "time" 24 | 25 | authenticationv1alpha1 "github.com/aspenmesh/istio-client-go/pkg/apis/authentication/v1alpha1" 26 | versioned "github.com/aspenmesh/istio-client-go/pkg/client/clientset/versioned" 27 | internalinterfaces "github.com/aspenmesh/istio-client-go/pkg/client/informers/externalversions/internalinterfaces" 28 | v1alpha1 "github.com/aspenmesh/istio-client-go/pkg/client/listers/authentication/v1alpha1" 29 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 30 | runtime "k8s.io/apimachinery/pkg/runtime" 31 | watch "k8s.io/apimachinery/pkg/watch" 32 | cache "k8s.io/client-go/tools/cache" 33 | ) 34 | 35 | // MeshPolicyInformer provides access to a shared informer and lister for 36 | // MeshPolicies. 37 | type MeshPolicyInformer interface { 38 | Informer() cache.SharedIndexInformer 39 | Lister() v1alpha1.MeshPolicyLister 40 | } 41 | 42 | type meshPolicyInformer struct { 43 | factory internalinterfaces.SharedInformerFactory 44 | tweakListOptions internalinterfaces.TweakListOptionsFunc 45 | } 46 | 47 | // NewMeshPolicyInformer constructs a new informer for MeshPolicy type. 48 | // Always prefer using an informer factory to get a shared informer instead of getting an independent 49 | // one. This reduces memory footprint and number of connections to the server. 50 | func NewMeshPolicyInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { 51 | return NewFilteredMeshPolicyInformer(client, resyncPeriod, indexers, nil) 52 | } 53 | 54 | // NewFilteredMeshPolicyInformer constructs a new informer for MeshPolicy type. 55 | // Always prefer using an informer factory to get a shared informer instead of getting an independent 56 | // one. This reduces memory footprint and number of connections to the server. 57 | func NewFilteredMeshPolicyInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { 58 | return cache.NewSharedIndexInformer( 59 | &cache.ListWatch{ 60 | ListFunc: func(options v1.ListOptions) (runtime.Object, error) { 61 | if tweakListOptions != nil { 62 | tweakListOptions(&options) 63 | } 64 | return client.AuthenticationV1alpha1().MeshPolicies().List(options) 65 | }, 66 | WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { 67 | if tweakListOptions != nil { 68 | tweakListOptions(&options) 69 | } 70 | return client.AuthenticationV1alpha1().MeshPolicies().Watch(options) 71 | }, 72 | }, 73 | &authenticationv1alpha1.MeshPolicy{}, 74 | resyncPeriod, 75 | indexers, 76 | ) 77 | } 78 | 79 | func (f *meshPolicyInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { 80 | return NewFilteredMeshPolicyInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) 81 | } 82 | 83 | func (f *meshPolicyInformer) Informer() cache.SharedIndexInformer { 84 | return f.factory.InformerFor(&authenticationv1alpha1.MeshPolicy{}, f.defaultInformer) 85 | } 86 | 87 | func (f *meshPolicyInformer) Lister() v1alpha1.MeshPolicyLister { 88 | return v1alpha1.NewMeshPolicyLister(f.Informer().GetIndexer()) 89 | } 90 | -------------------------------------------------------------------------------- /pkg/client/informers/externalversions/networking/v1alpha3/gateway.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by informer-gen. DO NOT EDIT. 19 | 20 | package v1alpha3 21 | 22 | import ( 23 | time "time" 24 | 25 | networkingv1alpha3 "github.com/aspenmesh/istio-client-go/pkg/apis/networking/v1alpha3" 26 | versioned "github.com/aspenmesh/istio-client-go/pkg/client/clientset/versioned" 27 | internalinterfaces "github.com/aspenmesh/istio-client-go/pkg/client/informers/externalversions/internalinterfaces" 28 | v1alpha3 "github.com/aspenmesh/istio-client-go/pkg/client/listers/networking/v1alpha3" 29 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 30 | runtime "k8s.io/apimachinery/pkg/runtime" 31 | watch "k8s.io/apimachinery/pkg/watch" 32 | cache "k8s.io/client-go/tools/cache" 33 | ) 34 | 35 | // GatewayInformer provides access to a shared informer and lister for 36 | // Gateways. 37 | type GatewayInformer interface { 38 | Informer() cache.SharedIndexInformer 39 | Lister() v1alpha3.GatewayLister 40 | } 41 | 42 | type gatewayInformer struct { 43 | factory internalinterfaces.SharedInformerFactory 44 | tweakListOptions internalinterfaces.TweakListOptionsFunc 45 | namespace string 46 | } 47 | 48 | // NewGatewayInformer constructs a new informer for Gateway type. 49 | // Always prefer using an informer factory to get a shared informer instead of getting an independent 50 | // one. This reduces memory footprint and number of connections to the server. 51 | func NewGatewayInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { 52 | return NewFilteredGatewayInformer(client, namespace, resyncPeriod, indexers, nil) 53 | } 54 | 55 | // NewFilteredGatewayInformer constructs a new informer for Gateway type. 56 | // Always prefer using an informer factory to get a shared informer instead of getting an independent 57 | // one. This reduces memory footprint and number of connections to the server. 58 | func NewFilteredGatewayInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { 59 | return cache.NewSharedIndexInformer( 60 | &cache.ListWatch{ 61 | ListFunc: func(options v1.ListOptions) (runtime.Object, error) { 62 | if tweakListOptions != nil { 63 | tweakListOptions(&options) 64 | } 65 | return client.NetworkingV1alpha3().Gateways(namespace).List(options) 66 | }, 67 | WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { 68 | if tweakListOptions != nil { 69 | tweakListOptions(&options) 70 | } 71 | return client.NetworkingV1alpha3().Gateways(namespace).Watch(options) 72 | }, 73 | }, 74 | &networkingv1alpha3.Gateway{}, 75 | resyncPeriod, 76 | indexers, 77 | ) 78 | } 79 | 80 | func (f *gatewayInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { 81 | return NewFilteredGatewayInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) 82 | } 83 | 84 | func (f *gatewayInformer) Informer() cache.SharedIndexInformer { 85 | return f.factory.InformerFor(&networkingv1alpha3.Gateway{}, f.defaultInformer) 86 | } 87 | 88 | func (f *gatewayInformer) Lister() v1alpha3.GatewayLister { 89 | return v1alpha3.NewGatewayLister(f.Informer().GetIndexer()) 90 | } 91 | -------------------------------------------------------------------------------- /pkg/client/informers/externalversions/authentication/v1alpha1/policy.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by informer-gen. DO NOT EDIT. 19 | 20 | package v1alpha1 21 | 22 | import ( 23 | time "time" 24 | 25 | authenticationv1alpha1 "github.com/aspenmesh/istio-client-go/pkg/apis/authentication/v1alpha1" 26 | versioned "github.com/aspenmesh/istio-client-go/pkg/client/clientset/versioned" 27 | internalinterfaces "github.com/aspenmesh/istio-client-go/pkg/client/informers/externalversions/internalinterfaces" 28 | v1alpha1 "github.com/aspenmesh/istio-client-go/pkg/client/listers/authentication/v1alpha1" 29 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 30 | runtime "k8s.io/apimachinery/pkg/runtime" 31 | watch "k8s.io/apimachinery/pkg/watch" 32 | cache "k8s.io/client-go/tools/cache" 33 | ) 34 | 35 | // PolicyInformer provides access to a shared informer and lister for 36 | // Policies. 37 | type PolicyInformer interface { 38 | Informer() cache.SharedIndexInformer 39 | Lister() v1alpha1.PolicyLister 40 | } 41 | 42 | type policyInformer struct { 43 | factory internalinterfaces.SharedInformerFactory 44 | tweakListOptions internalinterfaces.TweakListOptionsFunc 45 | namespace string 46 | } 47 | 48 | // NewPolicyInformer constructs a new informer for Policy type. 49 | // Always prefer using an informer factory to get a shared informer instead of getting an independent 50 | // one. This reduces memory footprint and number of connections to the server. 51 | func NewPolicyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { 52 | return NewFilteredPolicyInformer(client, namespace, resyncPeriod, indexers, nil) 53 | } 54 | 55 | // NewFilteredPolicyInformer constructs a new informer for Policy type. 56 | // Always prefer using an informer factory to get a shared informer instead of getting an independent 57 | // one. This reduces memory footprint and number of connections to the server. 58 | func NewFilteredPolicyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { 59 | return cache.NewSharedIndexInformer( 60 | &cache.ListWatch{ 61 | ListFunc: func(options v1.ListOptions) (runtime.Object, error) { 62 | if tweakListOptions != nil { 63 | tweakListOptions(&options) 64 | } 65 | return client.AuthenticationV1alpha1().Policies(namespace).List(options) 66 | }, 67 | WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { 68 | if tweakListOptions != nil { 69 | tweakListOptions(&options) 70 | } 71 | return client.AuthenticationV1alpha1().Policies(namespace).Watch(options) 72 | }, 73 | }, 74 | &authenticationv1alpha1.Policy{}, 75 | resyncPeriod, 76 | indexers, 77 | ) 78 | } 79 | 80 | func (f *policyInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { 81 | return NewFilteredPolicyInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) 82 | } 83 | 84 | func (f *policyInformer) Informer() cache.SharedIndexInformer { 85 | return f.factory.InformerFor(&authenticationv1alpha1.Policy{}, f.defaultInformer) 86 | } 87 | 88 | func (f *policyInformer) Lister() v1alpha1.PolicyLister { 89 | return v1alpha1.NewPolicyLister(f.Informer().GetIndexer()) 90 | } 91 | -------------------------------------------------------------------------------- /pkg/client/informers/externalversions/rbac/v1alpha1/rbacconfig.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by informer-gen. DO NOT EDIT. 19 | 20 | package v1alpha1 21 | 22 | import ( 23 | time "time" 24 | 25 | rbacv1alpha1 "github.com/aspenmesh/istio-client-go/pkg/apis/rbac/v1alpha1" 26 | versioned "github.com/aspenmesh/istio-client-go/pkg/client/clientset/versioned" 27 | internalinterfaces "github.com/aspenmesh/istio-client-go/pkg/client/informers/externalversions/internalinterfaces" 28 | v1alpha1 "github.com/aspenmesh/istio-client-go/pkg/client/listers/rbac/v1alpha1" 29 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 30 | runtime "k8s.io/apimachinery/pkg/runtime" 31 | watch "k8s.io/apimachinery/pkg/watch" 32 | cache "k8s.io/client-go/tools/cache" 33 | ) 34 | 35 | // RbacConfigInformer provides access to a shared informer and lister for 36 | // RbacConfigs. 37 | type RbacConfigInformer interface { 38 | Informer() cache.SharedIndexInformer 39 | Lister() v1alpha1.RbacConfigLister 40 | } 41 | 42 | type rbacConfigInformer struct { 43 | factory internalinterfaces.SharedInformerFactory 44 | tweakListOptions internalinterfaces.TweakListOptionsFunc 45 | namespace string 46 | } 47 | 48 | // NewRbacConfigInformer constructs a new informer for RbacConfig type. 49 | // Always prefer using an informer factory to get a shared informer instead of getting an independent 50 | // one. This reduces memory footprint and number of connections to the server. 51 | func NewRbacConfigInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { 52 | return NewFilteredRbacConfigInformer(client, namespace, resyncPeriod, indexers, nil) 53 | } 54 | 55 | // NewFilteredRbacConfigInformer constructs a new informer for RbacConfig type. 56 | // Always prefer using an informer factory to get a shared informer instead of getting an independent 57 | // one. This reduces memory footprint and number of connections to the server. 58 | func NewFilteredRbacConfigInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { 59 | return cache.NewSharedIndexInformer( 60 | &cache.ListWatch{ 61 | ListFunc: func(options v1.ListOptions) (runtime.Object, error) { 62 | if tweakListOptions != nil { 63 | tweakListOptions(&options) 64 | } 65 | return client.RbacV1alpha1().RbacConfigs(namespace).List(options) 66 | }, 67 | WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { 68 | if tweakListOptions != nil { 69 | tweakListOptions(&options) 70 | } 71 | return client.RbacV1alpha1().RbacConfigs(namespace).Watch(options) 72 | }, 73 | }, 74 | &rbacv1alpha1.RbacConfig{}, 75 | resyncPeriod, 76 | indexers, 77 | ) 78 | } 79 | 80 | func (f *rbacConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { 81 | return NewFilteredRbacConfigInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) 82 | } 83 | 84 | func (f *rbacConfigInformer) Informer() cache.SharedIndexInformer { 85 | return f.factory.InformerFor(&rbacv1alpha1.RbacConfig{}, f.defaultInformer) 86 | } 87 | 88 | func (f *rbacConfigInformer) Lister() v1alpha1.RbacConfigLister { 89 | return v1alpha1.NewRbacConfigLister(f.Informer().GetIndexer()) 90 | } 91 | -------------------------------------------------------------------------------- /pkg/client/listers/rbac/v1alpha1/servicerolebinding.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by lister-gen. DO NOT EDIT. 19 | 20 | package v1alpha1 21 | 22 | import ( 23 | v1alpha1 "github.com/aspenmesh/istio-client-go/pkg/apis/rbac/v1alpha1" 24 | "k8s.io/apimachinery/pkg/api/errors" 25 | "k8s.io/apimachinery/pkg/labels" 26 | "k8s.io/client-go/tools/cache" 27 | ) 28 | 29 | // ServiceRoleBindingLister helps list ServiceRoleBindings. 30 | type ServiceRoleBindingLister interface { 31 | // List lists all ServiceRoleBindings in the indexer. 32 | List(selector labels.Selector) (ret []*v1alpha1.ServiceRoleBinding, err error) 33 | // ServiceRoleBindings returns an object that can list and get ServiceRoleBindings. 34 | ServiceRoleBindings(namespace string) ServiceRoleBindingNamespaceLister 35 | ServiceRoleBindingListerExpansion 36 | } 37 | 38 | // serviceRoleBindingLister implements the ServiceRoleBindingLister interface. 39 | type serviceRoleBindingLister struct { 40 | indexer cache.Indexer 41 | } 42 | 43 | // NewServiceRoleBindingLister returns a new ServiceRoleBindingLister. 44 | func NewServiceRoleBindingLister(indexer cache.Indexer) ServiceRoleBindingLister { 45 | return &serviceRoleBindingLister{indexer: indexer} 46 | } 47 | 48 | // List lists all ServiceRoleBindings in the indexer. 49 | func (s *serviceRoleBindingLister) List(selector labels.Selector) (ret []*v1alpha1.ServiceRoleBinding, err error) { 50 | err = cache.ListAll(s.indexer, selector, func(m interface{}) { 51 | ret = append(ret, m.(*v1alpha1.ServiceRoleBinding)) 52 | }) 53 | return ret, err 54 | } 55 | 56 | // ServiceRoleBindings returns an object that can list and get ServiceRoleBindings. 57 | func (s *serviceRoleBindingLister) ServiceRoleBindings(namespace string) ServiceRoleBindingNamespaceLister { 58 | return serviceRoleBindingNamespaceLister{indexer: s.indexer, namespace: namespace} 59 | } 60 | 61 | // ServiceRoleBindingNamespaceLister helps list and get ServiceRoleBindings. 62 | type ServiceRoleBindingNamespaceLister interface { 63 | // List lists all ServiceRoleBindings in the indexer for a given namespace. 64 | List(selector labels.Selector) (ret []*v1alpha1.ServiceRoleBinding, err error) 65 | // Get retrieves the ServiceRoleBinding from the indexer for a given namespace and name. 66 | Get(name string) (*v1alpha1.ServiceRoleBinding, error) 67 | ServiceRoleBindingNamespaceListerExpansion 68 | } 69 | 70 | // serviceRoleBindingNamespaceLister implements the ServiceRoleBindingNamespaceLister 71 | // interface. 72 | type serviceRoleBindingNamespaceLister struct { 73 | indexer cache.Indexer 74 | namespace string 75 | } 76 | 77 | // List lists all ServiceRoleBindings in the indexer for a given namespace. 78 | func (s serviceRoleBindingNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.ServiceRoleBinding, err error) { 79 | err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { 80 | ret = append(ret, m.(*v1alpha1.ServiceRoleBinding)) 81 | }) 82 | return ret, err 83 | } 84 | 85 | // Get retrieves the ServiceRoleBinding from the indexer for a given namespace and name. 86 | func (s serviceRoleBindingNamespaceLister) Get(name string) (*v1alpha1.ServiceRoleBinding, error) { 87 | obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) 88 | if err != nil { 89 | return nil, err 90 | } 91 | if !exists { 92 | return nil, errors.NewNotFound(v1alpha1.Resource("servicerolebinding"), name) 93 | } 94 | return obj.(*v1alpha1.ServiceRoleBinding), nil 95 | } 96 | -------------------------------------------------------------------------------- /pkg/client/informers/externalversions/rbac/v1alpha1/servicerole.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by informer-gen. DO NOT EDIT. 19 | 20 | package v1alpha1 21 | 22 | import ( 23 | time "time" 24 | 25 | rbacv1alpha1 "github.com/aspenmesh/istio-client-go/pkg/apis/rbac/v1alpha1" 26 | versioned "github.com/aspenmesh/istio-client-go/pkg/client/clientset/versioned" 27 | internalinterfaces "github.com/aspenmesh/istio-client-go/pkg/client/informers/externalversions/internalinterfaces" 28 | v1alpha1 "github.com/aspenmesh/istio-client-go/pkg/client/listers/rbac/v1alpha1" 29 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 30 | runtime "k8s.io/apimachinery/pkg/runtime" 31 | watch "k8s.io/apimachinery/pkg/watch" 32 | cache "k8s.io/client-go/tools/cache" 33 | ) 34 | 35 | // ServiceRoleInformer provides access to a shared informer and lister for 36 | // ServiceRoles. 37 | type ServiceRoleInformer interface { 38 | Informer() cache.SharedIndexInformer 39 | Lister() v1alpha1.ServiceRoleLister 40 | } 41 | 42 | type serviceRoleInformer struct { 43 | factory internalinterfaces.SharedInformerFactory 44 | tweakListOptions internalinterfaces.TweakListOptionsFunc 45 | namespace string 46 | } 47 | 48 | // NewServiceRoleInformer constructs a new informer for ServiceRole type. 49 | // Always prefer using an informer factory to get a shared informer instead of getting an independent 50 | // one. This reduces memory footprint and number of connections to the server. 51 | func NewServiceRoleInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { 52 | return NewFilteredServiceRoleInformer(client, namespace, resyncPeriod, indexers, nil) 53 | } 54 | 55 | // NewFilteredServiceRoleInformer constructs a new informer for ServiceRole type. 56 | // Always prefer using an informer factory to get a shared informer instead of getting an independent 57 | // one. This reduces memory footprint and number of connections to the server. 58 | func NewFilteredServiceRoleInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { 59 | return cache.NewSharedIndexInformer( 60 | &cache.ListWatch{ 61 | ListFunc: func(options v1.ListOptions) (runtime.Object, error) { 62 | if tweakListOptions != nil { 63 | tweakListOptions(&options) 64 | } 65 | return client.RbacV1alpha1().ServiceRoles(namespace).List(options) 66 | }, 67 | WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { 68 | if tweakListOptions != nil { 69 | tweakListOptions(&options) 70 | } 71 | return client.RbacV1alpha1().ServiceRoles(namespace).Watch(options) 72 | }, 73 | }, 74 | &rbacv1alpha1.ServiceRole{}, 75 | resyncPeriod, 76 | indexers, 77 | ) 78 | } 79 | 80 | func (f *serviceRoleInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { 81 | return NewFilteredServiceRoleInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) 82 | } 83 | 84 | func (f *serviceRoleInformer) Informer() cache.SharedIndexInformer { 85 | return f.factory.InformerFor(&rbacv1alpha1.ServiceRole{}, f.defaultInformer) 86 | } 87 | 88 | func (f *serviceRoleInformer) Lister() v1alpha1.ServiceRoleLister { 89 | return v1alpha1.NewServiceRoleLister(f.Informer().GetIndexer()) 90 | } 91 | -------------------------------------------------------------------------------- /pkg/client/informers/externalversions/networking/v1alpha3/envoyfilter.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by informer-gen. DO NOT EDIT. 19 | 20 | package v1alpha3 21 | 22 | import ( 23 | time "time" 24 | 25 | networkingv1alpha3 "github.com/aspenmesh/istio-client-go/pkg/apis/networking/v1alpha3" 26 | versioned "github.com/aspenmesh/istio-client-go/pkg/client/clientset/versioned" 27 | internalinterfaces "github.com/aspenmesh/istio-client-go/pkg/client/informers/externalversions/internalinterfaces" 28 | v1alpha3 "github.com/aspenmesh/istio-client-go/pkg/client/listers/networking/v1alpha3" 29 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 30 | runtime "k8s.io/apimachinery/pkg/runtime" 31 | watch "k8s.io/apimachinery/pkg/watch" 32 | cache "k8s.io/client-go/tools/cache" 33 | ) 34 | 35 | // EnvoyFilterInformer provides access to a shared informer and lister for 36 | // EnvoyFilters. 37 | type EnvoyFilterInformer interface { 38 | Informer() cache.SharedIndexInformer 39 | Lister() v1alpha3.EnvoyFilterLister 40 | } 41 | 42 | type envoyFilterInformer struct { 43 | factory internalinterfaces.SharedInformerFactory 44 | tweakListOptions internalinterfaces.TweakListOptionsFunc 45 | namespace string 46 | } 47 | 48 | // NewEnvoyFilterInformer constructs a new informer for EnvoyFilter type. 49 | // Always prefer using an informer factory to get a shared informer instead of getting an independent 50 | // one. This reduces memory footprint and number of connections to the server. 51 | func NewEnvoyFilterInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { 52 | return NewFilteredEnvoyFilterInformer(client, namespace, resyncPeriod, indexers, nil) 53 | } 54 | 55 | // NewFilteredEnvoyFilterInformer constructs a new informer for EnvoyFilter type. 56 | // Always prefer using an informer factory to get a shared informer instead of getting an independent 57 | // one. This reduces memory footprint and number of connections to the server. 58 | func NewFilteredEnvoyFilterInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { 59 | return cache.NewSharedIndexInformer( 60 | &cache.ListWatch{ 61 | ListFunc: func(options v1.ListOptions) (runtime.Object, error) { 62 | if tweakListOptions != nil { 63 | tweakListOptions(&options) 64 | } 65 | return client.NetworkingV1alpha3().EnvoyFilters(namespace).List(options) 66 | }, 67 | WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { 68 | if tweakListOptions != nil { 69 | tweakListOptions(&options) 70 | } 71 | return client.NetworkingV1alpha3().EnvoyFilters(namespace).Watch(options) 72 | }, 73 | }, 74 | &networkingv1alpha3.EnvoyFilter{}, 75 | resyncPeriod, 76 | indexers, 77 | ) 78 | } 79 | 80 | func (f *envoyFilterInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { 81 | return NewFilteredEnvoyFilterInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) 82 | } 83 | 84 | func (f *envoyFilterInformer) Informer() cache.SharedIndexInformer { 85 | return f.factory.InformerFor(&networkingv1alpha3.EnvoyFilter{}, f.defaultInformer) 86 | } 87 | 88 | func (f *envoyFilterInformer) Lister() v1alpha3.EnvoyFilterLister { 89 | return v1alpha3.NewEnvoyFilterLister(f.Informer().GetIndexer()) 90 | } 91 | -------------------------------------------------------------------------------- /pkg/client/informers/externalversions/networking/v1alpha3/serviceentry.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by informer-gen. DO NOT EDIT. 19 | 20 | package v1alpha3 21 | 22 | import ( 23 | time "time" 24 | 25 | networkingv1alpha3 "github.com/aspenmesh/istio-client-go/pkg/apis/networking/v1alpha3" 26 | versioned "github.com/aspenmesh/istio-client-go/pkg/client/clientset/versioned" 27 | internalinterfaces "github.com/aspenmesh/istio-client-go/pkg/client/informers/externalversions/internalinterfaces" 28 | v1alpha3 "github.com/aspenmesh/istio-client-go/pkg/client/listers/networking/v1alpha3" 29 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 30 | runtime "k8s.io/apimachinery/pkg/runtime" 31 | watch "k8s.io/apimachinery/pkg/watch" 32 | cache "k8s.io/client-go/tools/cache" 33 | ) 34 | 35 | // ServiceEntryInformer provides access to a shared informer and lister for 36 | // ServiceEntries. 37 | type ServiceEntryInformer interface { 38 | Informer() cache.SharedIndexInformer 39 | Lister() v1alpha3.ServiceEntryLister 40 | } 41 | 42 | type serviceEntryInformer struct { 43 | factory internalinterfaces.SharedInformerFactory 44 | tweakListOptions internalinterfaces.TweakListOptionsFunc 45 | namespace string 46 | } 47 | 48 | // NewServiceEntryInformer constructs a new informer for ServiceEntry type. 49 | // Always prefer using an informer factory to get a shared informer instead of getting an independent 50 | // one. This reduces memory footprint and number of connections to the server. 51 | func NewServiceEntryInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { 52 | return NewFilteredServiceEntryInformer(client, namespace, resyncPeriod, indexers, nil) 53 | } 54 | 55 | // NewFilteredServiceEntryInformer constructs a new informer for ServiceEntry type. 56 | // Always prefer using an informer factory to get a shared informer instead of getting an independent 57 | // one. This reduces memory footprint and number of connections to the server. 58 | func NewFilteredServiceEntryInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { 59 | return cache.NewSharedIndexInformer( 60 | &cache.ListWatch{ 61 | ListFunc: func(options v1.ListOptions) (runtime.Object, error) { 62 | if tweakListOptions != nil { 63 | tweakListOptions(&options) 64 | } 65 | return client.NetworkingV1alpha3().ServiceEntries(namespace).List(options) 66 | }, 67 | WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { 68 | if tweakListOptions != nil { 69 | tweakListOptions(&options) 70 | } 71 | return client.NetworkingV1alpha3().ServiceEntries(namespace).Watch(options) 72 | }, 73 | }, 74 | &networkingv1alpha3.ServiceEntry{}, 75 | resyncPeriod, 76 | indexers, 77 | ) 78 | } 79 | 80 | func (f *serviceEntryInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { 81 | return NewFilteredServiceEntryInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) 82 | } 83 | 84 | func (f *serviceEntryInformer) Informer() cache.SharedIndexInformer { 85 | return f.factory.InformerFor(&networkingv1alpha3.ServiceEntry{}, f.defaultInformer) 86 | } 87 | 88 | func (f *serviceEntryInformer) Lister() v1alpha3.ServiceEntryLister { 89 | return v1alpha3.NewServiceEntryLister(f.Informer().GetIndexer()) 90 | } 91 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/fake/clientset_generated.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by client-gen. DO NOT EDIT. 19 | 20 | package fake 21 | 22 | import ( 23 | clientset "github.com/aspenmesh/istio-client-go/pkg/client/clientset/versioned" 24 | authenticationv1alpha1 "github.com/aspenmesh/istio-client-go/pkg/client/clientset/versioned/typed/authentication/v1alpha1" 25 | fakeauthenticationv1alpha1 "github.com/aspenmesh/istio-client-go/pkg/client/clientset/versioned/typed/authentication/v1alpha1/fake" 26 | networkingv1alpha3 "github.com/aspenmesh/istio-client-go/pkg/client/clientset/versioned/typed/networking/v1alpha3" 27 | fakenetworkingv1alpha3 "github.com/aspenmesh/istio-client-go/pkg/client/clientset/versioned/typed/networking/v1alpha3/fake" 28 | rbacv1alpha1 "github.com/aspenmesh/istio-client-go/pkg/client/clientset/versioned/typed/rbac/v1alpha1" 29 | fakerbacv1alpha1 "github.com/aspenmesh/istio-client-go/pkg/client/clientset/versioned/typed/rbac/v1alpha1/fake" 30 | "k8s.io/apimachinery/pkg/runtime" 31 | "k8s.io/apimachinery/pkg/watch" 32 | "k8s.io/client-go/discovery" 33 | fakediscovery "k8s.io/client-go/discovery/fake" 34 | "k8s.io/client-go/testing" 35 | ) 36 | 37 | // NewSimpleClientset returns a clientset that will respond with the provided objects. 38 | // It's backed by a very simple object tracker that processes creates, updates and deletions as-is, 39 | // without applying any validations and/or defaults. It shouldn't be considered a replacement 40 | // for a real clientset and is mostly useful in simple unit tests. 41 | func NewSimpleClientset(objects ...runtime.Object) *Clientset { 42 | o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) 43 | for _, obj := range objects { 44 | if err := o.Add(obj); err != nil { 45 | panic(err) 46 | } 47 | } 48 | 49 | cs := &Clientset{tracker: o} 50 | cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} 51 | cs.AddReactor("*", "*", testing.ObjectReaction(o)) 52 | cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { 53 | gvr := action.GetResource() 54 | ns := action.GetNamespace() 55 | watch, err := o.Watch(gvr, ns) 56 | if err != nil { 57 | return false, nil, err 58 | } 59 | return true, watch, nil 60 | }) 61 | 62 | return cs 63 | } 64 | 65 | // Clientset implements clientset.Interface. Meant to be embedded into a 66 | // struct to get a default implementation. This makes faking out just the method 67 | // you want to test easier. 68 | type Clientset struct { 69 | testing.Fake 70 | discovery *fakediscovery.FakeDiscovery 71 | tracker testing.ObjectTracker 72 | } 73 | 74 | func (c *Clientset) Discovery() discovery.DiscoveryInterface { 75 | return c.discovery 76 | } 77 | 78 | func (c *Clientset) Tracker() testing.ObjectTracker { 79 | return c.tracker 80 | } 81 | 82 | var _ clientset.Interface = &Clientset{} 83 | 84 | // AuthenticationV1alpha1 retrieves the AuthenticationV1alpha1Client 85 | func (c *Clientset) AuthenticationV1alpha1() authenticationv1alpha1.AuthenticationV1alpha1Interface { 86 | return &fakeauthenticationv1alpha1.FakeAuthenticationV1alpha1{Fake: &c.Fake} 87 | } 88 | 89 | // NetworkingV1alpha3 retrieves the NetworkingV1alpha3Client 90 | func (c *Clientset) NetworkingV1alpha3() networkingv1alpha3.NetworkingV1alpha3Interface { 91 | return &fakenetworkingv1alpha3.FakeNetworkingV1alpha3{Fake: &c.Fake} 92 | } 93 | 94 | // RbacV1alpha1 retrieves the RbacV1alpha1Client 95 | func (c *Clientset) RbacV1alpha1() rbacv1alpha1.RbacV1alpha1Interface { 96 | return &fakerbacv1alpha1.FakeRbacV1alpha1{Fake: &c.Fake} 97 | } 98 | -------------------------------------------------------------------------------- /pkg/client/informers/externalversions/networking/v1alpha3/virtualservice.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by informer-gen. DO NOT EDIT. 19 | 20 | package v1alpha3 21 | 22 | import ( 23 | time "time" 24 | 25 | networkingv1alpha3 "github.com/aspenmesh/istio-client-go/pkg/apis/networking/v1alpha3" 26 | versioned "github.com/aspenmesh/istio-client-go/pkg/client/clientset/versioned" 27 | internalinterfaces "github.com/aspenmesh/istio-client-go/pkg/client/informers/externalversions/internalinterfaces" 28 | v1alpha3 "github.com/aspenmesh/istio-client-go/pkg/client/listers/networking/v1alpha3" 29 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 30 | runtime "k8s.io/apimachinery/pkg/runtime" 31 | watch "k8s.io/apimachinery/pkg/watch" 32 | cache "k8s.io/client-go/tools/cache" 33 | ) 34 | 35 | // VirtualServiceInformer provides access to a shared informer and lister for 36 | // VirtualServices. 37 | type VirtualServiceInformer interface { 38 | Informer() cache.SharedIndexInformer 39 | Lister() v1alpha3.VirtualServiceLister 40 | } 41 | 42 | type virtualServiceInformer struct { 43 | factory internalinterfaces.SharedInformerFactory 44 | tweakListOptions internalinterfaces.TweakListOptionsFunc 45 | namespace string 46 | } 47 | 48 | // NewVirtualServiceInformer constructs a new informer for VirtualService type. 49 | // Always prefer using an informer factory to get a shared informer instead of getting an independent 50 | // one. This reduces memory footprint and number of connections to the server. 51 | func NewVirtualServiceInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { 52 | return NewFilteredVirtualServiceInformer(client, namespace, resyncPeriod, indexers, nil) 53 | } 54 | 55 | // NewFilteredVirtualServiceInformer constructs a new informer for VirtualService type. 56 | // Always prefer using an informer factory to get a shared informer instead of getting an independent 57 | // one. This reduces memory footprint and number of connections to the server. 58 | func NewFilteredVirtualServiceInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { 59 | return cache.NewSharedIndexInformer( 60 | &cache.ListWatch{ 61 | ListFunc: func(options v1.ListOptions) (runtime.Object, error) { 62 | if tweakListOptions != nil { 63 | tweakListOptions(&options) 64 | } 65 | return client.NetworkingV1alpha3().VirtualServices(namespace).List(options) 66 | }, 67 | WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { 68 | if tweakListOptions != nil { 69 | tweakListOptions(&options) 70 | } 71 | return client.NetworkingV1alpha3().VirtualServices(namespace).Watch(options) 72 | }, 73 | }, 74 | &networkingv1alpha3.VirtualService{}, 75 | resyncPeriod, 76 | indexers, 77 | ) 78 | } 79 | 80 | func (f *virtualServiceInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { 81 | return NewFilteredVirtualServiceInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) 82 | } 83 | 84 | func (f *virtualServiceInformer) Informer() cache.SharedIndexInformer { 85 | return f.factory.InformerFor(&networkingv1alpha3.VirtualService{}, f.defaultInformer) 86 | } 87 | 88 | func (f *virtualServiceInformer) Lister() v1alpha3.VirtualServiceLister { 89 | return v1alpha3.NewVirtualServiceLister(f.Informer().GetIndexer()) 90 | } 91 | -------------------------------------------------------------------------------- /pkg/client/informers/externalversions/networking/v1alpha3/destinationrule.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by informer-gen. DO NOT EDIT. 19 | 20 | package v1alpha3 21 | 22 | import ( 23 | time "time" 24 | 25 | networkingv1alpha3 "github.com/aspenmesh/istio-client-go/pkg/apis/networking/v1alpha3" 26 | versioned "github.com/aspenmesh/istio-client-go/pkg/client/clientset/versioned" 27 | internalinterfaces "github.com/aspenmesh/istio-client-go/pkg/client/informers/externalversions/internalinterfaces" 28 | v1alpha3 "github.com/aspenmesh/istio-client-go/pkg/client/listers/networking/v1alpha3" 29 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 30 | runtime "k8s.io/apimachinery/pkg/runtime" 31 | watch "k8s.io/apimachinery/pkg/watch" 32 | cache "k8s.io/client-go/tools/cache" 33 | ) 34 | 35 | // DestinationRuleInformer provides access to a shared informer and lister for 36 | // DestinationRules. 37 | type DestinationRuleInformer interface { 38 | Informer() cache.SharedIndexInformer 39 | Lister() v1alpha3.DestinationRuleLister 40 | } 41 | 42 | type destinationRuleInformer struct { 43 | factory internalinterfaces.SharedInformerFactory 44 | tweakListOptions internalinterfaces.TweakListOptionsFunc 45 | namespace string 46 | } 47 | 48 | // NewDestinationRuleInformer constructs a new informer for DestinationRule type. 49 | // Always prefer using an informer factory to get a shared informer instead of getting an independent 50 | // one. This reduces memory footprint and number of connections to the server. 51 | func NewDestinationRuleInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { 52 | return NewFilteredDestinationRuleInformer(client, namespace, resyncPeriod, indexers, nil) 53 | } 54 | 55 | // NewFilteredDestinationRuleInformer constructs a new informer for DestinationRule type. 56 | // Always prefer using an informer factory to get a shared informer instead of getting an independent 57 | // one. This reduces memory footprint and number of connections to the server. 58 | func NewFilteredDestinationRuleInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { 59 | return cache.NewSharedIndexInformer( 60 | &cache.ListWatch{ 61 | ListFunc: func(options v1.ListOptions) (runtime.Object, error) { 62 | if tweakListOptions != nil { 63 | tweakListOptions(&options) 64 | } 65 | return client.NetworkingV1alpha3().DestinationRules(namespace).List(options) 66 | }, 67 | WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { 68 | if tweakListOptions != nil { 69 | tweakListOptions(&options) 70 | } 71 | return client.NetworkingV1alpha3().DestinationRules(namespace).Watch(options) 72 | }, 73 | }, 74 | &networkingv1alpha3.DestinationRule{}, 75 | resyncPeriod, 76 | indexers, 77 | ) 78 | } 79 | 80 | func (f *destinationRuleInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { 81 | return NewFilteredDestinationRuleInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) 82 | } 83 | 84 | func (f *destinationRuleInformer) Informer() cache.SharedIndexInformer { 85 | return f.factory.InformerFor(&networkingv1alpha3.DestinationRule{}, f.defaultInformer) 86 | } 87 | 88 | func (f *destinationRuleInformer) Lister() v1alpha3.DestinationRuleLister { 89 | return v1alpha3.NewDestinationRuleLister(f.Informer().GetIndexer()) 90 | } 91 | -------------------------------------------------------------------------------- /pkg/client/informers/externalversions/rbac/v1alpha1/servicerolebinding.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by informer-gen. DO NOT EDIT. 19 | 20 | package v1alpha1 21 | 22 | import ( 23 | time "time" 24 | 25 | rbacv1alpha1 "github.com/aspenmesh/istio-client-go/pkg/apis/rbac/v1alpha1" 26 | versioned "github.com/aspenmesh/istio-client-go/pkg/client/clientset/versioned" 27 | internalinterfaces "github.com/aspenmesh/istio-client-go/pkg/client/informers/externalversions/internalinterfaces" 28 | v1alpha1 "github.com/aspenmesh/istio-client-go/pkg/client/listers/rbac/v1alpha1" 29 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 30 | runtime "k8s.io/apimachinery/pkg/runtime" 31 | watch "k8s.io/apimachinery/pkg/watch" 32 | cache "k8s.io/client-go/tools/cache" 33 | ) 34 | 35 | // ServiceRoleBindingInformer provides access to a shared informer and lister for 36 | // ServiceRoleBindings. 37 | type ServiceRoleBindingInformer interface { 38 | Informer() cache.SharedIndexInformer 39 | Lister() v1alpha1.ServiceRoleBindingLister 40 | } 41 | 42 | type serviceRoleBindingInformer struct { 43 | factory internalinterfaces.SharedInformerFactory 44 | tweakListOptions internalinterfaces.TweakListOptionsFunc 45 | namespace string 46 | } 47 | 48 | // NewServiceRoleBindingInformer constructs a new informer for ServiceRoleBinding type. 49 | // Always prefer using an informer factory to get a shared informer instead of getting an independent 50 | // one. This reduces memory footprint and number of connections to the server. 51 | func NewServiceRoleBindingInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { 52 | return NewFilteredServiceRoleBindingInformer(client, namespace, resyncPeriod, indexers, nil) 53 | } 54 | 55 | // NewFilteredServiceRoleBindingInformer constructs a new informer for ServiceRoleBinding type. 56 | // Always prefer using an informer factory to get a shared informer instead of getting an independent 57 | // one. This reduces memory footprint and number of connections to the server. 58 | func NewFilteredServiceRoleBindingInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { 59 | return cache.NewSharedIndexInformer( 60 | &cache.ListWatch{ 61 | ListFunc: func(options v1.ListOptions) (runtime.Object, error) { 62 | if tweakListOptions != nil { 63 | tweakListOptions(&options) 64 | } 65 | return client.RbacV1alpha1().ServiceRoleBindings(namespace).List(options) 66 | }, 67 | WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { 68 | if tweakListOptions != nil { 69 | tweakListOptions(&options) 70 | } 71 | return client.RbacV1alpha1().ServiceRoleBindings(namespace).Watch(options) 72 | }, 73 | }, 74 | &rbacv1alpha1.ServiceRoleBinding{}, 75 | resyncPeriod, 76 | indexers, 77 | ) 78 | } 79 | 80 | func (f *serviceRoleBindingInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { 81 | return NewFilteredServiceRoleBindingInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) 82 | } 83 | 84 | func (f *serviceRoleBindingInformer) Informer() cache.SharedIndexInformer { 85 | return f.factory.InformerFor(&rbacv1alpha1.ServiceRoleBinding{}, f.defaultInformer) 86 | } 87 | 88 | func (f *serviceRoleBindingInformer) Lister() v1alpha1.ServiceRoleBindingLister { 89 | return v1alpha1.NewServiceRoleBindingLister(f.Informer().GetIndexer()) 90 | } 91 | -------------------------------------------------------------------------------- /pkg/client/informers/externalversions/generic.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by informer-gen. DO NOT EDIT. 19 | 20 | package externalversions 21 | 22 | import ( 23 | "fmt" 24 | 25 | v1alpha1 "github.com/aspenmesh/istio-client-go/pkg/apis/authentication/v1alpha1" 26 | v1alpha3 "github.com/aspenmesh/istio-client-go/pkg/apis/networking/v1alpha3" 27 | rbacv1alpha1 "github.com/aspenmesh/istio-client-go/pkg/apis/rbac/v1alpha1" 28 | schema "k8s.io/apimachinery/pkg/runtime/schema" 29 | cache "k8s.io/client-go/tools/cache" 30 | ) 31 | 32 | // GenericInformer is type of SharedIndexInformer which will locate and delegate to other 33 | // sharedInformers based on type 34 | type GenericInformer interface { 35 | Informer() cache.SharedIndexInformer 36 | Lister() cache.GenericLister 37 | } 38 | 39 | type genericInformer struct { 40 | informer cache.SharedIndexInformer 41 | resource schema.GroupResource 42 | } 43 | 44 | // Informer returns the SharedIndexInformer. 45 | func (f *genericInformer) Informer() cache.SharedIndexInformer { 46 | return f.informer 47 | } 48 | 49 | // Lister returns the GenericLister. 50 | func (f *genericInformer) Lister() cache.GenericLister { 51 | return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource) 52 | } 53 | 54 | // ForResource gives generic access to a shared informer of the matching type 55 | // TODO extend this to unknown resources with a client pool 56 | func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { 57 | switch resource { 58 | // Group=authentication.istio.io, Version=v1alpha1 59 | case v1alpha1.SchemeGroupVersion.WithResource("meshpolicies"): 60 | return &genericInformer{resource: resource.GroupResource(), informer: f.Authentication().V1alpha1().MeshPolicies().Informer()}, nil 61 | case v1alpha1.SchemeGroupVersion.WithResource("policies"): 62 | return &genericInformer{resource: resource.GroupResource(), informer: f.Authentication().V1alpha1().Policies().Informer()}, nil 63 | 64 | // Group=networking.istio.io, Version=v1alpha3 65 | case v1alpha3.SchemeGroupVersion.WithResource("destinationrules"): 66 | return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1alpha3().DestinationRules().Informer()}, nil 67 | case v1alpha3.SchemeGroupVersion.WithResource("envoyfilters"): 68 | return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1alpha3().EnvoyFilters().Informer()}, nil 69 | case v1alpha3.SchemeGroupVersion.WithResource("gateways"): 70 | return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1alpha3().Gateways().Informer()}, nil 71 | case v1alpha3.SchemeGroupVersion.WithResource("serviceentries"): 72 | return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1alpha3().ServiceEntries().Informer()}, nil 73 | case v1alpha3.SchemeGroupVersion.WithResource("virtualservices"): 74 | return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1alpha3().VirtualServices().Informer()}, nil 75 | 76 | // Group=rbac.istio.io, Version=v1alpha1 77 | case rbacv1alpha1.SchemeGroupVersion.WithResource("rbacconfigs"): 78 | return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1alpha1().RbacConfigs().Informer()}, nil 79 | case rbacv1alpha1.SchemeGroupVersion.WithResource("serviceroles"): 80 | return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1alpha1().ServiceRoles().Informer()}, nil 81 | case rbacv1alpha1.SchemeGroupVersion.WithResource("servicerolebindings"): 82 | return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1alpha1().ServiceRoleBindings().Informer()}, nil 83 | 84 | } 85 | 86 | return nil, fmt.Errorf("no informer found for %v", resource) 87 | } 88 | -------------------------------------------------------------------------------- /cmd/example-client/client.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "log" 5 | "os" 6 | 7 | versionedclient "github.com/aspenmesh/istio-client-go/pkg/client/clientset/versioned" 8 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 9 | "k8s.io/client-go/tools/clientcmd" 10 | ) 11 | 12 | func main() { 13 | kubeconfig := os.Getenv("KUBECONFIG") 14 | namespace := os.Getenv("NAMESPACE") 15 | if len(kubeconfig) == 0 || len(namespace) == 0 { 16 | log.Fatalf("Environment variables KUBECONFIG and NAMESPACE need to be set") 17 | } 18 | restConfig, err := clientcmd.BuildConfigFromFlags("", kubeconfig) 19 | if err != nil { 20 | log.Fatalf("Failed to create k8s rest client: %s", err) 21 | } 22 | 23 | ic, err := versionedclient.NewForConfig(restConfig) 24 | if err != nil { 25 | log.Fatalf("Failed to create istio client: %s", err) 26 | } 27 | // Test VirtualServices 28 | vsList, err := ic.NetworkingV1alpha3().VirtualServices(namespace).List(metav1.ListOptions{}) 29 | if err != nil { 30 | log.Fatalf("Failed to get VirtualService in %s namespace: %s", namespace, err) 31 | } 32 | for i := range vsList.Items { 33 | vs := vsList.Items[i] 34 | log.Printf("Index: %d VirtualService Hosts: %+v\n", i, vs.Spec.GetHosts()) 35 | } 36 | 37 | // Test DestinationRules 38 | drList, err := ic.NetworkingV1alpha3().DestinationRules(namespace).List(metav1.ListOptions{}) 39 | if err != nil { 40 | log.Fatalf("Failed to get DestinationRule in %s namespace: %s", namespace, err) 41 | } 42 | for i := range drList.Items { 43 | dr := drList.Items[i] 44 | log.Printf("Index: %d DestinationRule Host: %+v\n", i, dr.Spec.GetHost()) 45 | } 46 | 47 | // Test Policies 48 | pList, err := ic.AuthenticationV1alpha1().Policies(namespace).List(metav1.ListOptions{}) 49 | if err != nil { 50 | log.Fatalf("Failed to get Policy in %s namespace: %s", namespace, err) 51 | } 52 | for i := range pList.Items { 53 | p := pList.Items[i] 54 | log.Printf("Index: %d Policy Targets: %+v\n", i, p.Spec.GetTargets()) 55 | } 56 | 57 | // Test MeshPolicies 58 | mpList, err := ic.AuthenticationV1alpha1().MeshPolicies().List(metav1.ListOptions{}) 59 | if err != nil { 60 | log.Fatal("Failed to list MeshPolicies", err) 61 | } 62 | for i := range mpList.Items { 63 | mp := mpList.Items[i] 64 | log.Printf("Index: %d MeshPolicy Name: %+v\n", i, mp.ObjectMeta.Name) 65 | 66 | // Known broken without the custom marshal/unmarshal code 67 | log.Printf("Index %d MeshPolicy Value: %+v\n", i, mp.Spec.Policy.Peers) 68 | _, err := ic.AuthenticationV1alpha1().MeshPolicies().Get(mp.ObjectMeta.Name, metav1.GetOptions{}) 69 | if err != nil { 70 | log.Fatalf("Failed to get MeshPolicy named %s", mp.ObjectMeta.Name) 71 | } 72 | } 73 | 74 | // Test Gateway 75 | gwList, err := ic.NetworkingV1alpha3().Gateways(namespace).List(metav1.ListOptions{}) 76 | if err != nil { 77 | log.Fatalf("Failed to get Gateway in %s namespace: %s", namespace, err) 78 | } 79 | for i := range gwList.Items { 80 | gw := gwList.Items[i] 81 | for _, s := range gw.Spec.GetServers() { 82 | log.Printf("Index: %d Gateway servers: %+v\n", i, s) 83 | } 84 | } 85 | 86 | // Test ServiceEntry 87 | seList, err := ic.NetworkingV1alpha3().ServiceEntries(namespace).List(metav1.ListOptions{}) 88 | if err != nil { 89 | log.Fatalf("Failed to get ServiceEntry in %s namespace: %s", namespace, err) 90 | } 91 | for i := range seList.Items { 92 | se := seList.Items[i] 93 | for _, h := range se.Spec.GetHosts() { 94 | log.Printf("Index: %d ServiceEntry hosts: %+v\n", i, h) 95 | } 96 | } 97 | // Test ServiceRoles 98 | srList, err := ic.RbacV1alpha1().ServiceRoles(namespace).List(metav1.ListOptions{}) 99 | if err != nil { 100 | log.Fatalf("Failed to get ServiceRole in %s namespace: %s", namespace, err) 101 | 102 | } 103 | 104 | for i := range srList.Items { 105 | sr := srList.Items[i] 106 | log.Printf("Index: %d ServiceRole Name: %+v\n", i, sr.Name) 107 | 108 | for _, h := range sr.Spec.GetRules() { 109 | log.Printf("Index: %d ServiceRole Rules: %+v\n", i, h) 110 | } 111 | } 112 | // Test ServiceRoleBinding 113 | srbList, err := ic.RbacV1alpha1().ServiceRoleBindings(namespace).List(metav1.ListOptions{}) 114 | if err != nil { 115 | log.Fatalf("Failed to get ServiceRoleBinding in %s namespace: %s", namespace, err) 116 | 117 | } 118 | for i := range srbList.Items { 119 | srb := srbList.Items[i] 120 | log.Printf("ServiceRoleBindings Name: %+v\nServiceRoleReference: %+v\n", srb.Name, srb.Spec.GetRoleRef()) 121 | 122 | } 123 | 124 | } 125 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/clientset.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by client-gen. DO NOT EDIT. 19 | 20 | package versioned 21 | 22 | import ( 23 | "fmt" 24 | 25 | authenticationv1alpha1 "github.com/aspenmesh/istio-client-go/pkg/client/clientset/versioned/typed/authentication/v1alpha1" 26 | networkingv1alpha3 "github.com/aspenmesh/istio-client-go/pkg/client/clientset/versioned/typed/networking/v1alpha3" 27 | rbacv1alpha1 "github.com/aspenmesh/istio-client-go/pkg/client/clientset/versioned/typed/rbac/v1alpha1" 28 | discovery "k8s.io/client-go/discovery" 29 | rest "k8s.io/client-go/rest" 30 | flowcontrol "k8s.io/client-go/util/flowcontrol" 31 | ) 32 | 33 | type Interface interface { 34 | Discovery() discovery.DiscoveryInterface 35 | AuthenticationV1alpha1() authenticationv1alpha1.AuthenticationV1alpha1Interface 36 | NetworkingV1alpha3() networkingv1alpha3.NetworkingV1alpha3Interface 37 | RbacV1alpha1() rbacv1alpha1.RbacV1alpha1Interface 38 | } 39 | 40 | // Clientset contains the clients for groups. Each group has exactly one 41 | // version included in a Clientset. 42 | type Clientset struct { 43 | *discovery.DiscoveryClient 44 | authenticationV1alpha1 *authenticationv1alpha1.AuthenticationV1alpha1Client 45 | networkingV1alpha3 *networkingv1alpha3.NetworkingV1alpha3Client 46 | rbacV1alpha1 *rbacv1alpha1.RbacV1alpha1Client 47 | } 48 | 49 | // AuthenticationV1alpha1 retrieves the AuthenticationV1alpha1Client 50 | func (c *Clientset) AuthenticationV1alpha1() authenticationv1alpha1.AuthenticationV1alpha1Interface { 51 | return c.authenticationV1alpha1 52 | } 53 | 54 | // NetworkingV1alpha3 retrieves the NetworkingV1alpha3Client 55 | func (c *Clientset) NetworkingV1alpha3() networkingv1alpha3.NetworkingV1alpha3Interface { 56 | return c.networkingV1alpha3 57 | } 58 | 59 | // RbacV1alpha1 retrieves the RbacV1alpha1Client 60 | func (c *Clientset) RbacV1alpha1() rbacv1alpha1.RbacV1alpha1Interface { 61 | return c.rbacV1alpha1 62 | } 63 | 64 | // Discovery retrieves the DiscoveryClient 65 | func (c *Clientset) Discovery() discovery.DiscoveryInterface { 66 | if c == nil { 67 | return nil 68 | } 69 | return c.DiscoveryClient 70 | } 71 | 72 | // NewForConfig creates a new Clientset for the given config. 73 | // If config's RateLimiter is not set and QPS and Burst are acceptable, 74 | // NewForConfig will generate a rate-limiter in configShallowCopy. 75 | func NewForConfig(c *rest.Config) (*Clientset, error) { 76 | configShallowCopy := *c 77 | if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { 78 | if configShallowCopy.Burst <= 0 { 79 | 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") 80 | } 81 | configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) 82 | } 83 | var cs Clientset 84 | var err error 85 | cs.authenticationV1alpha1, err = authenticationv1alpha1.NewForConfig(&configShallowCopy) 86 | if err != nil { 87 | return nil, err 88 | } 89 | cs.networkingV1alpha3, err = networkingv1alpha3.NewForConfig(&configShallowCopy) 90 | if err != nil { 91 | return nil, err 92 | } 93 | cs.rbacV1alpha1, err = rbacv1alpha1.NewForConfig(&configShallowCopy) 94 | if err != nil { 95 | return nil, err 96 | } 97 | 98 | cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) 99 | if err != nil { 100 | return nil, err 101 | } 102 | return &cs, nil 103 | } 104 | 105 | // NewForConfigOrDie creates a new Clientset for the given config and 106 | // panics if there is an error in the config. 107 | func NewForConfigOrDie(c *rest.Config) *Clientset { 108 | var cs Clientset 109 | cs.authenticationV1alpha1 = authenticationv1alpha1.NewForConfigOrDie(c) 110 | cs.networkingV1alpha3 = networkingv1alpha3.NewForConfigOrDie(c) 111 | cs.rbacV1alpha1 = rbacv1alpha1.NewForConfigOrDie(c) 112 | 113 | cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) 114 | return &cs 115 | } 116 | 117 | // New creates a new Clientset for the given RESTClient. 118 | func New(c rest.Interface) *Clientset { 119 | var cs Clientset 120 | cs.authenticationV1alpha1 = authenticationv1alpha1.New(c) 121 | cs.networkingV1alpha3 = networkingv1alpha3.New(c) 122 | cs.rbacV1alpha1 = rbacv1alpha1.New(c) 123 | 124 | cs.DiscoveryClient = discovery.NewDiscoveryClient(c) 125 | return &cs 126 | } 127 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/authentication/v1alpha1/fake/fake_policy.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by client-gen. DO NOT EDIT. 19 | 20 | package fake 21 | 22 | import ( 23 | v1alpha1 "github.com/aspenmesh/istio-client-go/pkg/apis/authentication/v1alpha1" 24 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 25 | labels "k8s.io/apimachinery/pkg/labels" 26 | schema "k8s.io/apimachinery/pkg/runtime/schema" 27 | types "k8s.io/apimachinery/pkg/types" 28 | watch "k8s.io/apimachinery/pkg/watch" 29 | testing "k8s.io/client-go/testing" 30 | ) 31 | 32 | // FakePolicies implements PolicyInterface 33 | type FakePolicies struct { 34 | Fake *FakeAuthenticationV1alpha1 35 | ns string 36 | } 37 | 38 | var policiesResource = schema.GroupVersionResource{Group: "authentication.istio.io", Version: "v1alpha1", Resource: "policies"} 39 | 40 | var policiesKind = schema.GroupVersionKind{Group: "authentication.istio.io", Version: "v1alpha1", Kind: "Policy"} 41 | 42 | // Get takes name of the policy, and returns the corresponding policy object, and an error if there is any. 43 | func (c *FakePolicies) Get(name string, options v1.GetOptions) (result *v1alpha1.Policy, err error) { 44 | obj, err := c.Fake. 45 | Invokes(testing.NewGetAction(policiesResource, c.ns, name), &v1alpha1.Policy{}) 46 | 47 | if obj == nil { 48 | return nil, err 49 | } 50 | return obj.(*v1alpha1.Policy), err 51 | } 52 | 53 | // List takes label and field selectors, and returns the list of Policies that match those selectors. 54 | func (c *FakePolicies) List(opts v1.ListOptions) (result *v1alpha1.PolicyList, err error) { 55 | obj, err := c.Fake. 56 | Invokes(testing.NewListAction(policiesResource, policiesKind, c.ns, opts), &v1alpha1.PolicyList{}) 57 | 58 | if obj == nil { 59 | return nil, err 60 | } 61 | 62 | label, _, _ := testing.ExtractFromListOptions(opts) 63 | if label == nil { 64 | label = labels.Everything() 65 | } 66 | list := &v1alpha1.PolicyList{ListMeta: obj.(*v1alpha1.PolicyList).ListMeta} 67 | for _, item := range obj.(*v1alpha1.PolicyList).Items { 68 | if label.Matches(labels.Set(item.Labels)) { 69 | list.Items = append(list.Items, item) 70 | } 71 | } 72 | return list, err 73 | } 74 | 75 | // Watch returns a watch.Interface that watches the requested policies. 76 | func (c *FakePolicies) Watch(opts v1.ListOptions) (watch.Interface, error) { 77 | return c.Fake. 78 | InvokesWatch(testing.NewWatchAction(policiesResource, c.ns, opts)) 79 | 80 | } 81 | 82 | // Create takes the representation of a policy and creates it. Returns the server's representation of the policy, and an error, if there is any. 83 | func (c *FakePolicies) Create(policy *v1alpha1.Policy) (result *v1alpha1.Policy, err error) { 84 | obj, err := c.Fake. 85 | Invokes(testing.NewCreateAction(policiesResource, c.ns, policy), &v1alpha1.Policy{}) 86 | 87 | if obj == nil { 88 | return nil, err 89 | } 90 | return obj.(*v1alpha1.Policy), err 91 | } 92 | 93 | // Update takes the representation of a policy and updates it. Returns the server's representation of the policy, and an error, if there is any. 94 | func (c *FakePolicies) Update(policy *v1alpha1.Policy) (result *v1alpha1.Policy, err error) { 95 | obj, err := c.Fake. 96 | Invokes(testing.NewUpdateAction(policiesResource, c.ns, policy), &v1alpha1.Policy{}) 97 | 98 | if obj == nil { 99 | return nil, err 100 | } 101 | return obj.(*v1alpha1.Policy), err 102 | } 103 | 104 | // Delete takes name of the policy and deletes it. Returns an error if one occurs. 105 | func (c *FakePolicies) Delete(name string, options *v1.DeleteOptions) error { 106 | _, err := c.Fake. 107 | Invokes(testing.NewDeleteAction(policiesResource, c.ns, name), &v1alpha1.Policy{}) 108 | 109 | return err 110 | } 111 | 112 | // DeleteCollection deletes a collection of objects. 113 | func (c *FakePolicies) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { 114 | action := testing.NewDeleteCollectionAction(policiesResource, c.ns, listOptions) 115 | 116 | _, err := c.Fake.Invokes(action, &v1alpha1.PolicyList{}) 117 | return err 118 | } 119 | 120 | // Patch applies the patch and returns the patched policy. 121 | func (c *FakePolicies) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Policy, err error) { 122 | obj, err := c.Fake. 123 | Invokes(testing.NewPatchSubresourceAction(policiesResource, c.ns, name, pt, data, subresources...), &v1alpha1.Policy{}) 124 | 125 | if obj == nil { 126 | return nil, err 127 | } 128 | return obj.(*v1alpha1.Policy), err 129 | } 130 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/networking/v1alpha3/fake/fake_gateway.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by client-gen. DO NOT EDIT. 19 | 20 | package fake 21 | 22 | import ( 23 | v1alpha3 "github.com/aspenmesh/istio-client-go/pkg/apis/networking/v1alpha3" 24 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 25 | labels "k8s.io/apimachinery/pkg/labels" 26 | schema "k8s.io/apimachinery/pkg/runtime/schema" 27 | types "k8s.io/apimachinery/pkg/types" 28 | watch "k8s.io/apimachinery/pkg/watch" 29 | testing "k8s.io/client-go/testing" 30 | ) 31 | 32 | // FakeGateways implements GatewayInterface 33 | type FakeGateways struct { 34 | Fake *FakeNetworkingV1alpha3 35 | ns string 36 | } 37 | 38 | var gatewaysResource = schema.GroupVersionResource{Group: "networking.istio.io", Version: "v1alpha3", Resource: "gateways"} 39 | 40 | var gatewaysKind = schema.GroupVersionKind{Group: "networking.istio.io", Version: "v1alpha3", Kind: "Gateway"} 41 | 42 | // Get takes name of the gateway, and returns the corresponding gateway object, and an error if there is any. 43 | func (c *FakeGateways) Get(name string, options v1.GetOptions) (result *v1alpha3.Gateway, err error) { 44 | obj, err := c.Fake. 45 | Invokes(testing.NewGetAction(gatewaysResource, c.ns, name), &v1alpha3.Gateway{}) 46 | 47 | if obj == nil { 48 | return nil, err 49 | } 50 | return obj.(*v1alpha3.Gateway), err 51 | } 52 | 53 | // List takes label and field selectors, and returns the list of Gateways that match those selectors. 54 | func (c *FakeGateways) List(opts v1.ListOptions) (result *v1alpha3.GatewayList, err error) { 55 | obj, err := c.Fake. 56 | Invokes(testing.NewListAction(gatewaysResource, gatewaysKind, c.ns, opts), &v1alpha3.GatewayList{}) 57 | 58 | if obj == nil { 59 | return nil, err 60 | } 61 | 62 | label, _, _ := testing.ExtractFromListOptions(opts) 63 | if label == nil { 64 | label = labels.Everything() 65 | } 66 | list := &v1alpha3.GatewayList{ListMeta: obj.(*v1alpha3.GatewayList).ListMeta} 67 | for _, item := range obj.(*v1alpha3.GatewayList).Items { 68 | if label.Matches(labels.Set(item.Labels)) { 69 | list.Items = append(list.Items, item) 70 | } 71 | } 72 | return list, err 73 | } 74 | 75 | // Watch returns a watch.Interface that watches the requested gateways. 76 | func (c *FakeGateways) Watch(opts v1.ListOptions) (watch.Interface, error) { 77 | return c.Fake. 78 | InvokesWatch(testing.NewWatchAction(gatewaysResource, c.ns, opts)) 79 | 80 | } 81 | 82 | // Create takes the representation of a gateway and creates it. Returns the server's representation of the gateway, and an error, if there is any. 83 | func (c *FakeGateways) Create(gateway *v1alpha3.Gateway) (result *v1alpha3.Gateway, err error) { 84 | obj, err := c.Fake. 85 | Invokes(testing.NewCreateAction(gatewaysResource, c.ns, gateway), &v1alpha3.Gateway{}) 86 | 87 | if obj == nil { 88 | return nil, err 89 | } 90 | return obj.(*v1alpha3.Gateway), err 91 | } 92 | 93 | // Update takes the representation of a gateway and updates it. Returns the server's representation of the gateway, and an error, if there is any. 94 | func (c *FakeGateways) Update(gateway *v1alpha3.Gateway) (result *v1alpha3.Gateway, err error) { 95 | obj, err := c.Fake. 96 | Invokes(testing.NewUpdateAction(gatewaysResource, c.ns, gateway), &v1alpha3.Gateway{}) 97 | 98 | if obj == nil { 99 | return nil, err 100 | } 101 | return obj.(*v1alpha3.Gateway), err 102 | } 103 | 104 | // Delete takes name of the gateway and deletes it. Returns an error if one occurs. 105 | func (c *FakeGateways) Delete(name string, options *v1.DeleteOptions) error { 106 | _, err := c.Fake. 107 | Invokes(testing.NewDeleteAction(gatewaysResource, c.ns, name), &v1alpha3.Gateway{}) 108 | 109 | return err 110 | } 111 | 112 | // DeleteCollection deletes a collection of objects. 113 | func (c *FakeGateways) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { 114 | action := testing.NewDeleteCollectionAction(gatewaysResource, c.ns, listOptions) 115 | 116 | _, err := c.Fake.Invokes(action, &v1alpha3.GatewayList{}) 117 | return err 118 | } 119 | 120 | // Patch applies the patch and returns the patched gateway. 121 | func (c *FakeGateways) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha3.Gateway, err error) { 122 | obj, err := c.Fake. 123 | Invokes(testing.NewPatchSubresourceAction(gatewaysResource, c.ns, name, pt, data, subresources...), &v1alpha3.Gateway{}) 124 | 125 | if obj == nil { 126 | return nil, err 127 | } 128 | return obj.(*v1alpha3.Gateway), err 129 | } 130 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/authentication/v1alpha1/fake/fake_meshpolicy.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by client-gen. DO NOT EDIT. 19 | 20 | package fake 21 | 22 | import ( 23 | v1alpha1 "github.com/aspenmesh/istio-client-go/pkg/apis/authentication/v1alpha1" 24 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 25 | labels "k8s.io/apimachinery/pkg/labels" 26 | schema "k8s.io/apimachinery/pkg/runtime/schema" 27 | types "k8s.io/apimachinery/pkg/types" 28 | watch "k8s.io/apimachinery/pkg/watch" 29 | testing "k8s.io/client-go/testing" 30 | ) 31 | 32 | // FakeMeshPolicies implements MeshPolicyInterface 33 | type FakeMeshPolicies struct { 34 | Fake *FakeAuthenticationV1alpha1 35 | } 36 | 37 | var meshpoliciesResource = schema.GroupVersionResource{Group: "authentication.istio.io", Version: "v1alpha1", Resource: "meshpolicies"} 38 | 39 | var meshpoliciesKind = schema.GroupVersionKind{Group: "authentication.istio.io", Version: "v1alpha1", Kind: "MeshPolicy"} 40 | 41 | // Get takes name of the meshPolicy, and returns the corresponding meshPolicy object, and an error if there is any. 42 | func (c *FakeMeshPolicies) Get(name string, options v1.GetOptions) (result *v1alpha1.MeshPolicy, err error) { 43 | obj, err := c.Fake. 44 | Invokes(testing.NewRootGetAction(meshpoliciesResource, name), &v1alpha1.MeshPolicy{}) 45 | if obj == nil { 46 | return nil, err 47 | } 48 | return obj.(*v1alpha1.MeshPolicy), err 49 | } 50 | 51 | // List takes label and field selectors, and returns the list of MeshPolicies that match those selectors. 52 | func (c *FakeMeshPolicies) List(opts v1.ListOptions) (result *v1alpha1.MeshPolicyList, err error) { 53 | obj, err := c.Fake. 54 | Invokes(testing.NewRootListAction(meshpoliciesResource, meshpoliciesKind, opts), &v1alpha1.MeshPolicyList{}) 55 | if obj == nil { 56 | return nil, err 57 | } 58 | 59 | label, _, _ := testing.ExtractFromListOptions(opts) 60 | if label == nil { 61 | label = labels.Everything() 62 | } 63 | list := &v1alpha1.MeshPolicyList{ListMeta: obj.(*v1alpha1.MeshPolicyList).ListMeta} 64 | for _, item := range obj.(*v1alpha1.MeshPolicyList).Items { 65 | if label.Matches(labels.Set(item.Labels)) { 66 | list.Items = append(list.Items, item) 67 | } 68 | } 69 | return list, err 70 | } 71 | 72 | // Watch returns a watch.Interface that watches the requested meshPolicies. 73 | func (c *FakeMeshPolicies) Watch(opts v1.ListOptions) (watch.Interface, error) { 74 | return c.Fake. 75 | InvokesWatch(testing.NewRootWatchAction(meshpoliciesResource, opts)) 76 | } 77 | 78 | // Create takes the representation of a meshPolicy and creates it. Returns the server's representation of the meshPolicy, and an error, if there is any. 79 | func (c *FakeMeshPolicies) Create(meshPolicy *v1alpha1.MeshPolicy) (result *v1alpha1.MeshPolicy, err error) { 80 | obj, err := c.Fake. 81 | Invokes(testing.NewRootCreateAction(meshpoliciesResource, meshPolicy), &v1alpha1.MeshPolicy{}) 82 | if obj == nil { 83 | return nil, err 84 | } 85 | return obj.(*v1alpha1.MeshPolicy), err 86 | } 87 | 88 | // Update takes the representation of a meshPolicy and updates it. Returns the server's representation of the meshPolicy, and an error, if there is any. 89 | func (c *FakeMeshPolicies) Update(meshPolicy *v1alpha1.MeshPolicy) (result *v1alpha1.MeshPolicy, err error) { 90 | obj, err := c.Fake. 91 | Invokes(testing.NewRootUpdateAction(meshpoliciesResource, meshPolicy), &v1alpha1.MeshPolicy{}) 92 | if obj == nil { 93 | return nil, err 94 | } 95 | return obj.(*v1alpha1.MeshPolicy), err 96 | } 97 | 98 | // Delete takes name of the meshPolicy and deletes it. Returns an error if one occurs. 99 | func (c *FakeMeshPolicies) Delete(name string, options *v1.DeleteOptions) error { 100 | _, err := c.Fake. 101 | Invokes(testing.NewRootDeleteAction(meshpoliciesResource, name), &v1alpha1.MeshPolicy{}) 102 | return err 103 | } 104 | 105 | // DeleteCollection deletes a collection of objects. 106 | func (c *FakeMeshPolicies) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { 107 | action := testing.NewRootDeleteCollectionAction(meshpoliciesResource, listOptions) 108 | 109 | _, err := c.Fake.Invokes(action, &v1alpha1.MeshPolicyList{}) 110 | return err 111 | } 112 | 113 | // Patch applies the patch and returns the patched meshPolicy. 114 | func (c *FakeMeshPolicies) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MeshPolicy, err error) { 115 | obj, err := c.Fake. 116 | Invokes(testing.NewRootPatchSubresourceAction(meshpoliciesResource, name, pt, data, subresources...), &v1alpha1.MeshPolicy{}) 117 | if obj == nil { 118 | return nil, err 119 | } 120 | return obj.(*v1alpha1.MeshPolicy), err 121 | } 122 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/rbac/v1alpha1/fake/fake_rbacconfig.go: -------------------------------------------------------------------------------- 1 | /* 2 | Portions Copyright 2020 The Kubernetes Authors. 3 | Portions Copyright 2020 Aspen Mesh Authors. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | 18 | // Code generated by client-gen. DO NOT EDIT. 19 | 20 | package fake 21 | 22 | import ( 23 | v1alpha1 "github.com/aspenmesh/istio-client-go/pkg/apis/rbac/v1alpha1" 24 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 25 | labels "k8s.io/apimachinery/pkg/labels" 26 | schema "k8s.io/apimachinery/pkg/runtime/schema" 27 | types "k8s.io/apimachinery/pkg/types" 28 | watch "k8s.io/apimachinery/pkg/watch" 29 | testing "k8s.io/client-go/testing" 30 | ) 31 | 32 | // FakeRbacConfigs implements RbacConfigInterface 33 | type FakeRbacConfigs struct { 34 | Fake *FakeRbacV1alpha1 35 | ns string 36 | } 37 | 38 | var rbacconfigsResource = schema.GroupVersionResource{Group: "rbac.istio.io", Version: "v1alpha1", Resource: "rbacconfigs"} 39 | 40 | var rbacconfigsKind = schema.GroupVersionKind{Group: "rbac.istio.io", Version: "v1alpha1", Kind: "RbacConfig"} 41 | 42 | // Get takes name of the rbacConfig, and returns the corresponding rbacConfig object, and an error if there is any. 43 | func (c *FakeRbacConfigs) Get(name string, options v1.GetOptions) (result *v1alpha1.RbacConfig, err error) { 44 | obj, err := c.Fake. 45 | Invokes(testing.NewGetAction(rbacconfigsResource, c.ns, name), &v1alpha1.RbacConfig{}) 46 | 47 | if obj == nil { 48 | return nil, err 49 | } 50 | return obj.(*v1alpha1.RbacConfig), err 51 | } 52 | 53 | // List takes label and field selectors, and returns the list of RbacConfigs that match those selectors. 54 | func (c *FakeRbacConfigs) List(opts v1.ListOptions) (result *v1alpha1.RbacConfigList, err error) { 55 | obj, err := c.Fake. 56 | Invokes(testing.NewListAction(rbacconfigsResource, rbacconfigsKind, c.ns, opts), &v1alpha1.RbacConfigList{}) 57 | 58 | if obj == nil { 59 | return nil, err 60 | } 61 | 62 | label, _, _ := testing.ExtractFromListOptions(opts) 63 | if label == nil { 64 | label = labels.Everything() 65 | } 66 | list := &v1alpha1.RbacConfigList{ListMeta: obj.(*v1alpha1.RbacConfigList).ListMeta} 67 | for _, item := range obj.(*v1alpha1.RbacConfigList).Items { 68 | if label.Matches(labels.Set(item.Labels)) { 69 | list.Items = append(list.Items, item) 70 | } 71 | } 72 | return list, err 73 | } 74 | 75 | // Watch returns a watch.Interface that watches the requested rbacConfigs. 76 | func (c *FakeRbacConfigs) Watch(opts v1.ListOptions) (watch.Interface, error) { 77 | return c.Fake. 78 | InvokesWatch(testing.NewWatchAction(rbacconfigsResource, c.ns, opts)) 79 | 80 | } 81 | 82 | // Create takes the representation of a rbacConfig and creates it. Returns the server's representation of the rbacConfig, and an error, if there is any. 83 | func (c *FakeRbacConfigs) Create(rbacConfig *v1alpha1.RbacConfig) (result *v1alpha1.RbacConfig, err error) { 84 | obj, err := c.Fake. 85 | Invokes(testing.NewCreateAction(rbacconfigsResource, c.ns, rbacConfig), &v1alpha1.RbacConfig{}) 86 | 87 | if obj == nil { 88 | return nil, err 89 | } 90 | return obj.(*v1alpha1.RbacConfig), err 91 | } 92 | 93 | // Update takes the representation of a rbacConfig and updates it. Returns the server's representation of the rbacConfig, and an error, if there is any. 94 | func (c *FakeRbacConfigs) Update(rbacConfig *v1alpha1.RbacConfig) (result *v1alpha1.RbacConfig, err error) { 95 | obj, err := c.Fake. 96 | Invokes(testing.NewUpdateAction(rbacconfigsResource, c.ns, rbacConfig), &v1alpha1.RbacConfig{}) 97 | 98 | if obj == nil { 99 | return nil, err 100 | } 101 | return obj.(*v1alpha1.RbacConfig), err 102 | } 103 | 104 | // Delete takes name of the rbacConfig and deletes it. Returns an error if one occurs. 105 | func (c *FakeRbacConfigs) Delete(name string, options *v1.DeleteOptions) error { 106 | _, err := c.Fake. 107 | Invokes(testing.NewDeleteAction(rbacconfigsResource, c.ns, name), &v1alpha1.RbacConfig{}) 108 | 109 | return err 110 | } 111 | 112 | // DeleteCollection deletes a collection of objects. 113 | func (c *FakeRbacConfigs) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { 114 | action := testing.NewDeleteCollectionAction(rbacconfigsResource, c.ns, listOptions) 115 | 116 | _, err := c.Fake.Invokes(action, &v1alpha1.RbacConfigList{}) 117 | return err 118 | } 119 | 120 | // Patch applies the patch and returns the patched rbacConfig. 121 | func (c *FakeRbacConfigs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.RbacConfig, err error) { 122 | obj, err := c.Fake. 123 | Invokes(testing.NewPatchSubresourceAction(rbacconfigsResource, c.ns, name, pt, data, subresources...), &v1alpha1.RbacConfig{}) 124 | 125 | if obj == nil { 126 | return nil, err 127 | } 128 | return obj.(*v1alpha1.RbacConfig), err 129 | } 130 | -------------------------------------------------------------------------------- /pkg/apis/authentication/v1alpha1/zz_generated.deepcopy.go: -------------------------------------------------------------------------------- 1 | // +build !ignore_autogenerated 2 | 3 | /* 4 | Portions Copyright 2020 The Kubernetes Authors. 5 | Portions Copyright 2020 Aspen Mesh Authors. 6 | 7 | Licensed under the Apache License, Version 2.0 (the "License"); 8 | you may not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | */ 19 | 20 | // Code generated by deepcopy-gen. DO NOT EDIT. 21 | 22 | package v1alpha1 23 | 24 | import ( 25 | runtime "k8s.io/apimachinery/pkg/runtime" 26 | ) 27 | 28 | // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. 29 | func (in *MeshPolicy) DeepCopyInto(out *MeshPolicy) { 30 | *out = *in 31 | out.TypeMeta = in.TypeMeta 32 | in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) 33 | in.Spec.DeepCopyInto(&out.Spec) 34 | return 35 | } 36 | 37 | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MeshPolicy. 38 | func (in *MeshPolicy) DeepCopy() *MeshPolicy { 39 | if in == nil { 40 | return nil 41 | } 42 | out := new(MeshPolicy) 43 | in.DeepCopyInto(out) 44 | return out 45 | } 46 | 47 | // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. 48 | func (in *MeshPolicy) DeepCopyObject() runtime.Object { 49 | if c := in.DeepCopy(); c != nil { 50 | return c 51 | } 52 | return nil 53 | } 54 | 55 | // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. 56 | func (in *MeshPolicyList) DeepCopyInto(out *MeshPolicyList) { 57 | *out = *in 58 | out.TypeMeta = in.TypeMeta 59 | in.ListMeta.DeepCopyInto(&out.ListMeta) 60 | if in.Items != nil { 61 | in, out := &in.Items, &out.Items 62 | *out = make([]MeshPolicy, len(*in)) 63 | for i := range *in { 64 | (*in)[i].DeepCopyInto(&(*out)[i]) 65 | } 66 | } 67 | return 68 | } 69 | 70 | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MeshPolicyList. 71 | func (in *MeshPolicyList) DeepCopy() *MeshPolicyList { 72 | if in == nil { 73 | return nil 74 | } 75 | out := new(MeshPolicyList) 76 | in.DeepCopyInto(out) 77 | return out 78 | } 79 | 80 | // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. 81 | func (in *MeshPolicyList) DeepCopyObject() runtime.Object { 82 | if c := in.DeepCopy(); c != nil { 83 | return c 84 | } 85 | return nil 86 | } 87 | 88 | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MeshPolicySpec. 89 | func (in *MeshPolicySpec) DeepCopy() *MeshPolicySpec { 90 | if in == nil { 91 | return nil 92 | } 93 | out := new(MeshPolicySpec) 94 | in.DeepCopyInto(out) 95 | return out 96 | } 97 | 98 | // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. 99 | func (in *Policy) DeepCopyInto(out *Policy) { 100 | *out = *in 101 | out.TypeMeta = in.TypeMeta 102 | in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) 103 | in.Spec.DeepCopyInto(&out.Spec) 104 | return 105 | } 106 | 107 | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Policy. 108 | func (in *Policy) DeepCopy() *Policy { 109 | if in == nil { 110 | return nil 111 | } 112 | out := new(Policy) 113 | in.DeepCopyInto(out) 114 | return out 115 | } 116 | 117 | // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. 118 | func (in *Policy) DeepCopyObject() runtime.Object { 119 | if c := in.DeepCopy(); c != nil { 120 | return c 121 | } 122 | return nil 123 | } 124 | 125 | // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. 126 | func (in *PolicyList) DeepCopyInto(out *PolicyList) { 127 | *out = *in 128 | out.TypeMeta = in.TypeMeta 129 | in.ListMeta.DeepCopyInto(&out.ListMeta) 130 | if in.Items != nil { 131 | in, out := &in.Items, &out.Items 132 | *out = make([]Policy, len(*in)) 133 | for i := range *in { 134 | (*in)[i].DeepCopyInto(&(*out)[i]) 135 | } 136 | } 137 | return 138 | } 139 | 140 | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyList. 141 | func (in *PolicyList) DeepCopy() *PolicyList { 142 | if in == nil { 143 | return nil 144 | } 145 | out := new(PolicyList) 146 | in.DeepCopyInto(out) 147 | return out 148 | } 149 | 150 | // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. 151 | func (in *PolicyList) DeepCopyObject() runtime.Object { 152 | if c := in.DeepCopy(); c != nil { 153 | return c 154 | } 155 | return nil 156 | } 157 | 158 | // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicySpec. 159 | func (in *PolicySpec) DeepCopy() *PolicySpec { 160 | if in == nil { 161 | return nil 162 | } 163 | out := new(PolicySpec) 164 | in.DeepCopyInto(out) 165 | return out 166 | } 167 | --------------------------------------------------------------------------------