├── hack ├── tools.go ├── boilerplate.go.txt └── verify-codegen.sh ├── pkg ├── apis │ ├── access │ │ ├── v1alpha1 │ │ │ ├── doc.go │ │ │ ├── traffic_target_webhook.go │ │ │ └── register.go │ │ ├── v1alpha2 │ │ │ ├── doc.go │ │ │ ├── traffic_target_webhook.go │ │ │ └── register.go │ │ ├── v1alpha3 │ │ │ ├── doc.go │ │ │ ├── traffic_target_convert.go │ │ │ ├── traffic_target_webhook.go │ │ │ └── register.go │ │ └── register.go │ ├── specs │ │ ├── v1alpha1 │ │ │ ├── doc.go │ │ │ ├── tcp_route.go │ │ │ └── register.go │ │ ├── v1alpha2 │ │ │ ├── doc.go │ │ │ ├── tcp_route.go │ │ │ ├── helpers.go │ │ │ └── register.go │ │ ├── v1alpha3 │ │ │ ├── doc.go │ │ │ ├── helpers.go │ │ │ ├── tcp_route.go │ │ │ └── register.go │ │ ├── v1alpha4 │ │ │ ├── doc.go │ │ │ ├── helpers.go │ │ │ ├── tcp_route.go │ │ │ ├── udp_route.go │ │ │ └── register.go │ │ └── register.go │ ├── split │ │ ├── v1alpha1 │ │ │ ├── doc.go │ │ │ ├── traffic_split_webhook.go │ │ │ ├── traffic_split.go │ │ │ └── register.go │ │ ├── v1alpha2 │ │ │ ├── doc.go │ │ │ ├── traffic_split_webhook.go │ │ │ ├── traffic_split.go │ │ │ └── register.go │ │ ├── v1alpha3 │ │ │ ├── doc.go │ │ │ ├── traffic_split_webhook.go │ │ │ ├── register.go │ │ │ └── traffic_split.go │ │ ├── v1alpha4 │ │ │ ├── doc.go │ │ │ ├── traffic_split_convert.go │ │ │ ├── traffic_split_webhook.go │ │ │ ├── register.go │ │ │ └── traffic_split.go │ │ └── register.go │ └── metrics │ │ ├── v1alpha1 │ │ ├── doc.go │ │ ├── version.go │ │ ├── metric_test.go │ │ ├── interval.go │ │ ├── edge.go │ │ ├── kinds.go │ │ ├── metric.go │ │ ├── register.go │ │ ├── list_test.go │ │ ├── list.go │ │ └── resource.go │ │ ├── v1alpha2 │ │ ├── doc.go │ │ ├── version.go │ │ ├── backend.go │ │ ├── metric_test.go │ │ ├── interval.go │ │ ├── edge.go │ │ ├── kinds.go │ │ ├── metric.go │ │ ├── register.go │ │ ├── list_test.go │ │ ├── list.go │ │ └── resource.go │ │ └── register.go └── gen │ └── client │ ├── specs │ ├── clientset │ │ └── versioned │ │ │ ├── doc.go │ │ │ ├── fake │ │ │ ├── doc.go │ │ │ └── register.go │ │ │ ├── typed │ │ │ └── specs │ │ │ │ ├── v1alpha1 │ │ │ │ ├── fake │ │ │ │ │ ├── doc.go │ │ │ │ │ └── fake_specs_client.go │ │ │ │ ├── doc.go │ │ │ │ └── generated_expansion.go │ │ │ │ ├── v1alpha2 │ │ │ │ ├── fake │ │ │ │ │ ├── doc.go │ │ │ │ │ └── fake_specs_client.go │ │ │ │ ├── doc.go │ │ │ │ └── generated_expansion.go │ │ │ │ ├── v1alpha3 │ │ │ │ ├── fake │ │ │ │ │ ├── doc.go │ │ │ │ │ └── fake_specs_client.go │ │ │ │ ├── doc.go │ │ │ │ └── generated_expansion.go │ │ │ │ └── v1alpha4 │ │ │ │ ├── fake │ │ │ │ ├── doc.go │ │ │ │ └── fake_specs_client.go │ │ │ │ ├── doc.go │ │ │ │ └── generated_expansion.go │ │ │ └── scheme │ │ │ └── doc.go │ ├── listers │ │ └── specs │ │ │ ├── v1alpha1 │ │ │ └── expansion_generated.go │ │ │ ├── v1alpha2 │ │ │ └── expansion_generated.go │ │ │ ├── v1alpha3 │ │ │ └── expansion_generated.go │ │ │ └── v1alpha4 │ │ │ └── expansion_generated.go │ └── informers │ │ └── externalversions │ │ ├── internalinterfaces │ │ └── factory_interfaces.go │ │ └── specs │ │ ├── v1alpha1 │ │ └── interface.go │ │ ├── v1alpha2 │ │ └── interface.go │ │ ├── v1alpha3 │ │ └── interface.go │ │ └── v1alpha4 │ │ └── interface.go │ ├── split │ ├── clientset │ │ └── versioned │ │ │ ├── doc.go │ │ │ ├── fake │ │ │ └── doc.go │ │ │ ├── typed │ │ │ └── split │ │ │ │ ├── v1alpha1 │ │ │ │ ├── fake │ │ │ │ │ ├── doc.go │ │ │ │ │ └── fake_split_client.go │ │ │ │ ├── doc.go │ │ │ │ └── generated_expansion.go │ │ │ │ ├── v1alpha2 │ │ │ │ ├── fake │ │ │ │ │ ├── doc.go │ │ │ │ │ └── fake_split_client.go │ │ │ │ ├── doc.go │ │ │ │ └── generated_expansion.go │ │ │ │ ├── v1alpha3 │ │ │ │ ├── fake │ │ │ │ │ ├── doc.go │ │ │ │ │ └── fake_split_client.go │ │ │ │ ├── doc.go │ │ │ │ └── generated_expansion.go │ │ │ │ └── v1alpha4 │ │ │ │ ├── fake │ │ │ │ ├── doc.go │ │ │ │ └── fake_split_client.go │ │ │ │ ├── doc.go │ │ │ │ └── generated_expansion.go │ │ │ └── scheme │ │ │ └── doc.go │ ├── listers │ │ └── split │ │ │ ├── v1alpha1 │ │ │ └── expansion_generated.go │ │ │ ├── v1alpha2 │ │ │ └── expansion_generated.go │ │ │ ├── v1alpha3 │ │ │ └── expansion_generated.go │ │ │ └── v1alpha4 │ │ │ └── expansion_generated.go │ └── informers │ │ └── externalversions │ │ ├── internalinterfaces │ │ └── factory_interfaces.go │ │ └── split │ │ ├── v1alpha1 │ │ └── interface.go │ │ ├── v1alpha2 │ │ └── interface.go │ │ ├── v1alpha3 │ │ └── interface.go │ │ └── v1alpha4 │ │ └── interface.go │ ├── access │ ├── clientset │ │ └── versioned │ │ │ ├── doc.go │ │ │ ├── fake │ │ │ ├── doc.go │ │ │ └── register.go │ │ │ ├── scheme │ │ │ ├── doc.go │ │ │ └── register.go │ │ │ └── typed │ │ │ └── access │ │ │ ├── v1alpha1 │ │ │ ├── fake │ │ │ │ ├── doc.go │ │ │ │ └── fake_access_client.go │ │ │ ├── generated_expansion.go │ │ │ └── doc.go │ │ │ ├── v1alpha2 │ │ │ ├── fake │ │ │ │ ├── doc.go │ │ │ │ └── fake_access_client.go │ │ │ ├── generated_expansion.go │ │ │ └── doc.go │ │ │ └── v1alpha3 │ │ │ ├── fake │ │ │ ├── doc.go │ │ │ └── fake_access_client.go │ │ │ ├── generated_expansion.go │ │ │ └── doc.go │ ├── listers │ │ └── access │ │ │ ├── v1alpha1 │ │ │ └── expansion_generated.go │ │ │ ├── v1alpha2 │ │ │ └── expansion_generated.go │ │ │ └── v1alpha3 │ │ │ └── expansion_generated.go │ └── informers │ │ └── externalversions │ │ ├── internalinterfaces │ │ └── factory_interfaces.go │ │ └── access │ │ ├── v1alpha1 │ │ └── interface.go │ │ ├── v1alpha2 │ │ └── interface.go │ │ └── v1alpha3 │ │ └── interface.go │ └── metrics │ ├── clientset │ └── versioned │ │ ├── doc.go │ │ ├── fake │ │ ├── doc.go │ │ └── register.go │ │ ├── scheme │ │ ├── doc.go │ │ └── register.go │ │ └── typed │ │ └── metrics │ │ ├── v1alpha1 │ │ ├── fake │ │ │ ├── doc.go │ │ │ └── fake_metrics_client.go │ │ ├── doc.go │ │ └── generated_expansion.go │ │ └── v1alpha2 │ │ ├── fake │ │ ├── doc.go │ │ └── fake_metrics_client.go │ │ ├── doc.go │ │ └── generated_expansion.go │ ├── listers │ └── metrics │ │ ├── v1alpha1 │ │ └── expansion_generated.go │ │ └── v1alpha2 │ │ └── expansion_generated.go │ └── informers │ └── externalversions │ ├── internalinterfaces │ └── factory_interfaces.go │ └── metrics │ ├── v1alpha1 │ └── interface.go │ ├── v1alpha2 │ └── interface.go │ └── interface.go ├── Makefile ├── .gitignore ├── go.mod ├── CODEOWNERS ├── .github └── workflows │ ├── ci.yaml │ └── fossa.yml ├── .golangci.yml ├── README.md ├── docs └── release_process.md ├── crds ├── tcproute.yaml └── udproute.yaml └── GOVERNANCE.md /hack/tools.go: -------------------------------------------------------------------------------- 1 | // +build tools 2 | 3 | package hack 4 | 5 | import ( 6 | _ "k8s.io/code-generator" 7 | ) 8 | -------------------------------------------------------------------------------- /pkg/apis/access/v1alpha1/doc.go: -------------------------------------------------------------------------------- 1 | // +k8s:deepcopy-gen=package 2 | // +groupName=access.smi-spec.io 3 | 4 | package v1alpha1 5 | -------------------------------------------------------------------------------- /pkg/apis/access/v1alpha2/doc.go: -------------------------------------------------------------------------------- 1 | // +k8s:deepcopy-gen=package 2 | // +groupName=access.smi-spec.io 3 | 4 | package v1alpha2 5 | -------------------------------------------------------------------------------- /pkg/apis/access/v1alpha3/doc.go: -------------------------------------------------------------------------------- 1 | // +k8s:deepcopy-gen=package 2 | // +groupName=access.smi-spec.io 3 | 4 | package v1alpha3 5 | -------------------------------------------------------------------------------- /pkg/apis/specs/v1alpha1/doc.go: -------------------------------------------------------------------------------- 1 | // +k8s:deepcopy-gen=package 2 | // +groupName=specs.smi-spec.io 3 | 4 | package v1alpha1 5 | -------------------------------------------------------------------------------- /pkg/apis/specs/v1alpha2/doc.go: -------------------------------------------------------------------------------- 1 | // +k8s:deepcopy-gen=package 2 | // +groupName=specs.smi-spec.io 3 | 4 | package v1alpha2 5 | -------------------------------------------------------------------------------- /pkg/apis/specs/v1alpha3/doc.go: -------------------------------------------------------------------------------- 1 | // +k8s:deepcopy-gen=package 2 | // +groupName=specs.smi-spec.io 3 | 4 | package v1alpha3 5 | -------------------------------------------------------------------------------- /pkg/apis/specs/v1alpha4/doc.go: -------------------------------------------------------------------------------- 1 | // +k8s:deepcopy-gen=package 2 | // +groupName=specs.smi-spec.io 3 | 4 | package v1alpha4 5 | -------------------------------------------------------------------------------- /pkg/apis/split/v1alpha1/doc.go: -------------------------------------------------------------------------------- 1 | // +k8s:deepcopy-gen=package 2 | // +groupName=split.smi-spec.io 3 | 4 | package v1alpha1 5 | -------------------------------------------------------------------------------- /pkg/apis/split/v1alpha2/doc.go: -------------------------------------------------------------------------------- 1 | // +k8s:deepcopy-gen=package 2 | // +groupName=split.smi-spec.io 3 | 4 | package v1alpha2 5 | -------------------------------------------------------------------------------- /pkg/apis/split/v1alpha3/doc.go: -------------------------------------------------------------------------------- 1 | // +k8s:deepcopy-gen=package 2 | // +groupName=split.smi-spec.io 3 | 4 | package v1alpha3 5 | -------------------------------------------------------------------------------- /pkg/apis/split/v1alpha4/doc.go: -------------------------------------------------------------------------------- 1 | // +k8s:deepcopy-gen=package 2 | // +groupName=split.smi-spec.io 3 | 4 | package v1alpha4 5 | -------------------------------------------------------------------------------- /pkg/apis/metrics/v1alpha1/doc.go: -------------------------------------------------------------------------------- 1 | // +k8s:deepcopy-gen=package 2 | // +groupName=metrics.smi-spec.io 3 | 4 | package v1alpha1 5 | -------------------------------------------------------------------------------- /pkg/apis/metrics/v1alpha2/doc.go: -------------------------------------------------------------------------------- 1 | // +k8s:deepcopy-gen=package 2 | // +groupName=metrics.smi-spec.io 3 | 4 | package v1alpha2 5 | -------------------------------------------------------------------------------- /pkg/apis/specs/register.go: -------------------------------------------------------------------------------- 1 | package specs 2 | 3 | // GroupName identifies the API Group Name for a TrafficSpec. 4 | const GroupName = "specs.smi-spec.io" 5 | -------------------------------------------------------------------------------- /pkg/apis/split/register.go: -------------------------------------------------------------------------------- 1 | package split 2 | 3 | // GroupName identifies the API Group Name for a TrafficSplit. 4 | const GroupName = "split.smi-spec.io" 5 | -------------------------------------------------------------------------------- /pkg/apis/access/register.go: -------------------------------------------------------------------------------- 1 | package access 2 | 3 | // GroupName identifies the API Group Name for a TrafficSpec. 4 | const GroupName = "access.smi-spec.io" 5 | -------------------------------------------------------------------------------- /pkg/apis/metrics/register.go: -------------------------------------------------------------------------------- 1 | package metrics 2 | 3 | // GroupName identifies the API Group Name for a TrafficSplit. 4 | const GroupName = "metrics.smi-spec.io" 5 | -------------------------------------------------------------------------------- /pkg/apis/metrics/v1alpha1/version.go: -------------------------------------------------------------------------------- 1 | package v1alpha1 2 | 3 | import ( 4 | "path" 5 | ) 6 | 7 | const APIVersion = "metrics.smi-spec.io/v1alpha1" 8 | 9 | func baseURL() string { 10 | return path.Join("/apis", APIVersion) 11 | } 12 | -------------------------------------------------------------------------------- /pkg/apis/metrics/v1alpha2/version.go: -------------------------------------------------------------------------------- 1 | package v1alpha2 2 | 3 | import ( 4 | "path" 5 | ) 6 | 7 | const APIVersion = "metrics.smi-spec.io/v1alpha2" 8 | 9 | func baseURL() string { 10 | return path.Join("/apis", APIVersion) 11 | } 12 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | 2 | .PHONY: bootstrap 3 | bootstrap: 4 | go mod tidy 5 | 6 | .PHONY: test 7 | test: 8 | go test -v ./... 9 | 10 | .PHONY: codegen 11 | codegen: 12 | ./hack/update-codegen.sh 13 | 14 | .PHONY: verify 15 | verify: 16 | ./hack/verify-codegen.sh 17 | -------------------------------------------------------------------------------- /pkg/apis/metrics/v1alpha2/backend.go: -------------------------------------------------------------------------------- 1 | package v1alpha2 2 | 3 | // Backend describes which branch of a traffic split these metrics 4 | // represent. 5 | type Backend struct { 6 | Apex string `json:"apex"` 7 | Name string `json:"name"` 8 | Weight int `json:"weight"` 9 | } 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Test binary, built with `go test -c` 9 | *.test 10 | 11 | # Output of the go coverage tool, specifically when used with LiteIDE 12 | *.out 13 | 14 | vendor 15 | Gopkg.lock 16 | 17 | .vscode 18 | 19 | .DS_Store 20 | .envrc 21 | -------------------------------------------------------------------------------- /pkg/apis/metrics/v1alpha1/metric_test.go: -------------------------------------------------------------------------------- 1 | package v1alpha1 2 | 3 | import ( 4 | "testing" 5 | 6 | assertLib "github.com/stretchr/testify/assert" 7 | ) 8 | 9 | func TestSet(t *testing.T) { 10 | assert := assertLib.New(t) 11 | 12 | m := &Metric{} 13 | val := 10.123456 14 | 15 | m.Set(val) 16 | 17 | assert.Equal("10123m", m.Value.String()) 18 | } 19 | -------------------------------------------------------------------------------- /pkg/apis/metrics/v1alpha2/metric_test.go: -------------------------------------------------------------------------------- 1 | package v1alpha2 2 | 3 | import ( 4 | "testing" 5 | 6 | assertLib "github.com/stretchr/testify/assert" 7 | ) 8 | 9 | func TestSet(t *testing.T) { 10 | assert := assertLib.New(t) 11 | 12 | m := &Metric{} 13 | val := 10.123456 14 | 15 | m.Set(val) 16 | 17 | assert.Equal("10123m", m.Value.String()) 18 | } 19 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/servicemeshinterface/smi-sdk-go 2 | 3 | go 1.14 4 | 5 | require ( 6 | github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 // indirect 7 | github.com/stretchr/testify v1.6.1 8 | k8s.io/api v0.18.8 9 | k8s.io/apimachinery v0.18.8 10 | k8s.io/client-go v0.18.8 11 | k8s.io/code-generator v0.18.8 12 | sigs.k8s.io/controller-runtime v0.6.0 13 | ) 14 | -------------------------------------------------------------------------------- /pkg/apis/access/v1alpha3/traffic_target_convert.go: -------------------------------------------------------------------------------- 1 | package v1alpha3 2 | 3 | /* 4 | Implementing the hub method is pretty easy -- we just have to add an empty 5 | method called `Hub()` to serve as a 6 | [marker](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/conversion?tab=doc#Hub). 7 | We could also just put this inline in our `cronjob_types.go` file. 8 | */ 9 | 10 | // Hub marks this type as a conversion hub. 11 | func (*TrafficTarget) Hub() {} 12 | -------------------------------------------------------------------------------- /pkg/apis/split/v1alpha4/traffic_split_convert.go: -------------------------------------------------------------------------------- 1 | package v1alpha4 2 | 3 | /* 4 | Implementing the hub method is pretty easy -- we just have to add an empty 5 | method called `Hub()` to serve as a 6 | [marker](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/conversion?tab=doc#Hub). 7 | We could also just put this inline in our `cronjob_types.go` file. 8 | */ 9 | 10 | // Hub marks this type as a conversion hub. 11 | func (*TrafficSplit) Hub() {} 12 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Maintainers: @nicholasjackson @grampelberg @adleong @lachie83 @slack @michelleN @stefanprodan 2 | CODEOWNERS @nicholasjackson @grampelberg @adleong @lachie83 @slack @michelleN @stefanprodan 3 | CONTRIBUTING.md @nicholasjackson @grampelberg @adleong @lachie83 @slack @michelleN @stefanprodan 4 | LICENSE @nicholasjackson @grampelberg @adleong @lachie83 @slack @michelleN @stefanprodan 5 | GOVERNANCE.md @nicholasjackson @grampelberg @adleong @lachie83 @slack @michelleN @stefanprodan 6 | # EMERITUS Maintainers: @brendanburns @surajssd 7 | -------------------------------------------------------------------------------- /hack/boilerplate.go.txt: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | -------------------------------------------------------------------------------- /pkg/apis/metrics/v1alpha1/interval.go: -------------------------------------------------------------------------------- 1 | package v1alpha1 2 | 3 | import ( 4 | "fmt" 5 | "time" 6 | 7 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 8 | ) 9 | 10 | var defaultWindow = 30 * time.Second 11 | 12 | // Interval defines the time interval from which metrics were collected 13 | type Interval struct { 14 | Timestamp metav1.Time `json:"timestamp"` 15 | Window metav1.Duration `json:"window"` 16 | } 17 | 18 | func NewInterval() *Interval { 19 | return &Interval{ 20 | Timestamp: metav1.NewTime(time.Now()), 21 | Window: metav1.Duration{Duration: defaultWindow}, 22 | } 23 | } 24 | 25 | // String returns a formatted string representation of this struct 26 | func (i *Interval) String() string { 27 | return fmt.Sprintf("%#v", i) 28 | } 29 | -------------------------------------------------------------------------------- /pkg/apis/metrics/v1alpha2/interval.go: -------------------------------------------------------------------------------- 1 | package v1alpha2 2 | 3 | import ( 4 | "fmt" 5 | "time" 6 | 7 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 8 | ) 9 | 10 | var defaultWindow = 30 * time.Second 11 | 12 | // Interval defines the time interval from which metrics were collected 13 | type Interval struct { 14 | Timestamp metav1.Time `json:"timestamp"` 15 | Window metav1.Duration `json:"window"` 16 | } 17 | 18 | func NewInterval() *Interval { 19 | return &Interval{ 20 | Timestamp: metav1.NewTime(time.Now()), 21 | Window: metav1.Duration{Duration: defaultWindow}, 22 | } 23 | } 24 | 25 | // String returns a formatted string representation of this struct 26 | func (i *Interval) String() string { 27 | return fmt.Sprintf("%#v", i) 28 | } 29 | -------------------------------------------------------------------------------- /pkg/gen/client/specs/clientset/versioned/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // This package has the automatically generated clientset. 18 | package versioned 19 | -------------------------------------------------------------------------------- /pkg/gen/client/split/clientset/versioned/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // This package has the automatically generated clientset. 18 | package versioned 19 | -------------------------------------------------------------------------------- /pkg/gen/client/access/clientset/versioned/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // This package has the automatically generated clientset. 18 | package versioned 19 | -------------------------------------------------------------------------------- /pkg/gen/client/metrics/clientset/versioned/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // This package has the automatically generated clientset. 18 | package versioned 19 | -------------------------------------------------------------------------------- /pkg/gen/client/specs/clientset/versioned/fake/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // This package has the automatically generated fake clientset. 18 | package fake 19 | -------------------------------------------------------------------------------- /pkg/gen/client/split/clientset/versioned/fake/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // This package has the automatically generated fake clientset. 18 | package fake 19 | -------------------------------------------------------------------------------- /pkg/gen/client/access/clientset/versioned/fake/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // This package has the automatically generated fake clientset. 18 | package fake 19 | -------------------------------------------------------------------------------- /pkg/gen/client/metrics/clientset/versioned/fake/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // This package has the automatically generated fake clientset. 18 | package fake 19 | -------------------------------------------------------------------------------- /pkg/gen/client/specs/clientset/versioned/typed/specs/v1alpha1/fake/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // Package fake has the automatically generated clients. 18 | package fake 19 | -------------------------------------------------------------------------------- /pkg/gen/client/specs/clientset/versioned/typed/specs/v1alpha2/fake/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // Package fake has the automatically generated clients. 18 | package fake 19 | -------------------------------------------------------------------------------- /pkg/gen/client/specs/clientset/versioned/typed/specs/v1alpha3/fake/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // Package fake has the automatically generated clients. 18 | package fake 19 | -------------------------------------------------------------------------------- /pkg/gen/client/specs/clientset/versioned/typed/specs/v1alpha4/fake/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // Package fake has the automatically generated clients. 18 | package fake 19 | -------------------------------------------------------------------------------- /pkg/gen/client/split/clientset/versioned/typed/split/v1alpha1/fake/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // Package fake has the automatically generated clients. 18 | package fake 19 | -------------------------------------------------------------------------------- /pkg/gen/client/split/clientset/versioned/typed/split/v1alpha2/fake/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // Package fake has the automatically generated clients. 18 | package fake 19 | -------------------------------------------------------------------------------- /pkg/gen/client/split/clientset/versioned/typed/split/v1alpha3/fake/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // Package fake has the automatically generated clients. 18 | package fake 19 | -------------------------------------------------------------------------------- /pkg/gen/client/split/clientset/versioned/typed/split/v1alpha4/fake/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // Package fake has the automatically generated clients. 18 | package fake 19 | -------------------------------------------------------------------------------- /pkg/gen/client/access/clientset/versioned/scheme/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // This package contains the scheme of the automatically generated clientset. 18 | package scheme 19 | -------------------------------------------------------------------------------- /pkg/gen/client/access/clientset/versioned/typed/access/v1alpha1/fake/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // Package fake has the automatically generated clients. 18 | package fake 19 | -------------------------------------------------------------------------------- /pkg/gen/client/access/clientset/versioned/typed/access/v1alpha1/generated_expansion.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | package v1alpha1 18 | 19 | type TrafficTargetExpansion interface{} 20 | -------------------------------------------------------------------------------- /pkg/gen/client/access/clientset/versioned/typed/access/v1alpha2/fake/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // Package fake has the automatically generated clients. 18 | package fake 19 | -------------------------------------------------------------------------------- /pkg/gen/client/access/clientset/versioned/typed/access/v1alpha2/generated_expansion.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | package v1alpha2 18 | 19 | type TrafficTargetExpansion interface{} 20 | -------------------------------------------------------------------------------- /pkg/gen/client/access/clientset/versioned/typed/access/v1alpha3/fake/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // Package fake has the automatically generated clients. 18 | package fake 19 | -------------------------------------------------------------------------------- /pkg/gen/client/access/clientset/versioned/typed/access/v1alpha3/generated_expansion.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | package v1alpha3 18 | 19 | type TrafficTargetExpansion interface{} 20 | -------------------------------------------------------------------------------- /pkg/gen/client/metrics/clientset/versioned/scheme/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // This package contains the scheme of the automatically generated clientset. 18 | package scheme 19 | -------------------------------------------------------------------------------- /pkg/gen/client/metrics/clientset/versioned/typed/metrics/v1alpha1/fake/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // Package fake has the automatically generated clients. 18 | package fake 19 | -------------------------------------------------------------------------------- /pkg/gen/client/metrics/clientset/versioned/typed/metrics/v1alpha2/fake/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // Package fake has the automatically generated clients. 18 | package fake 19 | -------------------------------------------------------------------------------- /pkg/gen/client/specs/clientset/versioned/scheme/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // This package contains the scheme of the automatically generated clientset. 18 | package scheme 19 | -------------------------------------------------------------------------------- /pkg/gen/client/specs/clientset/versioned/typed/specs/v1alpha1/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // This package has the automatically generated typed clients. 18 | package v1alpha1 19 | -------------------------------------------------------------------------------- /pkg/gen/client/specs/clientset/versioned/typed/specs/v1alpha2/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // This package has the automatically generated typed clients. 18 | package v1alpha2 19 | -------------------------------------------------------------------------------- /pkg/gen/client/specs/clientset/versioned/typed/specs/v1alpha3/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // This package has the automatically generated typed clients. 18 | package v1alpha3 19 | -------------------------------------------------------------------------------- /pkg/gen/client/specs/clientset/versioned/typed/specs/v1alpha4/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // This package has the automatically generated typed clients. 18 | package v1alpha4 19 | -------------------------------------------------------------------------------- /pkg/gen/client/split/clientset/versioned/scheme/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // This package contains the scheme of the automatically generated clientset. 18 | package scheme 19 | -------------------------------------------------------------------------------- /pkg/gen/client/split/clientset/versioned/typed/split/v1alpha1/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // This package has the automatically generated typed clients. 18 | package v1alpha1 19 | -------------------------------------------------------------------------------- /pkg/gen/client/split/clientset/versioned/typed/split/v1alpha1/generated_expansion.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | package v1alpha1 18 | 19 | type TrafficSplitExpansion interface{} 20 | -------------------------------------------------------------------------------- /pkg/gen/client/split/clientset/versioned/typed/split/v1alpha2/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // This package has the automatically generated typed clients. 18 | package v1alpha2 19 | -------------------------------------------------------------------------------- /pkg/gen/client/split/clientset/versioned/typed/split/v1alpha2/generated_expansion.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | package v1alpha2 18 | 19 | type TrafficSplitExpansion interface{} 20 | -------------------------------------------------------------------------------- /pkg/gen/client/split/clientset/versioned/typed/split/v1alpha3/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // This package has the automatically generated typed clients. 18 | package v1alpha3 19 | -------------------------------------------------------------------------------- /pkg/gen/client/split/clientset/versioned/typed/split/v1alpha3/generated_expansion.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | package v1alpha3 18 | 19 | type TrafficSplitExpansion interface{} 20 | -------------------------------------------------------------------------------- /pkg/gen/client/split/clientset/versioned/typed/split/v1alpha4/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // This package has the automatically generated typed clients. 18 | package v1alpha4 19 | -------------------------------------------------------------------------------- /pkg/gen/client/split/clientset/versioned/typed/split/v1alpha4/generated_expansion.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | package v1alpha4 18 | 19 | type TrafficSplitExpansion interface{} 20 | -------------------------------------------------------------------------------- /pkg/gen/client/access/clientset/versioned/typed/access/v1alpha1/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // This package has the automatically generated typed clients. 18 | package v1alpha1 19 | -------------------------------------------------------------------------------- /pkg/gen/client/access/clientset/versioned/typed/access/v1alpha2/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // This package has the automatically generated typed clients. 18 | package v1alpha2 19 | -------------------------------------------------------------------------------- /pkg/gen/client/access/clientset/versioned/typed/access/v1alpha3/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // This package has the automatically generated typed clients. 18 | package v1alpha3 19 | -------------------------------------------------------------------------------- /pkg/gen/client/metrics/clientset/versioned/typed/metrics/v1alpha1/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // This package has the automatically generated typed clients. 18 | package v1alpha1 19 | -------------------------------------------------------------------------------- /pkg/gen/client/metrics/clientset/versioned/typed/metrics/v1alpha1/generated_expansion.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | package v1alpha1 18 | 19 | type TrafficMetricsExpansion interface{} 20 | -------------------------------------------------------------------------------- /pkg/gen/client/metrics/clientset/versioned/typed/metrics/v1alpha2/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | // This package has the automatically generated typed clients. 18 | package v1alpha2 19 | -------------------------------------------------------------------------------- /pkg/gen/client/metrics/clientset/versioned/typed/metrics/v1alpha2/generated_expansion.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | package v1alpha2 18 | 19 | type TrafficMetricsExpansion interface{} 20 | -------------------------------------------------------------------------------- /pkg/gen/client/specs/clientset/versioned/typed/specs/v1alpha1/generated_expansion.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | package v1alpha1 18 | 19 | type HTTPRouteGroupExpansion interface{} 20 | 21 | type TCPRouteExpansion interface{} 22 | -------------------------------------------------------------------------------- /pkg/gen/client/specs/clientset/versioned/typed/specs/v1alpha2/generated_expansion.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | package v1alpha2 18 | 19 | type HTTPRouteGroupExpansion interface{} 20 | 21 | type TCPRouteExpansion interface{} 22 | -------------------------------------------------------------------------------- /pkg/gen/client/specs/clientset/versioned/typed/specs/v1alpha3/generated_expansion.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | package v1alpha3 18 | 19 | type HTTPRouteGroupExpansion interface{} 20 | 21 | type TCPRouteExpansion interface{} 22 | -------------------------------------------------------------------------------- /.github/workflows/ci.yaml: -------------------------------------------------------------------------------- 1 | name: ci 2 | 3 | on: 4 | pull_request: 5 | push: 6 | branches: 7 | - master 8 | tags-ignore: 9 | - v.* 10 | 11 | jobs: 12 | codegen: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: Checkout 16 | uses: actions/checkout@v2 17 | - name: Restore Cache 18 | uses: actions/cache@v1 19 | with: 20 | path: ~/go/pkg/mod 21 | key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} 22 | restore-keys: | 23 | ${{ runner.os }}-go- 24 | - name: Setup Go 25 | uses: actions/setup-go@v2 26 | with: 27 | go-version: 1.14.x 28 | - name: Download go module 29 | run: make bootstrap 30 | - name: Verify codegen 31 | run: make verify 32 | - name: Run unit tests 33 | run: make test -------------------------------------------------------------------------------- /pkg/apis/metrics/v1alpha1/edge.go: -------------------------------------------------------------------------------- 1 | package v1alpha1 2 | 3 | import ( 4 | "fmt" 5 | 6 | v1 "k8s.io/api/core/v1" 7 | ) 8 | 9 | // Direction defines whether an edge is sending traffic to a resource or 10 | // receiving traffic from a resource. 11 | type Direction string 12 | 13 | const ( 14 | // To is used when an edge is sending traffic to a resource 15 | To Direction = "to" 16 | // From is used when an edge is receiving traffic from a resource 17 | From Direction = "from" 18 | ) 19 | 20 | // Edge describes the other resource that metrics are associated with 21 | type Edge struct { 22 | Direction Direction `json:"direction"` 23 | Resource *v1.ObjectReference `json:"resource"` 24 | } 25 | 26 | // String returns a formatted string representation of this struct 27 | func (e *Edge) String() string { 28 | return fmt.Sprintf("%#v", e) 29 | } 30 | -------------------------------------------------------------------------------- /hack/verify-codegen.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -o errexit 4 | set -o nounset 5 | set -o pipefail 6 | 7 | SCRIPT_ROOT=$(git rev-parse --show-toplevel) 8 | 9 | DIFFROOT="${SCRIPT_ROOT}/pkg" 10 | TMP_DIFFROOT="${SCRIPT_ROOT}/_tmp/pkg" 11 | _tmp="${SCRIPT_ROOT}/_tmp" 12 | 13 | cleanup() { 14 | rm -rf "${_tmp}" 15 | } 16 | trap "cleanup" EXIT SIGINT 17 | 18 | cleanup 19 | 20 | mkdir -p "${TMP_DIFFROOT}" 21 | cp -a "${DIFFROOT}"/* "${TMP_DIFFROOT}" 22 | 23 | "${SCRIPT_ROOT}/hack/update-codegen.sh" 24 | echo "diffing ${DIFFROOT} against freshly generated codegen" 25 | ret=0 26 | diff -Naupr "${DIFFROOT}" "${TMP_DIFFROOT}" || ret=$? 27 | cp -a "${TMP_DIFFROOT}"/* "${DIFFROOT}" 28 | if [[ $ret -eq 0 ]] 29 | then 30 | echo "${DIFFROOT} up to date." 31 | else 32 | echo "${DIFFROOT} is out of date. Please run hack/update-codegen.sh" 33 | exit 1 34 | fi 35 | -------------------------------------------------------------------------------- /pkg/gen/client/specs/clientset/versioned/typed/specs/v1alpha4/generated_expansion.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | package v1alpha4 18 | 19 | type HTTPRouteGroupExpansion interface{} 20 | 21 | type TCPRouteExpansion interface{} 22 | 23 | type UDPRouteExpansion interface{} 24 | -------------------------------------------------------------------------------- /pkg/apis/specs/v1alpha1/tcp_route.go: -------------------------------------------------------------------------------- 1 | package v1alpha1 2 | 3 | import ( 4 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 | ) 6 | 7 | // +genclient 8 | // +genclient:noStatus 9 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 10 | 11 | // TCPRoute is used to describe TCP inbound connections 12 | type TCPRoute struct { 13 | metav1.TypeMeta `json:",inline"` 14 | 15 | // Standard object's metadata. 16 | // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata 17 | // +optional 18 | metav1.ObjectMeta `json:"metadata,omitempty"` 19 | } 20 | 21 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 22 | 23 | // TCPRouteList satisfy K8s code gen requirements 24 | type TCPRouteList struct { 25 | metav1.TypeMeta `json:",inline"` 26 | metav1.ListMeta `json:"metadata"` 27 | 28 | Items []TCPRoute `json:"items"` 29 | } 30 | -------------------------------------------------------------------------------- /pkg/apis/specs/v1alpha2/tcp_route.go: -------------------------------------------------------------------------------- 1 | package v1alpha2 2 | 3 | import ( 4 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 | ) 6 | 7 | // +genclient 8 | // +genclient:noStatus 9 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 10 | 11 | // TCPRoute is used to describe TCP inbound connections 12 | type TCPRoute struct { 13 | metav1.TypeMeta `json:",inline"` 14 | 15 | // Standard object's metadata. 16 | // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata 17 | // +optional 18 | metav1.ObjectMeta `json:"metadata,omitempty"` 19 | } 20 | 21 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 22 | 23 | // TCPRouteList satisfy K8s code gen requirements 24 | type TCPRouteList struct { 25 | metav1.TypeMeta `json:",inline"` 26 | metav1.ListMeta `json:"metadata"` 27 | 28 | Items []TCPRoute `json:"items"` 29 | } 30 | -------------------------------------------------------------------------------- /.github/workflows/fossa.yml: -------------------------------------------------------------------------------- 1 | name: FOSSA 2 | on: 3 | push: 4 | branches: [master] 5 | pull_request: 6 | branches: [master] 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v2 13 | - uses: actions/setup-go@v2 14 | with: 15 | go-version: "^1.14.x" 16 | - run: go version 17 | # Runs a set of commands to initialize and analyze with FOSSA 18 | - name: run FOSSA analysis 19 | env: 20 | # FOSSA Push-Only API Token 21 | FOSSA_API_KEY: '5cda1cd0d5036f6f368682c23a5fdfec' 22 | run: | 23 | export GOPATH=$HOME/go 24 | export PATH=$PATH:$(go env GOPATH)/bin 25 | curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install.sh | bash 26 | fossa init --include-all 27 | fossa analyze 28 | -------------------------------------------------------------------------------- /.golangci.yml: -------------------------------------------------------------------------------- 1 | linters: 2 | enable-all: true 3 | disable: 4 | - maligned 5 | - prealloc 6 | - gochecknoglobals 7 | 8 | skip-dirs: 9 | # ignore the system libraries 10 | - libexec/src/strings 11 | 12 | linters-settings: 13 | govet: 14 | check-shadowing: true 15 | golint: 16 | min-confidence: 0 17 | gocyclo: 18 | min-complexity: 10 19 | maligned: 20 | suggest-new: true 21 | dupl: 22 | threshold: 100 23 | goconst: 24 | min-len: 2 25 | min-occurrences: 2 26 | misspell: 27 | locale: US 28 | lll: 29 | line-length: 140 30 | goimports: 31 | local-prefixes: github.com/golangci/golangci-lint 32 | gocritic: 33 | enabled-tags: 34 | - performance 35 | - style 36 | - experimental 37 | disabled-checks: 38 | - wrapperFunc 39 | - dupImport # https://github.com/go-critic/go-critic/issues/845 40 | - rangeValCopy 41 | -------------------------------------------------------------------------------- /pkg/apis/specs/v1alpha2/helpers.go: -------------------------------------------------------------------------------- 1 | package v1alpha2 2 | 3 | import ( 4 | "encoding/json" 5 | "errors" 6 | ) 7 | 8 | // UnmarshalJSON converts a given array of single value maps to one map 9 | func (h *httpHeaders) UnmarshalJSON(b []byte) error { 10 | *h = make(map[string]string) 11 | var temp []map[string]string 12 | if err := json.Unmarshal(b, &temp); err != nil { 13 | return err 14 | } 15 | 16 | for _, m := range temp { 17 | if len(m) > 1 { 18 | return errors.New("incorrect length of keyval") 19 | } 20 | for key, val := range m { 21 | (*h)[key] = val 22 | } 23 | } 24 | return nil 25 | } 26 | 27 | // MarshalJSON converts a given map to array of single value maps 28 | func (h httpHeaders) MarshalJSON() ([]byte, error) { 29 | var returnArr []map[string]string 30 | for key, val := range h { 31 | returnArr = append(returnArr, map[string]string{key: val}) 32 | } 33 | return json.Marshal(returnArr) 34 | } 35 | -------------------------------------------------------------------------------- /pkg/apis/specs/v1alpha3/helpers.go: -------------------------------------------------------------------------------- 1 | package v1alpha3 2 | 3 | import ( 4 | "encoding/json" 5 | "errors" 6 | ) 7 | 8 | // UnmarshalJSON converts a given array of single value maps to one map 9 | func (h *httpHeaders) UnmarshalJSON(b []byte) error { 10 | *h = make(map[string]string) 11 | var temp []map[string]string 12 | if err := json.Unmarshal(b, &temp); err != nil { 13 | return err 14 | } 15 | 16 | for _, m := range temp { 17 | if len(m) > 1 { 18 | return errors.New("incorrect length of keyval") 19 | } 20 | for key, val := range m { 21 | (*h)[key] = val 22 | } 23 | } 24 | return nil 25 | } 26 | 27 | // MarshalJSON converts a given map to array of single value maps 28 | func (h httpHeaders) MarshalJSON() ([]byte, error) { 29 | var returnArr []map[string]string 30 | for key, val := range h { 31 | returnArr = append(returnArr, map[string]string{key: val}) 32 | } 33 | return json.Marshal(returnArr) 34 | } 35 | -------------------------------------------------------------------------------- /pkg/apis/specs/v1alpha4/helpers.go: -------------------------------------------------------------------------------- 1 | package v1alpha4 2 | 3 | import ( 4 | "encoding/json" 5 | "errors" 6 | ) 7 | 8 | // UnmarshalJSON converts a given array of single value maps to one map 9 | func (h *httpHeaders) UnmarshalJSON(b []byte) error { 10 | *h = make(map[string]string) 11 | var temp []map[string]string 12 | if err := json.Unmarshal(b, &temp); err != nil { 13 | return err 14 | } 15 | 16 | for _, m := range temp { 17 | if len(m) > 1 { 18 | return errors.New("incorrect length of keyval") 19 | } 20 | for key, val := range m { 21 | (*h)[key] = val 22 | } 23 | } 24 | return nil 25 | } 26 | 27 | // MarshalJSON converts a given map to array of single value maps 28 | func (h httpHeaders) MarshalJSON() ([]byte, error) { 29 | var returnArr []map[string]string 30 | for key, val := range h { 31 | returnArr = append(returnArr, map[string]string{key: val}) 32 | } 33 | return json.Marshal(returnArr) 34 | } 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SMI SDK for Go 2 | 3 | [![ci](https://github.com/servicemeshinterface/smi-sdk-go/workflows/ci/badge.svg)](https://github.com/servicemeshinterface/smi-sdk-go/actions) 4 | 5 | Kubernetes client implementation for [SMI](https://github.com/servicemeshinterface/smi-spec). 6 | 7 | ## API 8 | 9 | API objects are found at the following locations: 10 | 11 | * `pkg/apis/access` - Traffic Access Control API (access.smi-spec.io) 12 | * `pkg/apis/metrics` - Traffic Metrics API (metrics.smi-spec.io) 13 | * `pkg/apis/specs` - Traffic Specs API (spec.smi-spec.io) 14 | * `pkg/apis/split` - Traffic Split API (split.smi-spec.io) 15 | 16 | ## Codegen 17 | 18 | The Kubernetes client code for the API CRDs is autogenerated and can be found at `pkg/gen/client`. 19 | To regenerate the client code run `make codegen` and commit all changes to the `pkg/gen` dir. 20 | 21 | ## Contributing 22 | 23 | Please refer to [CONTRIBUTING.md](./CONTRIBUTING.md) for more information on contributing to the specification. 24 | -------------------------------------------------------------------------------- /docs/release_process.md: -------------------------------------------------------------------------------- 1 | # Release Process 2 | 3 | This document describes the release process for this project. Releases are published via GitHub releases. 4 | 5 | All releases will have a [semantic version](https://semver.org/) associated with them. 6 | This project will be versioned at 1.0.0 once the 7 | [Service Mesh Interface(SMI) specification](https://github.com/servicemeshinterface/smi-spec) 8 | is at 1.0.0 and all APIs defined in this project are at `v1`. 9 | All releases until then will be marked `v0.x.0` where `x` is incremented with each release. 10 | 11 | To perform a release of the smi-sdk-go project: 12 | 13 | 1. Start by creating and pushing a git tag in the form: `v0.x.0`. 14 | ```console 15 | $ git tag -a v0.x.0 -m "version 0.x.0" 16 | $ git push origin v0.x.0 17 | ``` 18 | 19 | 2. Last, visit the [releases page](https://github.com/servicemeshinterface/smi-sdk-go/releases) 20 | to `Draft a new release` using the tag you just created and pushed. 21 | Be sure to include release notes on what changes are included in the release. 22 | -------------------------------------------------------------------------------- /pkg/apis/specs/v1alpha3/tcp_route.go: -------------------------------------------------------------------------------- 1 | package v1alpha3 2 | 3 | import ( 4 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 | ) 6 | 7 | // +genclient 8 | // +genclient:noStatus 9 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 10 | 11 | // TCPRoute is used to describe TCP inbound connections 12 | type TCPRoute struct { 13 | metav1.TypeMeta `json:",inline"` 14 | 15 | // Standard object's metadata. 16 | // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata 17 | // +optional 18 | metav1.ObjectMeta `json:"metadata,omitempty"` 19 | 20 | Spec TCPRouteSpec `json:"spec,omitempty"` 21 | } 22 | 23 | // TCPRouteSpec is the specification of a TCPRoute 24 | type TCPRouteSpec struct { 25 | } 26 | 27 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 28 | 29 | // TCPRouteList satisfy K8s code gen requirements 30 | type TCPRouteList struct { 31 | metav1.TypeMeta `json:",inline"` 32 | metav1.ListMeta `json:"metadata"` 33 | 34 | Items []TCPRoute `json:"items"` 35 | } 36 | -------------------------------------------------------------------------------- /pkg/gen/client/split/listers/split/v1alpha1/expansion_generated.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by lister-gen. DO NOT EDIT. 16 | 17 | package v1alpha1 18 | 19 | // TrafficSplitListerExpansion allows custom methods to be added to 20 | // TrafficSplitLister. 21 | type TrafficSplitListerExpansion interface{} 22 | 23 | // TrafficSplitNamespaceListerExpansion allows custom methods to be added to 24 | // TrafficSplitNamespaceLister. 25 | type TrafficSplitNamespaceListerExpansion interface{} 26 | -------------------------------------------------------------------------------- /pkg/gen/client/split/listers/split/v1alpha2/expansion_generated.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by lister-gen. DO NOT EDIT. 16 | 17 | package v1alpha2 18 | 19 | // TrafficSplitListerExpansion allows custom methods to be added to 20 | // TrafficSplitLister. 21 | type TrafficSplitListerExpansion interface{} 22 | 23 | // TrafficSplitNamespaceListerExpansion allows custom methods to be added to 24 | // TrafficSplitNamespaceLister. 25 | type TrafficSplitNamespaceListerExpansion interface{} 26 | -------------------------------------------------------------------------------- /pkg/gen/client/split/listers/split/v1alpha3/expansion_generated.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by lister-gen. DO NOT EDIT. 16 | 17 | package v1alpha3 18 | 19 | // TrafficSplitListerExpansion allows custom methods to be added to 20 | // TrafficSplitLister. 21 | type TrafficSplitListerExpansion interface{} 22 | 23 | // TrafficSplitNamespaceListerExpansion allows custom methods to be added to 24 | // TrafficSplitNamespaceLister. 25 | type TrafficSplitNamespaceListerExpansion interface{} 26 | -------------------------------------------------------------------------------- /pkg/gen/client/split/listers/split/v1alpha4/expansion_generated.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by lister-gen. DO NOT EDIT. 16 | 17 | package v1alpha4 18 | 19 | // TrafficSplitListerExpansion allows custom methods to be added to 20 | // TrafficSplitLister. 21 | type TrafficSplitListerExpansion interface{} 22 | 23 | // TrafficSplitNamespaceListerExpansion allows custom methods to be added to 24 | // TrafficSplitNamespaceLister. 25 | type TrafficSplitNamespaceListerExpansion interface{} 26 | -------------------------------------------------------------------------------- /pkg/gen/client/access/listers/access/v1alpha1/expansion_generated.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by lister-gen. DO NOT EDIT. 16 | 17 | package v1alpha1 18 | 19 | // TrafficTargetListerExpansion allows custom methods to be added to 20 | // TrafficTargetLister. 21 | type TrafficTargetListerExpansion interface{} 22 | 23 | // TrafficTargetNamespaceListerExpansion allows custom methods to be added to 24 | // TrafficTargetNamespaceLister. 25 | type TrafficTargetNamespaceListerExpansion interface{} 26 | -------------------------------------------------------------------------------- /pkg/gen/client/access/listers/access/v1alpha2/expansion_generated.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by lister-gen. DO NOT EDIT. 16 | 17 | package v1alpha2 18 | 19 | // TrafficTargetListerExpansion allows custom methods to be added to 20 | // TrafficTargetLister. 21 | type TrafficTargetListerExpansion interface{} 22 | 23 | // TrafficTargetNamespaceListerExpansion allows custom methods to be added to 24 | // TrafficTargetNamespaceLister. 25 | type TrafficTargetNamespaceListerExpansion interface{} 26 | -------------------------------------------------------------------------------- /pkg/gen/client/access/listers/access/v1alpha3/expansion_generated.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by lister-gen. DO NOT EDIT. 16 | 17 | package v1alpha3 18 | 19 | // TrafficTargetListerExpansion allows custom methods to be added to 20 | // TrafficTargetLister. 21 | type TrafficTargetListerExpansion interface{} 22 | 23 | // TrafficTargetNamespaceListerExpansion allows custom methods to be added to 24 | // TrafficTargetNamespaceLister. 25 | type TrafficTargetNamespaceListerExpansion interface{} 26 | -------------------------------------------------------------------------------- /pkg/gen/client/metrics/listers/metrics/v1alpha1/expansion_generated.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by lister-gen. DO NOT EDIT. 16 | 17 | package v1alpha1 18 | 19 | // TrafficMetricsListerExpansion allows custom methods to be added to 20 | // TrafficMetricsLister. 21 | type TrafficMetricsListerExpansion interface{} 22 | 23 | // TrafficMetricsNamespaceListerExpansion allows custom methods to be added to 24 | // TrafficMetricsNamespaceLister. 25 | type TrafficMetricsNamespaceListerExpansion interface{} 26 | -------------------------------------------------------------------------------- /pkg/gen/client/metrics/listers/metrics/v1alpha2/expansion_generated.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by lister-gen. DO NOT EDIT. 16 | 17 | package v1alpha2 18 | 19 | // TrafficMetricsListerExpansion allows custom methods to be added to 20 | // TrafficMetricsLister. 21 | type TrafficMetricsListerExpansion interface{} 22 | 23 | // TrafficMetricsNamespaceListerExpansion allows custom methods to be added to 24 | // TrafficMetricsNamespaceLister. 25 | type TrafficMetricsNamespaceListerExpansion interface{} 26 | -------------------------------------------------------------------------------- /crds/tcproute.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: apiextensions.k8s.io/v1 3 | kind: CustomResourceDefinition 4 | metadata: 5 | name: tcproutes.specs.smi-spec.io 6 | spec: 7 | group: specs.smi-spec.io 8 | scope: Namespaced 9 | names: 10 | kind: TCPRoute 11 | shortNames: 12 | - tr 13 | plural: tcproutes 14 | singular: tcproute 15 | versions: 16 | - name: v1alpha4 17 | served: true 18 | storage: true 19 | schema: 20 | openAPIV3Schema: 21 | type: object 22 | properties: 23 | spec: 24 | type: object 25 | required: 26 | - matches 27 | properties: 28 | matches: 29 | description: Match conditions of this route. 30 | type: object 31 | required: 32 | - ports 33 | properties: 34 | ports: 35 | description: Port numbers to match TCP traffic. 36 | type: array 37 | items: 38 | type: integer 39 | -------------------------------------------------------------------------------- /crds/udproute.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: apiextensions.k8s.io/v1 3 | kind: CustomResourceDefinition 4 | metadata: 5 | name: udproutes.specs.smi-spec.io 6 | spec: 7 | group: specs.smi-spec.io 8 | scope: Namespaced 9 | names: 10 | kind: UDPRoute 11 | shortNames: 12 | - ur 13 | plural: udproutes 14 | singular: udproute 15 | versions: 16 | - name: v1alpha4 17 | served: true 18 | storage: true 19 | schema: 20 | openAPIV3Schema: 21 | type: object 22 | properties: 23 | spec: 24 | type: object 25 | required: 26 | - matches 27 | properties: 28 | matches: 29 | description: Match conditions of this route. 30 | type: object 31 | required: 32 | - ports 33 | properties: 34 | ports: 35 | description: Port numbers to match UDP traffic. 36 | type: array 37 | items: 38 | type: integer 39 | -------------------------------------------------------------------------------- /pkg/apis/metrics/v1alpha2/edge.go: -------------------------------------------------------------------------------- 1 | package v1alpha2 2 | 3 | import ( 4 | "fmt" 5 | 6 | v1 "k8s.io/api/core/v1" 7 | ) 8 | 9 | // Direction defines whether an edge is sending traffic to a resource or 10 | // receiving traffic from a resource. 11 | type Direction string 12 | 13 | // Side defines on which side of the edge the metrics are measured. 14 | type Side string 15 | 16 | const ( 17 | // To is used when an edge is sending traffic to a resource 18 | To Direction = "to" 19 | // From is used when an edge is receiving traffic from a resource 20 | From Direction = "from" 21 | // Server indicates that the metrics are measured on the server side 22 | Server Side = "server" 23 | // Client indicated that the metrics are measured on the client side 24 | Client Side = "client" 25 | ) 26 | 27 | // Edge describes the other resource that metrics are associated with 28 | type Edge struct { 29 | Direction Direction `json:"direction"` 30 | Side Side `json:"side"` 31 | Resource *v1.ObjectReference `json:"resource"` 32 | } 33 | 34 | // String returns a formatted string representation of this struct 35 | func (e *Edge) String() string { 36 | return fmt.Sprintf("%#v", e) 37 | } 38 | -------------------------------------------------------------------------------- /pkg/apis/split/v1alpha1/traffic_split_webhook.go: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | 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 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package v1alpha1 18 | 19 | import ( 20 | ctrl "sigs.k8s.io/controller-runtime" 21 | ) 22 | 23 | /* 24 | This setup doubles as setup for our conversion webhooks: as long as our 25 | types implement the 26 | [Hub](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/conversion?tab=doc#Hub) and 27 | [Convertible](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/conversion?tab=doc#Convertible) 28 | interfaces, a conversion webhook will be registered. 29 | */ 30 | func (r *TrafficSplit) SetupWebhookWithManager(mgr ctrl.Manager) error { 31 | return ctrl.NewWebhookManagedBy(mgr). 32 | For(r). 33 | Complete() 34 | } 35 | -------------------------------------------------------------------------------- /pkg/apis/split/v1alpha2/traffic_split_webhook.go: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | 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 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package v1alpha2 18 | 19 | import ( 20 | ctrl "sigs.k8s.io/controller-runtime" 21 | ) 22 | 23 | /* 24 | This setup doubles as setup for our conversion webhooks: as long as our 25 | types implement the 26 | [Hub](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/conversion?tab=doc#Hub) and 27 | [Convertible](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/conversion?tab=doc#Convertible) 28 | interfaces, a conversion webhook will be registered. 29 | */ 30 | func (r *TrafficSplit) SetupWebhookWithManager(mgr ctrl.Manager) error { 31 | return ctrl.NewWebhookManagedBy(mgr). 32 | For(r). 33 | Complete() 34 | } 35 | -------------------------------------------------------------------------------- /pkg/apis/split/v1alpha3/traffic_split_webhook.go: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | 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 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package v1alpha3 18 | 19 | import ( 20 | ctrl "sigs.k8s.io/controller-runtime" 21 | ) 22 | 23 | /* 24 | This setup doubles as setup for our conversion webhooks: as long as our 25 | types implement the 26 | [Hub](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/conversion?tab=doc#Hub) and 27 | [Convertible](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/conversion?tab=doc#Convertible) 28 | interfaces, a conversion webhook will be registered. 29 | */ 30 | func (r *TrafficSplit) SetupWebhookWithManager(mgr ctrl.Manager) error { 31 | return ctrl.NewWebhookManagedBy(mgr). 32 | For(r). 33 | Complete() 34 | } 35 | -------------------------------------------------------------------------------- /pkg/apis/split/v1alpha4/traffic_split_webhook.go: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | 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 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package v1alpha4 18 | 19 | import ( 20 | ctrl "sigs.k8s.io/controller-runtime" 21 | ) 22 | 23 | /* 24 | This setup doubles as setup for our conversion webhooks: as long as our 25 | types implement the 26 | [Hub](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/conversion?tab=doc#Hub) and 27 | [Convertible](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/conversion?tab=doc#Convertible) 28 | interfaces, a conversion webhook will be registered. 29 | */ 30 | func (r *TrafficSplit) SetupWebhookWithManager(mgr ctrl.Manager) error { 31 | return ctrl.NewWebhookManagedBy(mgr). 32 | For(r). 33 | Complete() 34 | } 35 | -------------------------------------------------------------------------------- /pkg/apis/access/v1alpha1/traffic_target_webhook.go: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | 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 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package v1alpha1 18 | 19 | import ( 20 | ctrl "sigs.k8s.io/controller-runtime" 21 | ) 22 | 23 | /* 24 | This setup doubles as setup for our conversion webhooks: as long as our 25 | types implement the 26 | [Hub](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/conversion?tab=doc#Hub) and 27 | [Convertible](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/conversion?tab=doc#Convertible) 28 | interfaces, a conversion webhook will be registered. 29 | */ 30 | func (r *TrafficTarget) SetupWebhookWithManager(mgr ctrl.Manager) error { 31 | return ctrl.NewWebhookManagedBy(mgr). 32 | For(r). 33 | Complete() 34 | } 35 | -------------------------------------------------------------------------------- /pkg/apis/access/v1alpha2/traffic_target_webhook.go: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | 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 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package v1alpha2 18 | 19 | import ( 20 | ctrl "sigs.k8s.io/controller-runtime" 21 | ) 22 | 23 | /* 24 | This setup doubles as setup for our conversion webhooks: as long as our 25 | types implement the 26 | [Hub](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/conversion?tab=doc#Hub) and 27 | [Convertible](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/conversion?tab=doc#Convertible) 28 | interfaces, a conversion webhook will be registered. 29 | */ 30 | func (r *TrafficTarget) SetupWebhookWithManager(mgr ctrl.Manager) error { 31 | return ctrl.NewWebhookManagedBy(mgr). 32 | For(r). 33 | Complete() 34 | } 35 | -------------------------------------------------------------------------------- /pkg/apis/access/v1alpha3/traffic_target_webhook.go: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | 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 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package v1alpha3 18 | 19 | import ( 20 | ctrl "sigs.k8s.io/controller-runtime" 21 | ) 22 | 23 | /* 24 | This setup doubles as setup for our conversion webhooks: as long as our 25 | types implement the 26 | [Hub](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/conversion?tab=doc#Hub) and 27 | [Convertible](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/conversion?tab=doc#Convertible) 28 | interfaces, a conversion webhook will be registered. 29 | */ 30 | func (r *TrafficTarget) SetupWebhookWithManager(mgr ctrl.Manager) error { 31 | return ctrl.NewWebhookManagedBy(mgr). 32 | For(r). 33 | Complete() 34 | } 35 | -------------------------------------------------------------------------------- /pkg/apis/metrics/v1alpha1/kinds.go: -------------------------------------------------------------------------------- 1 | package v1alpha1 2 | 3 | import ( 4 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 | ) 6 | 7 | var AvailableKinds = map[string]*metav1.APIResource{ 8 | "Deployment": { 9 | Name: "deployments", 10 | Namespaced: true, 11 | Kind: "TrafficMetrics", 12 | Verbs: []string{ 13 | "get", 14 | "list", 15 | }, 16 | }, 17 | "Pod": { 18 | Name: "pods", 19 | Namespaced: true, 20 | Kind: "TrafficMetrics", 21 | Verbs: []string{ 22 | "get", 23 | "list", 24 | }, 25 | }, 26 | "Daemonset": { 27 | Name: "daemonsets", 28 | Namespaced: true, 29 | Kind: "TrafficMetrics", 30 | Verbs: []string{ 31 | "get", 32 | "list", 33 | }, 34 | }, 35 | "Statefulset": { 36 | Name: "statefulsets", 37 | Namespaced: true, 38 | Kind: "TrafficMetrics", 39 | Verbs: []string{ 40 | "get", 41 | "list", 42 | }, 43 | }, 44 | "Namespace": { 45 | Name: "namespaces", 46 | Namespaced: false, 47 | Kind: "TrafficMetrics", 48 | Verbs: []string{ 49 | "get", 50 | "list", 51 | }, 52 | }, 53 | } 54 | 55 | func getKindName(kind string) string { 56 | apiResource, ok := AvailableKinds[kind] 57 | if !ok { 58 | return "unsupported" 59 | } 60 | 61 | return apiResource.Name 62 | } 63 | -------------------------------------------------------------------------------- /pkg/gen/client/specs/listers/specs/v1alpha1/expansion_generated.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by lister-gen. DO NOT EDIT. 16 | 17 | package v1alpha1 18 | 19 | // HTTPRouteGroupListerExpansion allows custom methods to be added to 20 | // HTTPRouteGroupLister. 21 | type HTTPRouteGroupListerExpansion interface{} 22 | 23 | // HTTPRouteGroupNamespaceListerExpansion allows custom methods to be added to 24 | // HTTPRouteGroupNamespaceLister. 25 | type HTTPRouteGroupNamespaceListerExpansion interface{} 26 | 27 | // TCPRouteListerExpansion allows custom methods to be added to 28 | // TCPRouteLister. 29 | type TCPRouteListerExpansion interface{} 30 | 31 | // TCPRouteNamespaceListerExpansion allows custom methods to be added to 32 | // TCPRouteNamespaceLister. 33 | type TCPRouteNamespaceListerExpansion interface{} 34 | -------------------------------------------------------------------------------- /pkg/gen/client/specs/listers/specs/v1alpha2/expansion_generated.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by lister-gen. DO NOT EDIT. 16 | 17 | package v1alpha2 18 | 19 | // HTTPRouteGroupListerExpansion allows custom methods to be added to 20 | // HTTPRouteGroupLister. 21 | type HTTPRouteGroupListerExpansion interface{} 22 | 23 | // HTTPRouteGroupNamespaceListerExpansion allows custom methods to be added to 24 | // HTTPRouteGroupNamespaceLister. 25 | type HTTPRouteGroupNamespaceListerExpansion interface{} 26 | 27 | // TCPRouteListerExpansion allows custom methods to be added to 28 | // TCPRouteLister. 29 | type TCPRouteListerExpansion interface{} 30 | 31 | // TCPRouteNamespaceListerExpansion allows custom methods to be added to 32 | // TCPRouteNamespaceLister. 33 | type TCPRouteNamespaceListerExpansion interface{} 34 | -------------------------------------------------------------------------------- /pkg/gen/client/specs/listers/specs/v1alpha3/expansion_generated.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by lister-gen. DO NOT EDIT. 16 | 17 | package v1alpha3 18 | 19 | // HTTPRouteGroupListerExpansion allows custom methods to be added to 20 | // HTTPRouteGroupLister. 21 | type HTTPRouteGroupListerExpansion interface{} 22 | 23 | // HTTPRouteGroupNamespaceListerExpansion allows custom methods to be added to 24 | // HTTPRouteGroupNamespaceLister. 25 | type HTTPRouteGroupNamespaceListerExpansion interface{} 26 | 27 | // TCPRouteListerExpansion allows custom methods to be added to 28 | // TCPRouteLister. 29 | type TCPRouteListerExpansion interface{} 30 | 31 | // TCPRouteNamespaceListerExpansion allows custom methods to be added to 32 | // TCPRouteNamespaceLister. 33 | type TCPRouteNamespaceListerExpansion interface{} 34 | -------------------------------------------------------------------------------- /pkg/gen/client/split/clientset/versioned/typed/split/v1alpha1/fake/fake_split_client.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | package fake 18 | 19 | import ( 20 | v1alpha1 "github.com/servicemeshinterface/smi-sdk-go/pkg/gen/client/split/clientset/versioned/typed/split/v1alpha1" 21 | rest "k8s.io/client-go/rest" 22 | testing "k8s.io/client-go/testing" 23 | ) 24 | 25 | type FakeSplitV1alpha1 struct { 26 | *testing.Fake 27 | } 28 | 29 | func (c *FakeSplitV1alpha1) TrafficSplits(namespace string) v1alpha1.TrafficSplitInterface { 30 | return &FakeTrafficSplits{c, namespace} 31 | } 32 | 33 | // RESTClient returns a RESTClient that is used to communicate 34 | // with API server by this client implementation. 35 | func (c *FakeSplitV1alpha1) RESTClient() rest.Interface { 36 | var ret *rest.RESTClient 37 | return ret 38 | } 39 | -------------------------------------------------------------------------------- /pkg/gen/client/split/clientset/versioned/typed/split/v1alpha2/fake/fake_split_client.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | package fake 18 | 19 | import ( 20 | v1alpha2 "github.com/servicemeshinterface/smi-sdk-go/pkg/gen/client/split/clientset/versioned/typed/split/v1alpha2" 21 | rest "k8s.io/client-go/rest" 22 | testing "k8s.io/client-go/testing" 23 | ) 24 | 25 | type FakeSplitV1alpha2 struct { 26 | *testing.Fake 27 | } 28 | 29 | func (c *FakeSplitV1alpha2) TrafficSplits(namespace string) v1alpha2.TrafficSplitInterface { 30 | return &FakeTrafficSplits{c, namespace} 31 | } 32 | 33 | // RESTClient returns a RESTClient that is used to communicate 34 | // with API server by this client implementation. 35 | func (c *FakeSplitV1alpha2) RESTClient() rest.Interface { 36 | var ret *rest.RESTClient 37 | return ret 38 | } 39 | -------------------------------------------------------------------------------- /pkg/gen/client/split/clientset/versioned/typed/split/v1alpha3/fake/fake_split_client.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | package fake 18 | 19 | import ( 20 | v1alpha3 "github.com/servicemeshinterface/smi-sdk-go/pkg/gen/client/split/clientset/versioned/typed/split/v1alpha3" 21 | rest "k8s.io/client-go/rest" 22 | testing "k8s.io/client-go/testing" 23 | ) 24 | 25 | type FakeSplitV1alpha3 struct { 26 | *testing.Fake 27 | } 28 | 29 | func (c *FakeSplitV1alpha3) TrafficSplits(namespace string) v1alpha3.TrafficSplitInterface { 30 | return &FakeTrafficSplits{c, namespace} 31 | } 32 | 33 | // RESTClient returns a RESTClient that is used to communicate 34 | // with API server by this client implementation. 35 | func (c *FakeSplitV1alpha3) RESTClient() rest.Interface { 36 | var ret *rest.RESTClient 37 | return ret 38 | } 39 | -------------------------------------------------------------------------------- /pkg/gen/client/split/clientset/versioned/typed/split/v1alpha4/fake/fake_split_client.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | package fake 18 | 19 | import ( 20 | v1alpha4 "github.com/servicemeshinterface/smi-sdk-go/pkg/gen/client/split/clientset/versioned/typed/split/v1alpha4" 21 | rest "k8s.io/client-go/rest" 22 | testing "k8s.io/client-go/testing" 23 | ) 24 | 25 | type FakeSplitV1alpha4 struct { 26 | *testing.Fake 27 | } 28 | 29 | func (c *FakeSplitV1alpha4) TrafficSplits(namespace string) v1alpha4.TrafficSplitInterface { 30 | return &FakeTrafficSplits{c, namespace} 31 | } 32 | 33 | // RESTClient returns a RESTClient that is used to communicate 34 | // with API server by this client implementation. 35 | func (c *FakeSplitV1alpha4) RESTClient() rest.Interface { 36 | var ret *rest.RESTClient 37 | return ret 38 | } 39 | -------------------------------------------------------------------------------- /GOVERNANCE.md: -------------------------------------------------------------------------------- 1 | # Governance 2 | 3 | ## Project Maintainers 4 | 5 | [Project maintainers](CODEOWNERS) are responsible for activities around maintaining and updating SMI SDK for Go. Final decisions on the project reside with the project maintainers. 6 | 7 | Changes to the code base require approval from one project maintainer. 8 | 9 | Maintainers MUST remain active. If they are unresponsive for >3 months, they will be automatically removed unless a [super-majority](https://en.wikipedia.org/wiki/Supermajority#Two-thirds_vote) of the other project maintainers agrees to extend the period to be greater than 3 months. 10 | 11 | New maintainers can be added to the project by a [super-majority](https://en.wikipedia.org/wiki/Supermajority#Two-thirds_vote) vote of the existing maintainers. A potential maintainer may be nominated by an existing maintainer. A vote is conducted in private between the current maintainers over the course of a one week voting period. At the end of the week, votes are counted and a pull request is made on the repo adding the new maintainer to the [CODEOWNERS](CODEOWNERS) file. 12 | 13 | A maintainer may step down by submitting an [issue](https://github.com/servicemeshinterface/smi-sdk-go/issues/new) stating their intent. 14 | 15 | Changes to this governance document require a pull request with approval from a [super-majority](https://en.wikipedia.org/wiki/Supermajority#Two-thirds_vote) of the current maintainers. 16 | -------------------------------------------------------------------------------- /pkg/gen/client/access/clientset/versioned/typed/access/v1alpha1/fake/fake_access_client.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | package fake 18 | 19 | import ( 20 | v1alpha1 "github.com/servicemeshinterface/smi-sdk-go/pkg/gen/client/access/clientset/versioned/typed/access/v1alpha1" 21 | rest "k8s.io/client-go/rest" 22 | testing "k8s.io/client-go/testing" 23 | ) 24 | 25 | type FakeAccessV1alpha1 struct { 26 | *testing.Fake 27 | } 28 | 29 | func (c *FakeAccessV1alpha1) TrafficTargets(namespace string) v1alpha1.TrafficTargetInterface { 30 | return &FakeTrafficTargets{c, namespace} 31 | } 32 | 33 | // RESTClient returns a RESTClient that is used to communicate 34 | // with API server by this client implementation. 35 | func (c *FakeAccessV1alpha1) RESTClient() rest.Interface { 36 | var ret *rest.RESTClient 37 | return ret 38 | } 39 | -------------------------------------------------------------------------------- /pkg/gen/client/access/clientset/versioned/typed/access/v1alpha2/fake/fake_access_client.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | package fake 18 | 19 | import ( 20 | v1alpha2 "github.com/servicemeshinterface/smi-sdk-go/pkg/gen/client/access/clientset/versioned/typed/access/v1alpha2" 21 | rest "k8s.io/client-go/rest" 22 | testing "k8s.io/client-go/testing" 23 | ) 24 | 25 | type FakeAccessV1alpha2 struct { 26 | *testing.Fake 27 | } 28 | 29 | func (c *FakeAccessV1alpha2) TrafficTargets(namespace string) v1alpha2.TrafficTargetInterface { 30 | return &FakeTrafficTargets{c, namespace} 31 | } 32 | 33 | // RESTClient returns a RESTClient that is used to communicate 34 | // with API server by this client implementation. 35 | func (c *FakeAccessV1alpha2) RESTClient() rest.Interface { 36 | var ret *rest.RESTClient 37 | return ret 38 | } 39 | -------------------------------------------------------------------------------- /pkg/gen/client/access/clientset/versioned/typed/access/v1alpha3/fake/fake_access_client.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | package fake 18 | 19 | import ( 20 | v1alpha3 "github.com/servicemeshinterface/smi-sdk-go/pkg/gen/client/access/clientset/versioned/typed/access/v1alpha3" 21 | rest "k8s.io/client-go/rest" 22 | testing "k8s.io/client-go/testing" 23 | ) 24 | 25 | type FakeAccessV1alpha3 struct { 26 | *testing.Fake 27 | } 28 | 29 | func (c *FakeAccessV1alpha3) TrafficTargets(namespace string) v1alpha3.TrafficTargetInterface { 30 | return &FakeTrafficTargets{c, namespace} 31 | } 32 | 33 | // RESTClient returns a RESTClient that is used to communicate 34 | // with API server by this client implementation. 35 | func (c *FakeAccessV1alpha3) RESTClient() rest.Interface { 36 | var ret *rest.RESTClient 37 | return ret 38 | } 39 | -------------------------------------------------------------------------------- /pkg/apis/specs/v1alpha4/tcp_route.go: -------------------------------------------------------------------------------- 1 | package v1alpha4 2 | 3 | import ( 4 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 | ) 6 | 7 | // +genclient 8 | // +genclient:noStatus 9 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 10 | 11 | // TCPRoute is used to describe TCP inbound connections 12 | type TCPRoute struct { 13 | metav1.TypeMeta `json:",inline"` 14 | 15 | // Standard object's metadata. 16 | // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata 17 | // +optional 18 | metav1.ObjectMeta `json:"metadata,omitempty"` 19 | 20 | Spec TCPRouteSpec `json:"spec,omitempty"` 21 | } 22 | 23 | // TCPRouteSpec is the specification of a TCPRoute 24 | type TCPRouteSpec struct { 25 | // Route match for inbound traffic 26 | Matches TCPMatch `json:"matches,omitempty"` 27 | } 28 | 29 | // TCPMatch defines an individual route for TCP traffic 30 | type TCPMatch struct { 31 | // Name is the name of the match for referencing in a TrafficTarget 32 | Name string `json:"name,omitempty"` 33 | 34 | // Ports to allow inbound traffic on 35 | Ports []int `json:"ports,omitempty"` 36 | } 37 | 38 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 39 | 40 | // TCPRouteList satisfy K8s code gen requirements 41 | type TCPRouteList struct { 42 | metav1.TypeMeta `json:",inline"` 43 | metav1.ListMeta `json:"metadata"` 44 | 45 | Items []TCPRoute `json:"items"` 46 | } 47 | -------------------------------------------------------------------------------- /pkg/apis/specs/v1alpha4/udp_route.go: -------------------------------------------------------------------------------- 1 | package v1alpha4 2 | 3 | import ( 4 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 | ) 6 | 7 | // +genclient 8 | // +genclient:noStatus 9 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 10 | 11 | // UDPRoute is used to describe UDP inbound connections 12 | type UDPRoute struct { 13 | metav1.TypeMeta `json:",inline"` 14 | 15 | // Standard object's metadata. 16 | // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata 17 | // +optional 18 | metav1.ObjectMeta `json:"metadata,omitempty"` 19 | 20 | Spec UDPRouteSpec `json:"spec,omitempty"` 21 | } 22 | 23 | // UDPRouteSpec is the specification of a UDPRoute 24 | type UDPRouteSpec struct { 25 | // Route match for inbound traffic 26 | Matches UDPMatch `json:"matches,omitempty"` 27 | } 28 | 29 | // UDPMatch defines an individual route for UDP traffic 30 | type UDPMatch struct { 31 | // Name is the name of the match for referencing in a TrafficTarget 32 | Name string `json:"name,omitempty"` 33 | 34 | // Ports to allow inbound traffic on 35 | Ports []int `json:"ports,omitempty"` 36 | } 37 | 38 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 39 | 40 | // UDPRouteList satisfy K8s code gen requirements 41 | type UDPRouteList struct { 42 | metav1.TypeMeta `json:",inline"` 43 | metav1.ListMeta `json:"metadata"` 44 | 45 | Items []UDPRoute `json:"items"` 46 | } 47 | -------------------------------------------------------------------------------- /pkg/gen/client/metrics/clientset/versioned/typed/metrics/v1alpha1/fake/fake_metrics_client.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | package fake 18 | 19 | import ( 20 | v1alpha1 "github.com/servicemeshinterface/smi-sdk-go/pkg/gen/client/metrics/clientset/versioned/typed/metrics/v1alpha1" 21 | rest "k8s.io/client-go/rest" 22 | testing "k8s.io/client-go/testing" 23 | ) 24 | 25 | type FakeMetricsV1alpha1 struct { 26 | *testing.Fake 27 | } 28 | 29 | func (c *FakeMetricsV1alpha1) TrafficMetricses(namespace string) v1alpha1.TrafficMetricsInterface { 30 | return &FakeTrafficMetricses{c, namespace} 31 | } 32 | 33 | // RESTClient returns a RESTClient that is used to communicate 34 | // with API server by this client implementation. 35 | func (c *FakeMetricsV1alpha1) RESTClient() rest.Interface { 36 | var ret *rest.RESTClient 37 | return ret 38 | } 39 | -------------------------------------------------------------------------------- /pkg/gen/client/metrics/clientset/versioned/typed/metrics/v1alpha2/fake/fake_metrics_client.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | package fake 18 | 19 | import ( 20 | v1alpha2 "github.com/servicemeshinterface/smi-sdk-go/pkg/gen/client/metrics/clientset/versioned/typed/metrics/v1alpha2" 21 | rest "k8s.io/client-go/rest" 22 | testing "k8s.io/client-go/testing" 23 | ) 24 | 25 | type FakeMetricsV1alpha2 struct { 26 | *testing.Fake 27 | } 28 | 29 | func (c *FakeMetricsV1alpha2) TrafficMetricses(namespace string) v1alpha2.TrafficMetricsInterface { 30 | return &FakeTrafficMetricses{c, namespace} 31 | } 32 | 33 | // RESTClient returns a RESTClient that is used to communicate 34 | // with API server by this client implementation. 35 | func (c *FakeMetricsV1alpha2) RESTClient() rest.Interface { 36 | var ret *rest.RESTClient 37 | return ret 38 | } 39 | -------------------------------------------------------------------------------- /pkg/apis/metrics/v1alpha2/kinds.go: -------------------------------------------------------------------------------- 1 | package v1alpha2 2 | 3 | import ( 4 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 | ) 6 | 7 | var AvailableKinds = map[string]*metav1.APIResource{ 8 | "Deployment": { 9 | Name: "deployments", 10 | Namespaced: true, 11 | Kind: "TrafficMetrics", 12 | Verbs: []string{ 13 | "get", 14 | "list", 15 | }, 16 | }, 17 | "Pod": { 18 | Name: "pods", 19 | Namespaced: true, 20 | Kind: "TrafficMetrics", 21 | Verbs: []string{ 22 | "get", 23 | "list", 24 | }, 25 | }, 26 | "Daemonset": { 27 | Name: "daemonsets", 28 | Namespaced: true, 29 | Kind: "TrafficMetrics", 30 | Verbs: []string{ 31 | "get", 32 | "list", 33 | }, 34 | }, 35 | "Statefulset": { 36 | Name: "statefulsets", 37 | Namespaced: true, 38 | Kind: "TrafficMetrics", 39 | Verbs: []string{ 40 | "get", 41 | "list", 42 | }, 43 | }, 44 | "Namespace": { 45 | Name: "namespaces", 46 | Namespaced: false, 47 | Kind: "TrafficMetrics", 48 | Verbs: []string{ 49 | "get", 50 | "list", 51 | }, 52 | }, 53 | "Trafficsplit": { 54 | Name: "trafficsplits", 55 | Namespaced: true, 56 | Kind: "TrafficMetrics", 57 | Verbs: []string{ 58 | "get", 59 | }, 60 | }, 61 | } 62 | 63 | func getKindName(kind string) string { 64 | apiResource, ok := AvailableKinds[kind] 65 | if !ok { 66 | return "unsupported" 67 | } 68 | 69 | return apiResource.Name 70 | } 71 | -------------------------------------------------------------------------------- /pkg/gen/client/specs/clientset/versioned/typed/specs/v1alpha1/fake/fake_specs_client.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | package fake 18 | 19 | import ( 20 | v1alpha1 "github.com/servicemeshinterface/smi-sdk-go/pkg/gen/client/specs/clientset/versioned/typed/specs/v1alpha1" 21 | rest "k8s.io/client-go/rest" 22 | testing "k8s.io/client-go/testing" 23 | ) 24 | 25 | type FakeSpecsV1alpha1 struct { 26 | *testing.Fake 27 | } 28 | 29 | func (c *FakeSpecsV1alpha1) HTTPRouteGroups(namespace string) v1alpha1.HTTPRouteGroupInterface { 30 | return &FakeHTTPRouteGroups{c, namespace} 31 | } 32 | 33 | func (c *FakeSpecsV1alpha1) TCPRoutes(namespace string) v1alpha1.TCPRouteInterface { 34 | return &FakeTCPRoutes{c, namespace} 35 | } 36 | 37 | // RESTClient returns a RESTClient that is used to communicate 38 | // with API server by this client implementation. 39 | func (c *FakeSpecsV1alpha1) RESTClient() rest.Interface { 40 | var ret *rest.RESTClient 41 | return ret 42 | } 43 | -------------------------------------------------------------------------------- /pkg/gen/client/specs/clientset/versioned/typed/specs/v1alpha2/fake/fake_specs_client.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | package fake 18 | 19 | import ( 20 | v1alpha2 "github.com/servicemeshinterface/smi-sdk-go/pkg/gen/client/specs/clientset/versioned/typed/specs/v1alpha2" 21 | rest "k8s.io/client-go/rest" 22 | testing "k8s.io/client-go/testing" 23 | ) 24 | 25 | type FakeSpecsV1alpha2 struct { 26 | *testing.Fake 27 | } 28 | 29 | func (c *FakeSpecsV1alpha2) HTTPRouteGroups(namespace string) v1alpha2.HTTPRouteGroupInterface { 30 | return &FakeHTTPRouteGroups{c, namespace} 31 | } 32 | 33 | func (c *FakeSpecsV1alpha2) TCPRoutes(namespace string) v1alpha2.TCPRouteInterface { 34 | return &FakeTCPRoutes{c, namespace} 35 | } 36 | 37 | // RESTClient returns a RESTClient that is used to communicate 38 | // with API server by this client implementation. 39 | func (c *FakeSpecsV1alpha2) RESTClient() rest.Interface { 40 | var ret *rest.RESTClient 41 | return ret 42 | } 43 | -------------------------------------------------------------------------------- /pkg/gen/client/specs/clientset/versioned/typed/specs/v1alpha3/fake/fake_specs_client.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | package fake 18 | 19 | import ( 20 | v1alpha3 "github.com/servicemeshinterface/smi-sdk-go/pkg/gen/client/specs/clientset/versioned/typed/specs/v1alpha3" 21 | rest "k8s.io/client-go/rest" 22 | testing "k8s.io/client-go/testing" 23 | ) 24 | 25 | type FakeSpecsV1alpha3 struct { 26 | *testing.Fake 27 | } 28 | 29 | func (c *FakeSpecsV1alpha3) HTTPRouteGroups(namespace string) v1alpha3.HTTPRouteGroupInterface { 30 | return &FakeHTTPRouteGroups{c, namespace} 31 | } 32 | 33 | func (c *FakeSpecsV1alpha3) TCPRoutes(namespace string) v1alpha3.TCPRouteInterface { 34 | return &FakeTCPRoutes{c, namespace} 35 | } 36 | 37 | // RESTClient returns a RESTClient that is used to communicate 38 | // with API server by this client implementation. 39 | func (c *FakeSpecsV1alpha3) RESTClient() rest.Interface { 40 | var ret *rest.RESTClient 41 | return ret 42 | } 43 | -------------------------------------------------------------------------------- /pkg/gen/client/access/informers/externalversions/internalinterfaces/factory_interfaces.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by informer-gen. DO NOT EDIT. 16 | 17 | package internalinterfaces 18 | 19 | import ( 20 | time "time" 21 | 22 | versioned "github.com/servicemeshinterface/smi-sdk-go/pkg/gen/client/access/clientset/versioned" 23 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 24 | runtime "k8s.io/apimachinery/pkg/runtime" 25 | cache "k8s.io/client-go/tools/cache" 26 | ) 27 | 28 | // NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer. 29 | type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer 30 | 31 | // SharedInformerFactory a small interface to allow for adding an informer without an import cycle 32 | type SharedInformerFactory interface { 33 | Start(stopCh <-chan struct{}) 34 | InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer 35 | } 36 | 37 | // TweakListOptionsFunc is a function that transforms a v1.ListOptions. 38 | type TweakListOptionsFunc func(*v1.ListOptions) 39 | -------------------------------------------------------------------------------- /pkg/gen/client/specs/informers/externalversions/internalinterfaces/factory_interfaces.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by informer-gen. DO NOT EDIT. 16 | 17 | package internalinterfaces 18 | 19 | import ( 20 | time "time" 21 | 22 | versioned "github.com/servicemeshinterface/smi-sdk-go/pkg/gen/client/specs/clientset/versioned" 23 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 24 | runtime "k8s.io/apimachinery/pkg/runtime" 25 | cache "k8s.io/client-go/tools/cache" 26 | ) 27 | 28 | // NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer. 29 | type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer 30 | 31 | // SharedInformerFactory a small interface to allow for adding an informer without an import cycle 32 | type SharedInformerFactory interface { 33 | Start(stopCh <-chan struct{}) 34 | InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer 35 | } 36 | 37 | // TweakListOptionsFunc is a function that transforms a v1.ListOptions. 38 | type TweakListOptionsFunc func(*v1.ListOptions) 39 | -------------------------------------------------------------------------------- /pkg/gen/client/split/informers/externalversions/internalinterfaces/factory_interfaces.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by informer-gen. DO NOT EDIT. 16 | 17 | package internalinterfaces 18 | 19 | import ( 20 | time "time" 21 | 22 | versioned "github.com/servicemeshinterface/smi-sdk-go/pkg/gen/client/split/clientset/versioned" 23 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 24 | runtime "k8s.io/apimachinery/pkg/runtime" 25 | cache "k8s.io/client-go/tools/cache" 26 | ) 27 | 28 | // NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer. 29 | type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer 30 | 31 | // SharedInformerFactory a small interface to allow for adding an informer without an import cycle 32 | type SharedInformerFactory interface { 33 | Start(stopCh <-chan struct{}) 34 | InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer 35 | } 36 | 37 | // TweakListOptionsFunc is a function that transforms a v1.ListOptions. 38 | type TweakListOptionsFunc func(*v1.ListOptions) 39 | -------------------------------------------------------------------------------- /pkg/gen/client/metrics/informers/externalversions/internalinterfaces/factory_interfaces.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by informer-gen. DO NOT EDIT. 16 | 17 | package internalinterfaces 18 | 19 | import ( 20 | time "time" 21 | 22 | versioned "github.com/servicemeshinterface/smi-sdk-go/pkg/gen/client/metrics/clientset/versioned" 23 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 24 | runtime "k8s.io/apimachinery/pkg/runtime" 25 | cache "k8s.io/client-go/tools/cache" 26 | ) 27 | 28 | // NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer. 29 | type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer 30 | 31 | // SharedInformerFactory a small interface to allow for adding an informer without an import cycle 32 | type SharedInformerFactory interface { 33 | Start(stopCh <-chan struct{}) 34 | InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer 35 | } 36 | 37 | // TweakListOptionsFunc is a function that transforms a v1.ListOptions. 38 | type TweakListOptionsFunc func(*v1.ListOptions) 39 | -------------------------------------------------------------------------------- /pkg/gen/client/specs/listers/specs/v1alpha4/expansion_generated.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by lister-gen. DO NOT EDIT. 16 | 17 | package v1alpha4 18 | 19 | // HTTPRouteGroupListerExpansion allows custom methods to be added to 20 | // HTTPRouteGroupLister. 21 | type HTTPRouteGroupListerExpansion interface{} 22 | 23 | // HTTPRouteGroupNamespaceListerExpansion allows custom methods to be added to 24 | // HTTPRouteGroupNamespaceLister. 25 | type HTTPRouteGroupNamespaceListerExpansion interface{} 26 | 27 | // TCPRouteListerExpansion allows custom methods to be added to 28 | // TCPRouteLister. 29 | type TCPRouteListerExpansion interface{} 30 | 31 | // TCPRouteNamespaceListerExpansion allows custom methods to be added to 32 | // TCPRouteNamespaceLister. 33 | type TCPRouteNamespaceListerExpansion interface{} 34 | 35 | // UDPRouteListerExpansion allows custom methods to be added to 36 | // UDPRouteLister. 37 | type UDPRouteListerExpansion interface{} 38 | 39 | // UDPRouteNamespaceListerExpansion allows custom methods to be added to 40 | // UDPRouteNamespaceLister. 41 | type UDPRouteNamespaceListerExpansion interface{} 42 | -------------------------------------------------------------------------------- /pkg/apis/metrics/v1alpha1/metric.go: -------------------------------------------------------------------------------- 1 | package v1alpha1 2 | 3 | import ( 4 | "fmt" 5 | 6 | apiresource "k8s.io/apimachinery/pkg/api/resource" 7 | ) 8 | 9 | // AvailableMetrics are a list of the possible metrics that can be returned 10 | var AvailableMetrics = []*Metric{ 11 | { 12 | Name: "p99_response_latency", 13 | Unit: MilliSeconds, 14 | Value: apiresource.NewQuantity(0, apiresource.DecimalSI), 15 | }, 16 | { 17 | Name: "p90_response_latency", 18 | Unit: MilliSeconds, 19 | Value: apiresource.NewQuantity(0, apiresource.DecimalSI), 20 | }, 21 | { 22 | Name: "p50_response_latency", 23 | Unit: MilliSeconds, 24 | Value: apiresource.NewQuantity(0, apiresource.DecimalSI), 25 | }, 26 | { 27 | Name: "success_count", 28 | Value: apiresource.NewQuantity(0, apiresource.DecimalSI), 29 | }, 30 | { 31 | Name: "failure_count", 32 | Value: apiresource.NewQuantity(0, apiresource.DecimalSI), 33 | }, 34 | } 35 | 36 | // Unit is associated with metrics and defines what unit the metric is using 37 | type Unit string 38 | 39 | // MilliSeconds is a time unit 40 | const MilliSeconds Unit = "ms" 41 | 42 | // Metric describes a name and value for specific metrics 43 | type Metric struct { 44 | Name string `json:"name"` 45 | 46 | Unit Unit `json:"unit,omitempty"` 47 | Value *apiresource.Quantity `json:"value"` 48 | } 49 | 50 | // Set will set the value correctly 51 | func (m *Metric) Set(val float64) { 52 | m.Value = apiresource.NewMilliQuantity( 53 | int64(val*1000), apiresource.DecimalSI) 54 | } 55 | 56 | // String returns a formatted string representation of this struct 57 | func (m *Metric) String() string { 58 | return fmt.Sprintf("%#v", m) 59 | } 60 | -------------------------------------------------------------------------------- /pkg/apis/metrics/v1alpha2/metric.go: -------------------------------------------------------------------------------- 1 | package v1alpha2 2 | 3 | import ( 4 | "fmt" 5 | 6 | apiresource "k8s.io/apimachinery/pkg/api/resource" 7 | ) 8 | 9 | // AvailableMetrics are a list of the possible metrics that can be returned 10 | var AvailableMetrics = []*Metric{ 11 | { 12 | Name: "p99_response_latency", 13 | Unit: MilliSeconds, 14 | Value: apiresource.NewQuantity(0, apiresource.DecimalSI), 15 | }, 16 | { 17 | Name: "p90_response_latency", 18 | Unit: MilliSeconds, 19 | Value: apiresource.NewQuantity(0, apiresource.DecimalSI), 20 | }, 21 | { 22 | Name: "p50_response_latency", 23 | Unit: MilliSeconds, 24 | Value: apiresource.NewQuantity(0, apiresource.DecimalSI), 25 | }, 26 | { 27 | Name: "success_count", 28 | Value: apiresource.NewQuantity(0, apiresource.DecimalSI), 29 | }, 30 | { 31 | Name: "failure_count", 32 | Value: apiresource.NewQuantity(0, apiresource.DecimalSI), 33 | }, 34 | } 35 | 36 | // Unit is associated with metrics and defines what unit the metric is using 37 | type Unit string 38 | 39 | // MilliSeconds is a time unit 40 | const MilliSeconds Unit = "ms" 41 | 42 | // Metric describes a name and value for specific metrics 43 | type Metric struct { 44 | Name string `json:"name"` 45 | 46 | Unit Unit `json:"unit,omitempty"` 47 | Value *apiresource.Quantity `json:"value"` 48 | } 49 | 50 | // Set will set the value correctly 51 | func (m *Metric) Set(val float64) { 52 | m.Value = apiresource.NewMilliQuantity( 53 | int64(val*1000), apiresource.DecimalSI) 54 | } 55 | 56 | // String returns a formatted string representation of this struct 57 | func (m *Metric) String() string { 58 | return fmt.Sprintf("%#v", m) 59 | } 60 | -------------------------------------------------------------------------------- /pkg/apis/split/v1alpha2/traffic_split.go: -------------------------------------------------------------------------------- 1 | package v1alpha2 2 | 3 | import ( 4 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 | ) 6 | 7 | // +genclient 8 | // +genclient:noStatus 9 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 10 | 11 | // TrafficSplit allows users to incrementally direct percentages of traffic 12 | // between various services. It will be used by clients such as ingress 13 | // controllers or service mesh sidecars to split the outgoing traffic to 14 | // different destinations. 15 | type TrafficSplit struct { 16 | metav1.TypeMeta `json:",inline"` 17 | // Standard object's metadata. 18 | // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata 19 | // +optional 20 | metav1.ObjectMeta `json:"metadata,omitempty"` 21 | 22 | // Specification of the desired behavior of the traffic split. 23 | // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status 24 | // +optional 25 | Spec TrafficSplitSpec `json:"spec,omitempty"` 26 | } 27 | 28 | // TrafficSplitSpec is the specification for a TrafficSplit 29 | type TrafficSplitSpec struct { 30 | Service string `json:"service,omitempty"` 31 | Backends []TrafficSplitBackend `json:"backends,omitempty"` 32 | } 33 | 34 | // TrafficSplitBackend defines a backend 35 | type TrafficSplitBackend struct { 36 | Service string `json:"service"` 37 | Weight int `json:"weight"` 38 | } 39 | 40 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 41 | 42 | type TrafficSplitList struct { 43 | metav1.TypeMeta `json:",inline"` 44 | metav1.ListMeta `json:"metadata"` 45 | 46 | Items []TrafficSplit `json:"items"` 47 | } 48 | -------------------------------------------------------------------------------- /pkg/gen/client/specs/clientset/versioned/typed/specs/v1alpha4/fake/fake_specs_client.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | package fake 18 | 19 | import ( 20 | v1alpha4 "github.com/servicemeshinterface/smi-sdk-go/pkg/gen/client/specs/clientset/versioned/typed/specs/v1alpha4" 21 | rest "k8s.io/client-go/rest" 22 | testing "k8s.io/client-go/testing" 23 | ) 24 | 25 | type FakeSpecsV1alpha4 struct { 26 | *testing.Fake 27 | } 28 | 29 | func (c *FakeSpecsV1alpha4) HTTPRouteGroups(namespace string) v1alpha4.HTTPRouteGroupInterface { 30 | return &FakeHTTPRouteGroups{c, namespace} 31 | } 32 | 33 | func (c *FakeSpecsV1alpha4) TCPRoutes(namespace string) v1alpha4.TCPRouteInterface { 34 | return &FakeTCPRoutes{c, namespace} 35 | } 36 | 37 | func (c *FakeSpecsV1alpha4) UDPRoutes(namespace string) v1alpha4.UDPRouteInterface { 38 | return &FakeUDPRoutes{c, namespace} 39 | } 40 | 41 | // RESTClient returns a RESTClient that is used to communicate 42 | // with API server by this client implementation. 43 | func (c *FakeSpecsV1alpha4) RESTClient() rest.Interface { 44 | var ret *rest.RESTClient 45 | return ret 46 | } 47 | -------------------------------------------------------------------------------- /pkg/apis/split/v1alpha1/traffic_split.go: -------------------------------------------------------------------------------- 1 | package v1alpha1 2 | 3 | import ( 4 | "k8s.io/apimachinery/pkg/api/resource" 5 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 6 | ) 7 | 8 | // +genclient 9 | // +genclient:noStatus 10 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 11 | 12 | // TrafficSplit allows users to incrementally direct percentages of traffic 13 | // between various services. It will be used by clients such as ingress 14 | // controllers or service mesh sidecars to split the outgoing traffic to 15 | // different destinations. 16 | type TrafficSplit struct { 17 | metav1.TypeMeta `json:",inline"` 18 | // Standard object's metadata. 19 | // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata 20 | // +optional 21 | metav1.ObjectMeta `json:"metadata,omitempty"` 22 | 23 | // Specification of the desired behavior of the traffic split. 24 | // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status 25 | // +optional 26 | Spec TrafficSplitSpec `json:"spec,omitempty"` 27 | } 28 | 29 | // TrafficSplitSpec is the specification for a TrafficSplit 30 | type TrafficSplitSpec struct { 31 | Service string `json:"service,omitempty"` 32 | Backends []TrafficSplitBackend `json:"backends,omitempty"` 33 | } 34 | 35 | // TrafficSplitBackend defines a backend 36 | type TrafficSplitBackend struct { 37 | Service string `json:"service,omitempty"` 38 | Weight *resource.Quantity `json:"weight,omitempty"` 39 | } 40 | 41 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 42 | type TrafficSplitList struct { 43 | metav1.TypeMeta `json:",inline"` 44 | metav1.ListMeta `json:"metadata"` 45 | 46 | Items []TrafficSplit `json:"items"` 47 | } 48 | -------------------------------------------------------------------------------- /pkg/apis/split/v1alpha1/register.go: -------------------------------------------------------------------------------- 1 | package v1alpha1 2 | 3 | import ( 4 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 | "k8s.io/apimachinery/pkg/runtime" 6 | "k8s.io/apimachinery/pkg/runtime/schema" 7 | 8 | ts "github.com/servicemeshinterface/smi-sdk-go/pkg/apis/split" 9 | ) 10 | 11 | // SchemeGroupVersion is the identifier for the API which includes 12 | // the name of the group and the version of the API 13 | var SchemeGroupVersion = schema.GroupVersion{ 14 | Group: ts.GroupName, 15 | Version: "v1alpha1", 16 | } 17 | 18 | // Kind takes an unqualified kind and returns back a Group qualified GroupKind 19 | func Kind(kind string) schema.GroupKind { 20 | return SchemeGroupVersion.WithKind(kind).GroupKind() 21 | } 22 | 23 | // Resource takes an unqualified resource and returns a Group qualified GroupResource 24 | func Resource(resource string) schema.GroupResource { 25 | return SchemeGroupVersion.WithResource(resource).GroupResource() 26 | } 27 | 28 | var ( 29 | // SchemeBuilder collects functions that add things to a scheme. It's to allow 30 | // code to compile without explicitly referencing generated types. You should 31 | // declare one in each package that will have generated deep copy or conversion 32 | // functions. 33 | SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) 34 | 35 | // AddToScheme applies all the stored functions to the scheme. A non-nil error 36 | // indicates that one function failed and the attempt was abandoned. 37 | AddToScheme = SchemeBuilder.AddToScheme 38 | ) 39 | 40 | // Adds the list of known types to Scheme. 41 | func addKnownTypes(scheme *runtime.Scheme) error { 42 | scheme.AddKnownTypes(SchemeGroupVersion, 43 | &TrafficSplit{}, 44 | &TrafficSplitList{}, 45 | ) 46 | metav1.AddToGroupVersion(scheme, SchemeGroupVersion) 47 | return nil 48 | } 49 | -------------------------------------------------------------------------------- /pkg/apis/split/v1alpha2/register.go: -------------------------------------------------------------------------------- 1 | package v1alpha2 2 | 3 | import ( 4 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 | "k8s.io/apimachinery/pkg/runtime" 6 | "k8s.io/apimachinery/pkg/runtime/schema" 7 | 8 | ts "github.com/servicemeshinterface/smi-sdk-go/pkg/apis/split" 9 | ) 10 | 11 | // SchemeGroupVersion is the identifier for the API which includes 12 | // the name of the group and the version of the API 13 | var SchemeGroupVersion = schema.GroupVersion{ 14 | Group: ts.GroupName, 15 | Version: "v1alpha2", 16 | } 17 | 18 | // Kind takes an unqualified kind and returns back a Group qualified GroupKind 19 | func Kind(kind string) schema.GroupKind { 20 | return SchemeGroupVersion.WithKind(kind).GroupKind() 21 | } 22 | 23 | // Resource takes an unqualified resource and returns a Group qualified GroupResource 24 | func Resource(resource string) schema.GroupResource { 25 | return SchemeGroupVersion.WithResource(resource).GroupResource() 26 | } 27 | 28 | var ( 29 | // SchemeBuilder collects functions that add things to a scheme. It's to allow 30 | // code to compile without explicitly referencing generated types. You should 31 | // declare one in each package that will have generated deep copy or conversion 32 | // functions. 33 | SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) 34 | 35 | // AddToScheme applies all the stored functions to the scheme. A non-nil error 36 | // indicates that one function failed and the attempt was abandoned. 37 | AddToScheme = SchemeBuilder.AddToScheme 38 | ) 39 | 40 | // Adds the list of known types to Scheme. 41 | func addKnownTypes(scheme *runtime.Scheme) error { 42 | scheme.AddKnownTypes(SchemeGroupVersion, 43 | &TrafficSplit{}, 44 | &TrafficSplitList{}, 45 | ) 46 | metav1.AddToGroupVersion(scheme, SchemeGroupVersion) 47 | return nil 48 | } 49 | -------------------------------------------------------------------------------- /pkg/apis/split/v1alpha3/register.go: -------------------------------------------------------------------------------- 1 | package v1alpha3 2 | 3 | import ( 4 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 | "k8s.io/apimachinery/pkg/runtime" 6 | "k8s.io/apimachinery/pkg/runtime/schema" 7 | 8 | ts "github.com/servicemeshinterface/smi-sdk-go/pkg/apis/split" 9 | ) 10 | 11 | // SchemeGroupVersion is the identifier for the API which includes 12 | // the name of the group and the version of the API 13 | var SchemeGroupVersion = schema.GroupVersion{ 14 | Group: ts.GroupName, 15 | Version: "v1alpha3", 16 | } 17 | 18 | // Kind takes an unqualified kind and returns back a Group qualified GroupKind 19 | func Kind(kind string) schema.GroupKind { 20 | return SchemeGroupVersion.WithKind(kind).GroupKind() 21 | } 22 | 23 | // Resource takes an unqualified resource and returns a Group qualified GroupResource 24 | func Resource(resource string) schema.GroupResource { 25 | return SchemeGroupVersion.WithResource(resource).GroupResource() 26 | } 27 | 28 | var ( 29 | // SchemeBuilder collects functions that add things to a scheme. It's to allow 30 | // code to compile without explicitly referencing generated types. You should 31 | // declare one in each package that will have generated deep copy or conversion 32 | // functions. 33 | SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) 34 | 35 | // AddToScheme applies all the stored functions to the scheme. A non-nil error 36 | // indicates that one function failed and the attempt was abandoned. 37 | AddToScheme = SchemeBuilder.AddToScheme 38 | ) 39 | 40 | // Adds the list of known types to Scheme. 41 | func addKnownTypes(scheme *runtime.Scheme) error { 42 | scheme.AddKnownTypes(SchemeGroupVersion, 43 | &TrafficSplit{}, 44 | &TrafficSplitList{}, 45 | ) 46 | metav1.AddToGroupVersion(scheme, SchemeGroupVersion) 47 | return nil 48 | } 49 | -------------------------------------------------------------------------------- /pkg/apis/split/v1alpha4/register.go: -------------------------------------------------------------------------------- 1 | package v1alpha4 2 | 3 | import ( 4 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 | "k8s.io/apimachinery/pkg/runtime" 6 | "k8s.io/apimachinery/pkg/runtime/schema" 7 | 8 | ts "github.com/servicemeshinterface/smi-sdk-go/pkg/apis/split" 9 | ) 10 | 11 | // SchemeGroupVersion is the identifier for the API which includes 12 | // the name of the group and the version of the API 13 | var SchemeGroupVersion = schema.GroupVersion{ 14 | Group: ts.GroupName, 15 | Version: "v1alpha4", 16 | } 17 | 18 | // Kind takes an unqualified kind and returns back a Group qualified GroupKind 19 | func Kind(kind string) schema.GroupKind { 20 | return SchemeGroupVersion.WithKind(kind).GroupKind() 21 | } 22 | 23 | // Resource takes an unqualified resource and returns a Group qualified GroupResource 24 | func Resource(resource string) schema.GroupResource { 25 | return SchemeGroupVersion.WithResource(resource).GroupResource() 26 | } 27 | 28 | var ( 29 | // SchemeBuilder collects functions that add things to a scheme. It's to allow 30 | // code to compile without explicitly referencing generated types. You should 31 | // declare one in each package that will have generated deep copy or conversion 32 | // functions. 33 | SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) 34 | 35 | // AddToScheme applies all the stored functions to the scheme. A non-nil error 36 | // indicates that one function failed and the attempt was abandoned. 37 | AddToScheme = SchemeBuilder.AddToScheme 38 | ) 39 | 40 | // Adds the list of known types to Scheme. 41 | func addKnownTypes(scheme *runtime.Scheme) error { 42 | scheme.AddKnownTypes(SchemeGroupVersion, 43 | &TrafficSplit{}, 44 | &TrafficSplitList{}, 45 | ) 46 | metav1.AddToGroupVersion(scheme, SchemeGroupVersion) 47 | return nil 48 | } 49 | -------------------------------------------------------------------------------- /pkg/apis/access/v1alpha1/register.go: -------------------------------------------------------------------------------- 1 | package v1alpha1 2 | 3 | import ( 4 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 | "k8s.io/apimachinery/pkg/runtime" 6 | "k8s.io/apimachinery/pkg/runtime/schema" 7 | 8 | ts "github.com/servicemeshinterface/smi-sdk-go/pkg/apis/access" 9 | ) 10 | 11 | // SchemeGroupVersion is the identifier for the API which includes 12 | // the name of the group and the version of the API 13 | var SchemeGroupVersion = schema.GroupVersion{ 14 | Group: ts.GroupName, 15 | Version: "v1alpha1", 16 | } 17 | 18 | // Kind takes an unqualified kind and returns back a Group qualified GroupKind 19 | func Kind(kind string) schema.GroupKind { 20 | return SchemeGroupVersion.WithKind(kind).GroupKind() 21 | } 22 | 23 | // Resource takes an unqualified resource and returns a Group qualified GroupResource 24 | func Resource(resource string) schema.GroupResource { 25 | return SchemeGroupVersion.WithResource(resource).GroupResource() 26 | } 27 | 28 | var ( 29 | // SchemeBuilder collects functions that add things to a scheme. It's to allow 30 | // code to compile without explicitly referencing generated types. You should 31 | // declare one in each package that will have generated deep copy or conversion 32 | // functions. 33 | SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) 34 | 35 | // AddToScheme applies all the stored functions to the scheme. A non-nil error 36 | // indicates that one function failed and the attempt was abandoned. 37 | AddToScheme = SchemeBuilder.AddToScheme 38 | ) 39 | 40 | // Adds the list of known types to Scheme. 41 | func addKnownTypes(scheme *runtime.Scheme) error { 42 | scheme.AddKnownTypes(SchemeGroupVersion, 43 | &TrafficTarget{}, 44 | &TrafficTargetList{}, 45 | ) 46 | metav1.AddToGroupVersion(scheme, SchemeGroupVersion) 47 | return nil 48 | } 49 | -------------------------------------------------------------------------------- /pkg/apis/access/v1alpha2/register.go: -------------------------------------------------------------------------------- 1 | package v1alpha2 2 | 3 | import ( 4 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 | "k8s.io/apimachinery/pkg/runtime" 6 | "k8s.io/apimachinery/pkg/runtime/schema" 7 | 8 | ts "github.com/servicemeshinterface/smi-sdk-go/pkg/apis/access" 9 | ) 10 | 11 | // SchemeGroupVersion is the identifier for the API which includes 12 | // the name of the group and the version of the API 13 | var SchemeGroupVersion = schema.GroupVersion{ 14 | Group: ts.GroupName, 15 | Version: "v1alpha2", 16 | } 17 | 18 | // Kind takes an unqualified kind and returns back a Group qualified GroupKind 19 | func Kind(kind string) schema.GroupKind { 20 | return SchemeGroupVersion.WithKind(kind).GroupKind() 21 | } 22 | 23 | // Resource takes an unqualified resource and returns a Group qualified GroupResource 24 | func Resource(resource string) schema.GroupResource { 25 | return SchemeGroupVersion.WithResource(resource).GroupResource() 26 | } 27 | 28 | var ( 29 | // SchemeBuilder collects functions that add things to a scheme. It's to allow 30 | // code to compile without explicitly referencing generated types. You should 31 | // declare one in each package that will have generated deep copy or conversion 32 | // functions. 33 | SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) 34 | 35 | // AddToScheme applies all the stored functions to the scheme. A non-nil error 36 | // indicates that one function failed and the attempt was abandoned. 37 | AddToScheme = SchemeBuilder.AddToScheme 38 | ) 39 | 40 | // Adds the list of known types to Scheme. 41 | func addKnownTypes(scheme *runtime.Scheme) error { 42 | scheme.AddKnownTypes(SchemeGroupVersion, 43 | &TrafficTarget{}, 44 | &TrafficTargetList{}, 45 | ) 46 | metav1.AddToGroupVersion(scheme, SchemeGroupVersion) 47 | return nil 48 | } 49 | -------------------------------------------------------------------------------- /pkg/apis/access/v1alpha3/register.go: -------------------------------------------------------------------------------- 1 | package v1alpha3 2 | 3 | import ( 4 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 | "k8s.io/apimachinery/pkg/runtime" 6 | "k8s.io/apimachinery/pkg/runtime/schema" 7 | 8 | ts "github.com/servicemeshinterface/smi-sdk-go/pkg/apis/access" 9 | ) 10 | 11 | // SchemeGroupVersion is the identifier for the API which includes 12 | // the name of the group and the version of the API 13 | var SchemeGroupVersion = schema.GroupVersion{ 14 | Group: ts.GroupName, 15 | Version: "v1alpha3", 16 | } 17 | 18 | // Kind takes an unqualified kind and returns back a Group qualified GroupKind 19 | func Kind(kind string) schema.GroupKind { 20 | return SchemeGroupVersion.WithKind(kind).GroupKind() 21 | } 22 | 23 | // Resource takes an unqualified resource and returns a Group qualified GroupResource 24 | func Resource(resource string) schema.GroupResource { 25 | return SchemeGroupVersion.WithResource(resource).GroupResource() 26 | } 27 | 28 | var ( 29 | // SchemeBuilder collects functions that add things to a scheme. It's to allow 30 | // code to compile without explicitly referencing generated types. You should 31 | // declare one in each package that will have generated deep copy or conversion 32 | // functions. 33 | SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) 34 | 35 | // AddToScheme applies all the stored functions to the scheme. A non-nil error 36 | // indicates that one function failed and the attempt was abandoned. 37 | AddToScheme = SchemeBuilder.AddToScheme 38 | ) 39 | 40 | // Adds the list of known types to Scheme. 41 | func addKnownTypes(scheme *runtime.Scheme) error { 42 | scheme.AddKnownTypes(SchemeGroupVersion, 43 | &TrafficTarget{}, 44 | &TrafficTargetList{}, 45 | ) 46 | metav1.AddToGroupVersion(scheme, SchemeGroupVersion) 47 | return nil 48 | } 49 | -------------------------------------------------------------------------------- /pkg/apis/metrics/v1alpha1/register.go: -------------------------------------------------------------------------------- 1 | package v1alpha1 2 | 3 | import ( 4 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 | "k8s.io/apimachinery/pkg/runtime" 6 | "k8s.io/apimachinery/pkg/runtime/schema" 7 | 8 | "github.com/servicemeshinterface/smi-sdk-go/pkg/apis/metrics" 9 | ) 10 | 11 | // SchemeGroupVersion is the identifier for the API which includes 12 | // the name of the group and the version of the API 13 | var SchemeGroupVersion = schema.GroupVersion{ 14 | Group: metrics.GroupName, 15 | Version: "v1alpha1", 16 | } 17 | 18 | // Kind takes an unqualified kind and returns back a Group qualified GroupKind 19 | func Kind(kind string) schema.GroupKind { 20 | return SchemeGroupVersion.WithKind(kind).GroupKind() 21 | } 22 | 23 | // Resource takes an unqualified resource and returns a Group qualified GroupResource 24 | func Resource(resource string) schema.GroupResource { 25 | return SchemeGroupVersion.WithResource(resource).GroupResource() 26 | } 27 | 28 | var ( 29 | // SchemeBuilder collects functions that add things to a scheme. It's to allow 30 | // code to compile without explicitly referencing generated types. You should 31 | // declare one in each package that will have generated deep copy or conversion 32 | // functions. 33 | SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) 34 | 35 | // AddToScheme applies all the stored functions to the scheme. A non-nil error 36 | // indicates that one function failed and the attempt was abandoned. 37 | AddToScheme = SchemeBuilder.AddToScheme 38 | ) 39 | 40 | // Adds the list of known types to Scheme. 41 | func addKnownTypes(scheme *runtime.Scheme) error { 42 | scheme.AddKnownTypes(SchemeGroupVersion, 43 | &TrafficMetrics{}, 44 | &TrafficMetricsList{}, 45 | ) 46 | metav1.AddToGroupVersion(scheme, SchemeGroupVersion) 47 | return nil 48 | } 49 | -------------------------------------------------------------------------------- /pkg/apis/metrics/v1alpha2/register.go: -------------------------------------------------------------------------------- 1 | package v1alpha2 2 | 3 | import ( 4 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 | "k8s.io/apimachinery/pkg/runtime" 6 | "k8s.io/apimachinery/pkg/runtime/schema" 7 | 8 | "github.com/servicemeshinterface/smi-sdk-go/pkg/apis/metrics" 9 | ) 10 | 11 | // SchemeGroupVersion is the identifier for the API which includes 12 | // the name of the group and the version of the API 13 | var SchemeGroupVersion = schema.GroupVersion{ 14 | Group: metrics.GroupName, 15 | Version: "v1alpha2", 16 | } 17 | 18 | // Kind takes an unqualified kind and returns back a Group qualified GroupKind 19 | func Kind(kind string) schema.GroupKind { 20 | return SchemeGroupVersion.WithKind(kind).GroupKind() 21 | } 22 | 23 | // Resource takes an unqualified resource and returns a Group qualified GroupResource 24 | func Resource(resource string) schema.GroupResource { 25 | return SchemeGroupVersion.WithResource(resource).GroupResource() 26 | } 27 | 28 | var ( 29 | // SchemeBuilder collects functions that add things to a scheme. It's to allow 30 | // code to compile without explicitly referencing generated types. You should 31 | // declare one in each package that will have generated deep copy or conversion 32 | // functions. 33 | SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) 34 | 35 | // AddToScheme applies all the stored functions to the scheme. A non-nil error 36 | // indicates that one function failed and the attempt was abandoned. 37 | AddToScheme = SchemeBuilder.AddToScheme 38 | ) 39 | 40 | // Adds the list of known types to Scheme. 41 | func addKnownTypes(scheme *runtime.Scheme) error { 42 | scheme.AddKnownTypes(SchemeGroupVersion, 43 | &TrafficMetrics{}, 44 | &TrafficMetricsList{}, 45 | ) 46 | metav1.AddToGroupVersion(scheme, SchemeGroupVersion) 47 | return nil 48 | } 49 | -------------------------------------------------------------------------------- /pkg/gen/client/split/informers/externalversions/split/v1alpha1/interface.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by informer-gen. DO NOT EDIT. 16 | 17 | package v1alpha1 18 | 19 | import ( 20 | internalinterfaces "github.com/servicemeshinterface/smi-sdk-go/pkg/gen/client/split/informers/externalversions/internalinterfaces" 21 | ) 22 | 23 | // Interface provides access to all the informers in this group version. 24 | type Interface interface { 25 | // TrafficSplits returns a TrafficSplitInformer. 26 | TrafficSplits() TrafficSplitInformer 27 | } 28 | 29 | type version struct { 30 | factory internalinterfaces.SharedInformerFactory 31 | namespace string 32 | tweakListOptions internalinterfaces.TweakListOptionsFunc 33 | } 34 | 35 | // New returns a new Interface. 36 | func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { 37 | return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} 38 | } 39 | 40 | // TrafficSplits returns a TrafficSplitInformer. 41 | func (v *version) TrafficSplits() TrafficSplitInformer { 42 | return &trafficSplitInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} 43 | } 44 | -------------------------------------------------------------------------------- /pkg/gen/client/split/informers/externalversions/split/v1alpha2/interface.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by informer-gen. DO NOT EDIT. 16 | 17 | package v1alpha2 18 | 19 | import ( 20 | internalinterfaces "github.com/servicemeshinterface/smi-sdk-go/pkg/gen/client/split/informers/externalversions/internalinterfaces" 21 | ) 22 | 23 | // Interface provides access to all the informers in this group version. 24 | type Interface interface { 25 | // TrafficSplits returns a TrafficSplitInformer. 26 | TrafficSplits() TrafficSplitInformer 27 | } 28 | 29 | type version struct { 30 | factory internalinterfaces.SharedInformerFactory 31 | namespace string 32 | tweakListOptions internalinterfaces.TweakListOptionsFunc 33 | } 34 | 35 | // New returns a new Interface. 36 | func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { 37 | return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} 38 | } 39 | 40 | // TrafficSplits returns a TrafficSplitInformer. 41 | func (v *version) TrafficSplits() TrafficSplitInformer { 42 | return &trafficSplitInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} 43 | } 44 | -------------------------------------------------------------------------------- /pkg/gen/client/split/informers/externalversions/split/v1alpha3/interface.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by informer-gen. DO NOT EDIT. 16 | 17 | package v1alpha3 18 | 19 | import ( 20 | internalinterfaces "github.com/servicemeshinterface/smi-sdk-go/pkg/gen/client/split/informers/externalversions/internalinterfaces" 21 | ) 22 | 23 | // Interface provides access to all the informers in this group version. 24 | type Interface interface { 25 | // TrafficSplits returns a TrafficSplitInformer. 26 | TrafficSplits() TrafficSplitInformer 27 | } 28 | 29 | type version struct { 30 | factory internalinterfaces.SharedInformerFactory 31 | namespace string 32 | tweakListOptions internalinterfaces.TweakListOptionsFunc 33 | } 34 | 35 | // New returns a new Interface. 36 | func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { 37 | return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} 38 | } 39 | 40 | // TrafficSplits returns a TrafficSplitInformer. 41 | func (v *version) TrafficSplits() TrafficSplitInformer { 42 | return &trafficSplitInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} 43 | } 44 | -------------------------------------------------------------------------------- /pkg/gen/client/split/informers/externalversions/split/v1alpha4/interface.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by informer-gen. DO NOT EDIT. 16 | 17 | package v1alpha4 18 | 19 | import ( 20 | internalinterfaces "github.com/servicemeshinterface/smi-sdk-go/pkg/gen/client/split/informers/externalversions/internalinterfaces" 21 | ) 22 | 23 | // Interface provides access to all the informers in this group version. 24 | type Interface interface { 25 | // TrafficSplits returns a TrafficSplitInformer. 26 | TrafficSplits() TrafficSplitInformer 27 | } 28 | 29 | type version struct { 30 | factory internalinterfaces.SharedInformerFactory 31 | namespace string 32 | tweakListOptions internalinterfaces.TweakListOptionsFunc 33 | } 34 | 35 | // New returns a new Interface. 36 | func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { 37 | return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} 38 | } 39 | 40 | // TrafficSplits returns a TrafficSplitInformer. 41 | func (v *version) TrafficSplits() TrafficSplitInformer { 42 | return &trafficSplitInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} 43 | } 44 | -------------------------------------------------------------------------------- /pkg/gen/client/access/informers/externalversions/access/v1alpha1/interface.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by informer-gen. DO NOT EDIT. 16 | 17 | package v1alpha1 18 | 19 | import ( 20 | internalinterfaces "github.com/servicemeshinterface/smi-sdk-go/pkg/gen/client/access/informers/externalversions/internalinterfaces" 21 | ) 22 | 23 | // Interface provides access to all the informers in this group version. 24 | type Interface interface { 25 | // TrafficTargets returns a TrafficTargetInformer. 26 | TrafficTargets() TrafficTargetInformer 27 | } 28 | 29 | type version struct { 30 | factory internalinterfaces.SharedInformerFactory 31 | namespace string 32 | tweakListOptions internalinterfaces.TweakListOptionsFunc 33 | } 34 | 35 | // New returns a new Interface. 36 | func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { 37 | return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} 38 | } 39 | 40 | // TrafficTargets returns a TrafficTargetInformer. 41 | func (v *version) TrafficTargets() TrafficTargetInformer { 42 | return &trafficTargetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} 43 | } 44 | -------------------------------------------------------------------------------- /pkg/gen/client/access/informers/externalversions/access/v1alpha2/interface.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by informer-gen. DO NOT EDIT. 16 | 17 | package v1alpha2 18 | 19 | import ( 20 | internalinterfaces "github.com/servicemeshinterface/smi-sdk-go/pkg/gen/client/access/informers/externalversions/internalinterfaces" 21 | ) 22 | 23 | // Interface provides access to all the informers in this group version. 24 | type Interface interface { 25 | // TrafficTargets returns a TrafficTargetInformer. 26 | TrafficTargets() TrafficTargetInformer 27 | } 28 | 29 | type version struct { 30 | factory internalinterfaces.SharedInformerFactory 31 | namespace string 32 | tweakListOptions internalinterfaces.TweakListOptionsFunc 33 | } 34 | 35 | // New returns a new Interface. 36 | func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { 37 | return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} 38 | } 39 | 40 | // TrafficTargets returns a TrafficTargetInformer. 41 | func (v *version) TrafficTargets() TrafficTargetInformer { 42 | return &trafficTargetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} 43 | } 44 | -------------------------------------------------------------------------------- /pkg/gen/client/access/informers/externalversions/access/v1alpha3/interface.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by informer-gen. DO NOT EDIT. 16 | 17 | package v1alpha3 18 | 19 | import ( 20 | internalinterfaces "github.com/servicemeshinterface/smi-sdk-go/pkg/gen/client/access/informers/externalversions/internalinterfaces" 21 | ) 22 | 23 | // Interface provides access to all the informers in this group version. 24 | type Interface interface { 25 | // TrafficTargets returns a TrafficTargetInformer. 26 | TrafficTargets() TrafficTargetInformer 27 | } 28 | 29 | type version struct { 30 | factory internalinterfaces.SharedInformerFactory 31 | namespace string 32 | tweakListOptions internalinterfaces.TweakListOptionsFunc 33 | } 34 | 35 | // New returns a new Interface. 36 | func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { 37 | return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} 38 | } 39 | 40 | // TrafficTargets returns a TrafficTargetInformer. 41 | func (v *version) TrafficTargets() TrafficTargetInformer { 42 | return &trafficTargetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} 43 | } 44 | -------------------------------------------------------------------------------- /pkg/gen/client/metrics/informers/externalversions/metrics/v1alpha1/interface.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by informer-gen. DO NOT EDIT. 16 | 17 | package v1alpha1 18 | 19 | import ( 20 | internalinterfaces "github.com/servicemeshinterface/smi-sdk-go/pkg/gen/client/metrics/informers/externalversions/internalinterfaces" 21 | ) 22 | 23 | // Interface provides access to all the informers in this group version. 24 | type Interface interface { 25 | // TrafficMetricses returns a TrafficMetricsInformer. 26 | TrafficMetricses() TrafficMetricsInformer 27 | } 28 | 29 | type version struct { 30 | factory internalinterfaces.SharedInformerFactory 31 | namespace string 32 | tweakListOptions internalinterfaces.TweakListOptionsFunc 33 | } 34 | 35 | // New returns a new Interface. 36 | func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { 37 | return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} 38 | } 39 | 40 | // TrafficMetricses returns a TrafficMetricsInformer. 41 | func (v *version) TrafficMetricses() TrafficMetricsInformer { 42 | return &trafficMetricsInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} 43 | } 44 | -------------------------------------------------------------------------------- /pkg/gen/client/metrics/informers/externalversions/metrics/v1alpha2/interface.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by informer-gen. DO NOT EDIT. 16 | 17 | package v1alpha2 18 | 19 | import ( 20 | internalinterfaces "github.com/servicemeshinterface/smi-sdk-go/pkg/gen/client/metrics/informers/externalversions/internalinterfaces" 21 | ) 22 | 23 | // Interface provides access to all the informers in this group version. 24 | type Interface interface { 25 | // TrafficMetricses returns a TrafficMetricsInformer. 26 | TrafficMetricses() TrafficMetricsInformer 27 | } 28 | 29 | type version struct { 30 | factory internalinterfaces.SharedInformerFactory 31 | namespace string 32 | tweakListOptions internalinterfaces.TweakListOptionsFunc 33 | } 34 | 35 | // New returns a new Interface. 36 | func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { 37 | return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} 38 | } 39 | 40 | // TrafficMetricses returns a TrafficMetricsInformer. 41 | func (v *version) TrafficMetricses() TrafficMetricsInformer { 42 | return &trafficMetricsInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} 43 | } 44 | -------------------------------------------------------------------------------- /pkg/apis/specs/v1alpha1/register.go: -------------------------------------------------------------------------------- 1 | package v1alpha1 2 | 3 | import ( 4 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 | "k8s.io/apimachinery/pkg/runtime" 6 | "k8s.io/apimachinery/pkg/runtime/schema" 7 | 8 | ts "github.com/servicemeshinterface/smi-sdk-go/pkg/apis/specs" 9 | ) 10 | 11 | // SchemeGroupVersion is the identifier for the API which includes 12 | // the name of the group and the version of the API 13 | var SchemeGroupVersion = schema.GroupVersion{ 14 | Group: ts.GroupName, 15 | Version: "v1alpha1", 16 | } 17 | 18 | // Kind takes an unqualified kind and returns back a Group qualified GroupKind 19 | func Kind(kind string) schema.GroupKind { 20 | return SchemeGroupVersion.WithKind(kind).GroupKind() 21 | } 22 | 23 | // Resource takes an unqualified resource and returns a Group qualified GroupResource 24 | func Resource(resource string) schema.GroupResource { 25 | return SchemeGroupVersion.WithResource(resource).GroupResource() 26 | } 27 | 28 | var ( 29 | // SchemeBuilder collects functions that add things to a scheme. It's to allow 30 | // code to compile without explicitly referencing generated types. You should 31 | // declare one in each package that will have generated deep copy or conversion 32 | // functions. 33 | SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) 34 | 35 | // AddToScheme applies all the stored functions to the scheme. A non-nil error 36 | // indicates that one function failed and the attempt was abandoned. 37 | AddToScheme = SchemeBuilder.AddToScheme 38 | ) 39 | 40 | // Adds the list of known types to Scheme. 41 | func addKnownTypes(scheme *runtime.Scheme) error { 42 | scheme.AddKnownTypes(SchemeGroupVersion, 43 | &HTTPRouteGroup{}, 44 | &HTTPRouteGroupList{}, 45 | &TCPRoute{}, 46 | &TCPRouteList{}, 47 | ) 48 | metav1.AddToGroupVersion(scheme, SchemeGroupVersion) 49 | return nil 50 | } 51 | -------------------------------------------------------------------------------- /pkg/apis/specs/v1alpha2/register.go: -------------------------------------------------------------------------------- 1 | package v1alpha2 2 | 3 | import ( 4 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 | "k8s.io/apimachinery/pkg/runtime" 6 | "k8s.io/apimachinery/pkg/runtime/schema" 7 | 8 | ts "github.com/servicemeshinterface/smi-sdk-go/pkg/apis/specs" 9 | ) 10 | 11 | // SchemeGroupVersion is the identifier for the API which includes 12 | // the name of the group and the version of the API 13 | var SchemeGroupVersion = schema.GroupVersion{ 14 | Group: ts.GroupName, 15 | Version: "v1alpha2", 16 | } 17 | 18 | // Kind takes an unqualified kind and returns back a Group qualified GroupKind 19 | func Kind(kind string) schema.GroupKind { 20 | return SchemeGroupVersion.WithKind(kind).GroupKind() 21 | } 22 | 23 | // Resource takes an unqualified resource and returns a Group qualified GroupResource 24 | func Resource(resource string) schema.GroupResource { 25 | return SchemeGroupVersion.WithResource(resource).GroupResource() 26 | } 27 | 28 | var ( 29 | // SchemeBuilder collects functions that add things to a scheme. It's to allow 30 | // code to compile without explicitly referencing generated types. You should 31 | // declare one in each package that will have generated deep copy or conversion 32 | // functions. 33 | SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) 34 | 35 | // AddToScheme applies all the stored functions to the scheme. A non-nil error 36 | // indicates that one function failed and the attempt was abandoned. 37 | AddToScheme = SchemeBuilder.AddToScheme 38 | ) 39 | 40 | // Adds the list of known types to Scheme. 41 | func addKnownTypes(scheme *runtime.Scheme) error { 42 | scheme.AddKnownTypes(SchemeGroupVersion, 43 | &HTTPRouteGroup{}, 44 | &HTTPRouteGroupList{}, 45 | &TCPRoute{}, 46 | &TCPRouteList{}, 47 | ) 48 | metav1.AddToGroupVersion(scheme, SchemeGroupVersion) 49 | return nil 50 | } 51 | -------------------------------------------------------------------------------- /pkg/apis/specs/v1alpha3/register.go: -------------------------------------------------------------------------------- 1 | package v1alpha3 2 | 3 | import ( 4 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 | "k8s.io/apimachinery/pkg/runtime" 6 | "k8s.io/apimachinery/pkg/runtime/schema" 7 | 8 | ts "github.com/servicemeshinterface/smi-sdk-go/pkg/apis/specs" 9 | ) 10 | 11 | // SchemeGroupVersion is the identifier for the API which includes 12 | // the name of the group and the version of the API 13 | var SchemeGroupVersion = schema.GroupVersion{ 14 | Group: ts.GroupName, 15 | Version: "v1alpha3", 16 | } 17 | 18 | // Kind takes an unqualified kind and returns back a Group qualified GroupKind 19 | func Kind(kind string) schema.GroupKind { 20 | return SchemeGroupVersion.WithKind(kind).GroupKind() 21 | } 22 | 23 | // Resource takes an unqualified resource and returns a Group qualified GroupResource 24 | func Resource(resource string) schema.GroupResource { 25 | return SchemeGroupVersion.WithResource(resource).GroupResource() 26 | } 27 | 28 | var ( 29 | // SchemeBuilder collects functions that add things to a scheme. It's to allow 30 | // code to compile without explicitly referencing generated types. You should 31 | // declare one in each package that will have generated deep copy or conversion 32 | // functions. 33 | SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) 34 | 35 | // AddToScheme applies all the stored functions to the scheme. A non-nil error 36 | // indicates that one function failed and the attempt was abandoned. 37 | AddToScheme = SchemeBuilder.AddToScheme 38 | ) 39 | 40 | // Adds the list of known types to Scheme. 41 | func addKnownTypes(scheme *runtime.Scheme) error { 42 | scheme.AddKnownTypes(SchemeGroupVersion, 43 | &HTTPRouteGroup{}, 44 | &HTTPRouteGroupList{}, 45 | &TCPRoute{}, 46 | &TCPRouteList{}, 47 | ) 48 | metav1.AddToGroupVersion(scheme, SchemeGroupVersion) 49 | return nil 50 | } 51 | -------------------------------------------------------------------------------- /pkg/apis/specs/v1alpha4/register.go: -------------------------------------------------------------------------------- 1 | package v1alpha4 2 | 3 | import ( 4 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 5 | "k8s.io/apimachinery/pkg/runtime" 6 | "k8s.io/apimachinery/pkg/runtime/schema" 7 | 8 | ts "github.com/servicemeshinterface/smi-sdk-go/pkg/apis/specs" 9 | ) 10 | 11 | // SchemeGroupVersion is the identifier for the API which includes 12 | // the name of the group and the version of the API 13 | var SchemeGroupVersion = schema.GroupVersion{ 14 | Group: ts.GroupName, 15 | Version: "v1alpha4", 16 | } 17 | 18 | // Kind takes an unqualified kind and returns back a Group qualified GroupKind 19 | func Kind(kind string) schema.GroupKind { 20 | return SchemeGroupVersion.WithKind(kind).GroupKind() 21 | } 22 | 23 | // Resource takes an unqualified resource and returns a Group qualified GroupResource 24 | func Resource(resource string) schema.GroupResource { 25 | return SchemeGroupVersion.WithResource(resource).GroupResource() 26 | } 27 | 28 | var ( 29 | // SchemeBuilder collects functions that add things to a scheme. It's to allow 30 | // code to compile without explicitly referencing generated types. You should 31 | // declare one in each package that will have generated deep copy or conversion 32 | // functions. 33 | SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) 34 | 35 | // AddToScheme applies all the stored functions to the scheme. A non-nil error 36 | // indicates that one function failed and the attempt was abandoned. 37 | AddToScheme = SchemeBuilder.AddToScheme 38 | ) 39 | 40 | // Adds the list of known types to Scheme. 41 | func addKnownTypes(scheme *runtime.Scheme) error { 42 | scheme.AddKnownTypes(SchemeGroupVersion, 43 | &HTTPRouteGroup{}, 44 | &HTTPRouteGroupList{}, 45 | &TCPRoute{}, 46 | &TCPRouteList{}, 47 | ) 48 | metav1.AddToGroupVersion(scheme, SchemeGroupVersion) 49 | return nil 50 | } 51 | -------------------------------------------------------------------------------- /pkg/apis/metrics/v1alpha1/list_test.go: -------------------------------------------------------------------------------- 1 | package v1alpha1 2 | 3 | import ( 4 | "testing" 5 | 6 | assertLib "github.com/stretchr/testify/assert" 7 | v1 "k8s.io/api/core/v1" 8 | ) 9 | 10 | func TestNewList(t *testing.T) { 11 | assert := assertLib.New(t) 12 | 13 | testCases := []struct { 14 | obj *v1.ObjectReference 15 | edges bool 16 | link string 17 | }{ 18 | { 19 | &v1.ObjectReference{ 20 | APIVersion: "apps/v1", 21 | Kind: "Deployment", 22 | Name: "foo", 23 | Namespace: "bar", 24 | }, 25 | false, 26 | "deployments", 27 | }, 28 | { 29 | &v1.ObjectReference{ 30 | Kind: "Random", 31 | }, 32 | false, 33 | "unsupported", 34 | }, 35 | { 36 | &v1.ObjectReference{ 37 | APIVersion: "apps/v1", 38 | Kind: "Deployment", 39 | Name: "foo", 40 | Namespace: "bar", 41 | }, 42 | true, 43 | "namespaces/bar/deployments/foo/edges", 44 | }, 45 | } 46 | 47 | for _, tc := range testCases { 48 | tc := tc 49 | 50 | t.Run(tc.obj.Kind, func(t *testing.T) { 51 | lst := NewTrafficMetricsList(tc.obj, tc.edges) 52 | 53 | assert.Equal("TrafficMetricsList", lst.TypeMeta.Kind) 54 | assert.Equal(APIVersion, lst.TypeMeta.APIVersion) 55 | assert.Contains(lst.SelfLink, tc.link) 56 | assert.Equal(tc.obj, lst.Resource) 57 | 58 | assert.Len(lst.Items, 0) 59 | }) 60 | } 61 | } 62 | 63 | func TestListGet(t *testing.T) { 64 | assert := assertLib.New(t) 65 | 66 | lst := NewTrafficMetricsList(&v1.ObjectReference{}, false) 67 | 68 | assert.Len(lst.Items, 0) 69 | 70 | obj := &v1.ObjectReference{ 71 | Kind: "deployment", 72 | Namespace: "default", 73 | Name: "foo", 74 | } 75 | 76 | assert.Equal(obj, lst.Get(obj, nil).Resource) 77 | assert.Len(lst.Items, 1) 78 | 79 | assert.Equal(obj, lst.Get(obj, nil).Resource) 80 | assert.Len(lst.Items, 1) 81 | 82 | assert.Equal(obj, lst.Get(obj, obj).Edge.Resource) 83 | assert.Len(lst.Items, 2) 84 | 85 | assert.Equal(obj, lst.Get(obj, obj).Edge.Resource) 86 | assert.Len(lst.Items, 2) 87 | } 88 | -------------------------------------------------------------------------------- /pkg/apis/metrics/v1alpha2/list_test.go: -------------------------------------------------------------------------------- 1 | package v1alpha2 2 | 3 | import ( 4 | "testing" 5 | 6 | assertLib "github.com/stretchr/testify/assert" 7 | v1 "k8s.io/api/core/v1" 8 | ) 9 | 10 | func TestNewList(t *testing.T) { 11 | assert := assertLib.New(t) 12 | 13 | testCases := []struct { 14 | obj *v1.ObjectReference 15 | edges bool 16 | link string 17 | }{ 18 | { 19 | &v1.ObjectReference{ 20 | APIVersion: "apps/v1", 21 | Kind: "Deployment", 22 | Name: "foo", 23 | Namespace: "bar", 24 | }, 25 | false, 26 | "deployments", 27 | }, 28 | { 29 | &v1.ObjectReference{ 30 | Kind: "Random", 31 | }, 32 | false, 33 | "unsupported", 34 | }, 35 | { 36 | &v1.ObjectReference{ 37 | APIVersion: "apps/v1", 38 | Kind: "Deployment", 39 | Name: "foo", 40 | Namespace: "bar", 41 | }, 42 | true, 43 | "namespaces/bar/deployments/foo/edges", 44 | }, 45 | } 46 | 47 | for _, tc := range testCases { 48 | tc := tc 49 | 50 | t.Run(tc.obj.Kind, func(t *testing.T) { 51 | lst := NewTrafficMetricsList(tc.obj, tc.edges) 52 | 53 | assert.Equal("TrafficMetricsList", lst.TypeMeta.Kind) 54 | assert.Equal(APIVersion, lst.TypeMeta.APIVersion) 55 | assert.Contains(lst.SelfLink, tc.link) 56 | assert.Equal(tc.obj, lst.Resource) 57 | 58 | assert.Len(lst.Items, 0) 59 | }) 60 | } 61 | } 62 | 63 | func TestListGet(t *testing.T) { 64 | assert := assertLib.New(t) 65 | 66 | lst := NewTrafficMetricsList(&v1.ObjectReference{}, false) 67 | 68 | assert.Len(lst.Items, 0) 69 | 70 | obj := &v1.ObjectReference{ 71 | Kind: "deployment", 72 | Namespace: "default", 73 | Name: "foo", 74 | } 75 | 76 | assert.Equal(obj, lst.Get(obj, nil).Resource) 77 | assert.Len(lst.Items, 1) 78 | 79 | assert.Equal(obj, lst.Get(obj, nil).Resource) 80 | assert.Len(lst.Items, 1) 81 | 82 | assert.Equal(obj, lst.Get(obj, obj).Edge.Resource) 83 | assert.Len(lst.Items, 2) 84 | 85 | assert.Equal(obj, lst.Get(obj, obj).Edge.Resource) 86 | assert.Len(lst.Items, 2) 87 | } 88 | -------------------------------------------------------------------------------- /pkg/gen/client/specs/informers/externalversions/specs/v1alpha1/interface.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by informer-gen. DO NOT EDIT. 16 | 17 | package v1alpha1 18 | 19 | import ( 20 | internalinterfaces "github.com/servicemeshinterface/smi-sdk-go/pkg/gen/client/specs/informers/externalversions/internalinterfaces" 21 | ) 22 | 23 | // Interface provides access to all the informers in this group version. 24 | type Interface interface { 25 | // HTTPRouteGroups returns a HTTPRouteGroupInformer. 26 | HTTPRouteGroups() HTTPRouteGroupInformer 27 | // TCPRoutes returns a TCPRouteInformer. 28 | TCPRoutes() TCPRouteInformer 29 | } 30 | 31 | type version struct { 32 | factory internalinterfaces.SharedInformerFactory 33 | namespace string 34 | tweakListOptions internalinterfaces.TweakListOptionsFunc 35 | } 36 | 37 | // New returns a new Interface. 38 | func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { 39 | return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} 40 | } 41 | 42 | // HTTPRouteGroups returns a HTTPRouteGroupInformer. 43 | func (v *version) HTTPRouteGroups() HTTPRouteGroupInformer { 44 | return &hTTPRouteGroupInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} 45 | } 46 | 47 | // TCPRoutes returns a TCPRouteInformer. 48 | func (v *version) TCPRoutes() TCPRouteInformer { 49 | return &tCPRouteInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} 50 | } 51 | -------------------------------------------------------------------------------- /pkg/gen/client/specs/informers/externalversions/specs/v1alpha2/interface.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by informer-gen. DO NOT EDIT. 16 | 17 | package v1alpha2 18 | 19 | import ( 20 | internalinterfaces "github.com/servicemeshinterface/smi-sdk-go/pkg/gen/client/specs/informers/externalversions/internalinterfaces" 21 | ) 22 | 23 | // Interface provides access to all the informers in this group version. 24 | type Interface interface { 25 | // HTTPRouteGroups returns a HTTPRouteGroupInformer. 26 | HTTPRouteGroups() HTTPRouteGroupInformer 27 | // TCPRoutes returns a TCPRouteInformer. 28 | TCPRoutes() TCPRouteInformer 29 | } 30 | 31 | type version struct { 32 | factory internalinterfaces.SharedInformerFactory 33 | namespace string 34 | tweakListOptions internalinterfaces.TweakListOptionsFunc 35 | } 36 | 37 | // New returns a new Interface. 38 | func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { 39 | return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} 40 | } 41 | 42 | // HTTPRouteGroups returns a HTTPRouteGroupInformer. 43 | func (v *version) HTTPRouteGroups() HTTPRouteGroupInformer { 44 | return &hTTPRouteGroupInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} 45 | } 46 | 47 | // TCPRoutes returns a TCPRouteInformer. 48 | func (v *version) TCPRoutes() TCPRouteInformer { 49 | return &tCPRouteInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} 50 | } 51 | -------------------------------------------------------------------------------- /pkg/gen/client/specs/informers/externalversions/specs/v1alpha3/interface.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by informer-gen. DO NOT EDIT. 16 | 17 | package v1alpha3 18 | 19 | import ( 20 | internalinterfaces "github.com/servicemeshinterface/smi-sdk-go/pkg/gen/client/specs/informers/externalversions/internalinterfaces" 21 | ) 22 | 23 | // Interface provides access to all the informers in this group version. 24 | type Interface interface { 25 | // HTTPRouteGroups returns a HTTPRouteGroupInformer. 26 | HTTPRouteGroups() HTTPRouteGroupInformer 27 | // TCPRoutes returns a TCPRouteInformer. 28 | TCPRoutes() TCPRouteInformer 29 | } 30 | 31 | type version struct { 32 | factory internalinterfaces.SharedInformerFactory 33 | namespace string 34 | tweakListOptions internalinterfaces.TweakListOptionsFunc 35 | } 36 | 37 | // New returns a new Interface. 38 | func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { 39 | return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} 40 | } 41 | 42 | // HTTPRouteGroups returns a HTTPRouteGroupInformer. 43 | func (v *version) HTTPRouteGroups() HTTPRouteGroupInformer { 44 | return &hTTPRouteGroupInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} 45 | } 46 | 47 | // TCPRoutes returns a TCPRouteInformer. 48 | func (v *version) TCPRoutes() TCPRouteInformer { 49 | return &tCPRouteInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} 50 | } 51 | -------------------------------------------------------------------------------- /pkg/apis/split/v1alpha3/traffic_split.go: -------------------------------------------------------------------------------- 1 | package v1alpha3 2 | 3 | import ( 4 | corev1 "k8s.io/api/core/v1" 5 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 6 | ) 7 | 8 | // +genclient 9 | // +genclient:noStatus 10 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 11 | 12 | // TrafficSplit allows users to incrementally direct percentages of traffic 13 | // between various services. It will be used by clients such as ingress 14 | // controllers or service mesh sidecars to split the outgoing traffic to 15 | // different destinations. 16 | type TrafficSplit struct { 17 | metav1.TypeMeta `json:",inline"` 18 | // Standard object's metadata. 19 | // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata 20 | // +optional 21 | metav1.ObjectMeta `json:"metadata,omitempty"` 22 | 23 | // Specification of the desired behavior of the traffic split. 24 | // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status 25 | // +optional 26 | Spec TrafficSplitSpec `json:"spec,omitempty"` 27 | } 28 | 29 | // TrafficSplitSpec is the specification for a TrafficSplit 30 | type TrafficSplitSpec struct { 31 | // Service represents the apex service 32 | Service string `json:"service"` 33 | 34 | // Backends defines a list of Kubernetes services 35 | // used as the traffic split destination 36 | Backends []TrafficSplitBackend `json:"backends"` 37 | 38 | // Matches allows defining a list of HTTP route groups 39 | // that this traffic split object should match 40 | // +optional 41 | Matches []corev1.TypedLocalObjectReference `json:"matches,omitempty"` 42 | } 43 | 44 | // TrafficSplitBackend defines a backend 45 | type TrafficSplitBackend struct { 46 | // Service is the name of a Kubernetes service 47 | Service string `json:"service"` 48 | 49 | // Weight defines the traffic split percentage 50 | Weight int `json:"weight"` 51 | } 52 | 53 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 54 | 55 | type TrafficSplitList struct { 56 | metav1.TypeMeta `json:",inline"` 57 | metav1.ListMeta `json:"metadata"` 58 | 59 | Items []TrafficSplit `json:"items"` 60 | } 61 | -------------------------------------------------------------------------------- /pkg/apis/split/v1alpha4/traffic_split.go: -------------------------------------------------------------------------------- 1 | package v1alpha4 2 | 3 | import ( 4 | corev1 "k8s.io/api/core/v1" 5 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 6 | ) 7 | 8 | // +genclient 9 | // +genclient:noStatus 10 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 11 | 12 | // TrafficSplit allows users to incrementally direct percentages of traffic 13 | // between various services. It will be used by clients such as ingress 14 | // controllers or service mesh sidecars to split the outgoing traffic to 15 | // different destinations. 16 | type TrafficSplit struct { 17 | metav1.TypeMeta `json:",inline"` 18 | // Standard object's metadata. 19 | // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata 20 | // +optional 21 | metav1.ObjectMeta `json:"metadata,omitempty"` 22 | 23 | // Specification of the desired behavior of the traffic split. 24 | // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status 25 | // +optional 26 | Spec TrafficSplitSpec `json:"spec,omitempty"` 27 | } 28 | 29 | // TrafficSplitSpec is the specification for a TrafficSplit 30 | type TrafficSplitSpec struct { 31 | // Service represents the apex service 32 | Service string `json:"service"` 33 | 34 | // Backends defines a list of Kubernetes services 35 | // used as the traffic split destination 36 | Backends []TrafficSplitBackend `json:"backends"` 37 | 38 | // Matches allows defining a list of HTTP route groups 39 | // that this traffic split object should match 40 | // +optional 41 | Matches []corev1.TypedLocalObjectReference `json:"matches,omitempty"` 42 | } 43 | 44 | // TrafficSplitBackend defines a backend 45 | type TrafficSplitBackend struct { 46 | // Service is the name of a Kubernetes service 47 | Service string `json:"service"` 48 | 49 | // Weight defines the traffic split percentage 50 | Weight int `json:"weight"` 51 | } 52 | 53 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 54 | 55 | type TrafficSplitList struct { 56 | metav1.TypeMeta `json:",inline"` 57 | metav1.ListMeta `json:"metadata"` 58 | 59 | Items []TrafficSplit `json:"items"` 60 | } 61 | -------------------------------------------------------------------------------- /pkg/apis/metrics/v1alpha1/list.go: -------------------------------------------------------------------------------- 1 | package v1alpha1 2 | 3 | import ( 4 | "fmt" 5 | "path" 6 | 7 | v1 "k8s.io/api/core/v1" 8 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 9 | ) 10 | 11 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 12 | 13 | // TrafficMetricsList provides a list of resources associated with a specific reference 14 | type TrafficMetricsList struct { 15 | metav1.TypeMeta `json:",inline"` 16 | metav1.ListMeta `json:"metadata,omitempty"` 17 | 18 | Resource *v1.ObjectReference `json:"resource"` 19 | 20 | Items []*TrafficMetrics `json:"items"` 21 | } 22 | 23 | // NewTrafficMetricsList constructs a new object with defaults already configured 24 | func NewTrafficMetricsList( 25 | obj *v1.ObjectReference, edges bool) *TrafficMetricsList { 26 | var selfLink string 27 | 28 | if edges { 29 | selfLink = path.Join(uniqueSelfLink(obj), "edges") 30 | } else { 31 | selfLink = path.Join(baseURL(), getKindName(obj.Kind)) 32 | } 33 | 34 | return &TrafficMetricsList{ 35 | TypeMeta: metav1.TypeMeta{ 36 | Kind: "TrafficMetricsList", 37 | APIVersion: APIVersion, 38 | }, 39 | ListMeta: metav1.ListMeta{ 40 | SelfLink: selfLink, 41 | }, 42 | Resource: obj, 43 | } 44 | } 45 | 46 | // String returns a formatted string representation of this struct 47 | func (lst *TrafficMetricsList) String() string { 48 | return fmt.Sprintf("%#v", lst) 49 | } 50 | 51 | func (lst *TrafficMetricsList) match(left, right *v1.ObjectReference) bool { 52 | return left.Kind == right.Kind && 53 | left.Namespace == right.Namespace && 54 | left.Name == right.Name 55 | } 56 | 57 | // Get will get the item that is associated with the object 58 | // reference or create a default if it doesn't already exist. 59 | func (lst *TrafficMetricsList) Get( 60 | obj, edge *v1.ObjectReference) *TrafficMetrics { 61 | 62 | for _, item := range lst.Items { 63 | if lst.match(obj, item.Resource) { 64 | if edge == nil || (item.Edge != nil && 65 | item.Edge.Resource != nil && 66 | lst.match(edge, item.Edge.Resource)) { 67 | return item 68 | } 69 | } 70 | } 71 | 72 | t := NewTrafficMetrics(obj, edge) 73 | lst.Items = append(lst.Items, t) 74 | 75 | return t 76 | } 77 | -------------------------------------------------------------------------------- /pkg/apis/metrics/v1alpha2/list.go: -------------------------------------------------------------------------------- 1 | package v1alpha2 2 | 3 | import ( 4 | "fmt" 5 | "path" 6 | 7 | v1 "k8s.io/api/core/v1" 8 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 9 | ) 10 | 11 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 12 | 13 | // TrafficMetricsList provides a list of resources associated with a specific reference 14 | type TrafficMetricsList struct { 15 | metav1.TypeMeta `json:",inline"` 16 | metav1.ListMeta `json:"metadata,omitempty"` 17 | 18 | Resource *v1.ObjectReference `json:"resource"` 19 | 20 | Items []*TrafficMetrics `json:"items"` 21 | } 22 | 23 | // NewTrafficMetricsList constructs a new object with defaults already configured 24 | func NewTrafficMetricsList( 25 | obj *v1.ObjectReference, edges bool) *TrafficMetricsList { 26 | var selfLink string 27 | 28 | if edges { 29 | selfLink = path.Join(uniqueSelfLink(obj), "edges") 30 | } else { 31 | selfLink = path.Join(baseURL(), getKindName(obj.Kind)) 32 | } 33 | 34 | return &TrafficMetricsList{ 35 | TypeMeta: metav1.TypeMeta{ 36 | Kind: "TrafficMetricsList", 37 | APIVersion: APIVersion, 38 | }, 39 | ListMeta: metav1.ListMeta{ 40 | SelfLink: selfLink, 41 | }, 42 | Resource: obj, 43 | } 44 | } 45 | 46 | // String returns a formatted string representation of this struct 47 | func (lst *TrafficMetricsList) String() string { 48 | return fmt.Sprintf("%#v", lst) 49 | } 50 | 51 | func (lst *TrafficMetricsList) match(left, right *v1.ObjectReference) bool { 52 | return left.Kind == right.Kind && 53 | left.Namespace == right.Namespace && 54 | left.Name == right.Name 55 | } 56 | 57 | // Get will get the item that is associated with the object 58 | // reference or create a default if it doesn't already exist. 59 | func (lst *TrafficMetricsList) Get( 60 | obj, edge *v1.ObjectReference) *TrafficMetrics { 61 | 62 | for _, item := range lst.Items { 63 | if lst.match(obj, item.Resource) { 64 | if edge == nil || (item.Edge != nil && 65 | item.Edge.Resource != nil && 66 | lst.match(edge, item.Edge.Resource)) { 67 | return item 68 | } 69 | } 70 | } 71 | 72 | t := NewTrafficMetrics(obj, edge) 73 | lst.Items = append(lst.Items, t) 74 | 75 | return t 76 | } 77 | -------------------------------------------------------------------------------- /pkg/gen/client/metrics/clientset/versioned/fake/register.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | package fake 18 | 19 | import ( 20 | metricsv1alpha1 "github.com/servicemeshinterface/smi-sdk-go/pkg/apis/metrics/v1alpha1" 21 | metricsv1alpha2 "github.com/servicemeshinterface/smi-sdk-go/pkg/apis/metrics/v1alpha2" 22 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 23 | runtime "k8s.io/apimachinery/pkg/runtime" 24 | schema "k8s.io/apimachinery/pkg/runtime/schema" 25 | serializer "k8s.io/apimachinery/pkg/runtime/serializer" 26 | utilruntime "k8s.io/apimachinery/pkg/util/runtime" 27 | ) 28 | 29 | var scheme = runtime.NewScheme() 30 | var codecs = serializer.NewCodecFactory(scheme) 31 | var parameterCodec = runtime.NewParameterCodec(scheme) 32 | var localSchemeBuilder = runtime.SchemeBuilder{ 33 | metricsv1alpha1.AddToScheme, 34 | metricsv1alpha2.AddToScheme, 35 | } 36 | 37 | // AddToScheme adds all types of this clientset into the given scheme. This allows composition 38 | // of clientsets, like in: 39 | // 40 | // import ( 41 | // "k8s.io/client-go/kubernetes" 42 | // clientsetscheme "k8s.io/client-go/kubernetes/scheme" 43 | // aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" 44 | // ) 45 | // 46 | // kclientset, _ := kubernetes.NewForConfig(c) 47 | // _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) 48 | // 49 | // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types 50 | // correctly. 51 | var AddToScheme = localSchemeBuilder.AddToScheme 52 | 53 | func init() { 54 | v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) 55 | utilruntime.Must(AddToScheme(scheme)) 56 | } 57 | -------------------------------------------------------------------------------- /pkg/gen/client/metrics/clientset/versioned/scheme/register.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | package scheme 18 | 19 | import ( 20 | metricsv1alpha1 "github.com/servicemeshinterface/smi-sdk-go/pkg/apis/metrics/v1alpha1" 21 | metricsv1alpha2 "github.com/servicemeshinterface/smi-sdk-go/pkg/apis/metrics/v1alpha2" 22 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 23 | runtime "k8s.io/apimachinery/pkg/runtime" 24 | schema "k8s.io/apimachinery/pkg/runtime/schema" 25 | serializer "k8s.io/apimachinery/pkg/runtime/serializer" 26 | utilruntime "k8s.io/apimachinery/pkg/util/runtime" 27 | ) 28 | 29 | var Scheme = runtime.NewScheme() 30 | var Codecs = serializer.NewCodecFactory(Scheme) 31 | var ParameterCodec = runtime.NewParameterCodec(Scheme) 32 | var localSchemeBuilder = runtime.SchemeBuilder{ 33 | metricsv1alpha1.AddToScheme, 34 | metricsv1alpha2.AddToScheme, 35 | } 36 | 37 | // AddToScheme adds all types of this clientset into the given scheme. This allows composition 38 | // of clientsets, like in: 39 | // 40 | // import ( 41 | // "k8s.io/client-go/kubernetes" 42 | // clientsetscheme "k8s.io/client-go/kubernetes/scheme" 43 | // aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" 44 | // ) 45 | // 46 | // kclientset, _ := kubernetes.NewForConfig(c) 47 | // _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) 48 | // 49 | // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types 50 | // correctly. 51 | var AddToScheme = localSchemeBuilder.AddToScheme 52 | 53 | func init() { 54 | v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) 55 | utilruntime.Must(AddToScheme(Scheme)) 56 | } 57 | -------------------------------------------------------------------------------- /pkg/gen/client/metrics/informers/externalversions/metrics/interface.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by informer-gen. DO NOT EDIT. 16 | 17 | package metrics 18 | 19 | import ( 20 | internalinterfaces "github.com/servicemeshinterface/smi-sdk-go/pkg/gen/client/metrics/informers/externalversions/internalinterfaces" 21 | v1alpha1 "github.com/servicemeshinterface/smi-sdk-go/pkg/gen/client/metrics/informers/externalversions/metrics/v1alpha1" 22 | v1alpha2 "github.com/servicemeshinterface/smi-sdk-go/pkg/gen/client/metrics/informers/externalversions/metrics/v1alpha2" 23 | ) 24 | 25 | // Interface provides access to each of this group's versions. 26 | type Interface interface { 27 | // V1alpha1 provides access to shared informers for resources in V1alpha1. 28 | V1alpha1() v1alpha1.Interface 29 | // V1alpha2 provides access to shared informers for resources in V1alpha2. 30 | V1alpha2() v1alpha2.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 | 49 | // V1alpha2 returns a new v1alpha2.Interface. 50 | func (g *group) V1alpha2() v1alpha2.Interface { 51 | return v1alpha2.New(g.factory, g.namespace, g.tweakListOptions) 52 | } 53 | -------------------------------------------------------------------------------- /pkg/gen/client/access/clientset/versioned/fake/register.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | package fake 18 | 19 | import ( 20 | accessv1alpha1 "github.com/servicemeshinterface/smi-sdk-go/pkg/apis/access/v1alpha1" 21 | accessv1alpha2 "github.com/servicemeshinterface/smi-sdk-go/pkg/apis/access/v1alpha2" 22 | accessv1alpha3 "github.com/servicemeshinterface/smi-sdk-go/pkg/apis/access/v1alpha3" 23 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 24 | runtime "k8s.io/apimachinery/pkg/runtime" 25 | schema "k8s.io/apimachinery/pkg/runtime/schema" 26 | serializer "k8s.io/apimachinery/pkg/runtime/serializer" 27 | utilruntime "k8s.io/apimachinery/pkg/util/runtime" 28 | ) 29 | 30 | var scheme = runtime.NewScheme() 31 | var codecs = serializer.NewCodecFactory(scheme) 32 | var parameterCodec = runtime.NewParameterCodec(scheme) 33 | var localSchemeBuilder = runtime.SchemeBuilder{ 34 | accessv1alpha1.AddToScheme, 35 | accessv1alpha2.AddToScheme, 36 | accessv1alpha3.AddToScheme, 37 | } 38 | 39 | // AddToScheme adds all types of this clientset into the given scheme. This allows composition 40 | // of clientsets, like in: 41 | // 42 | // import ( 43 | // "k8s.io/client-go/kubernetes" 44 | // clientsetscheme "k8s.io/client-go/kubernetes/scheme" 45 | // aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" 46 | // ) 47 | // 48 | // kclientset, _ := kubernetes.NewForConfig(c) 49 | // _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) 50 | // 51 | // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types 52 | // correctly. 53 | var AddToScheme = localSchemeBuilder.AddToScheme 54 | 55 | func init() { 56 | v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) 57 | utilruntime.Must(AddToScheme(scheme)) 58 | } 59 | -------------------------------------------------------------------------------- /pkg/gen/client/access/clientset/versioned/scheme/register.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | package scheme 18 | 19 | import ( 20 | accessv1alpha1 "github.com/servicemeshinterface/smi-sdk-go/pkg/apis/access/v1alpha1" 21 | accessv1alpha2 "github.com/servicemeshinterface/smi-sdk-go/pkg/apis/access/v1alpha2" 22 | accessv1alpha3 "github.com/servicemeshinterface/smi-sdk-go/pkg/apis/access/v1alpha3" 23 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 24 | runtime "k8s.io/apimachinery/pkg/runtime" 25 | schema "k8s.io/apimachinery/pkg/runtime/schema" 26 | serializer "k8s.io/apimachinery/pkg/runtime/serializer" 27 | utilruntime "k8s.io/apimachinery/pkg/util/runtime" 28 | ) 29 | 30 | var Scheme = runtime.NewScheme() 31 | var Codecs = serializer.NewCodecFactory(Scheme) 32 | var ParameterCodec = runtime.NewParameterCodec(Scheme) 33 | var localSchemeBuilder = runtime.SchemeBuilder{ 34 | accessv1alpha1.AddToScheme, 35 | accessv1alpha2.AddToScheme, 36 | accessv1alpha3.AddToScheme, 37 | } 38 | 39 | // AddToScheme adds all types of this clientset into the given scheme. This allows composition 40 | // of clientsets, like in: 41 | // 42 | // import ( 43 | // "k8s.io/client-go/kubernetes" 44 | // clientsetscheme "k8s.io/client-go/kubernetes/scheme" 45 | // aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" 46 | // ) 47 | // 48 | // kclientset, _ := kubernetes.NewForConfig(c) 49 | // _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) 50 | // 51 | // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types 52 | // correctly. 53 | var AddToScheme = localSchemeBuilder.AddToScheme 54 | 55 | func init() { 56 | v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) 57 | utilruntime.Must(AddToScheme(Scheme)) 58 | } 59 | -------------------------------------------------------------------------------- /pkg/gen/client/specs/informers/externalversions/specs/v1alpha4/interface.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by informer-gen. DO NOT EDIT. 16 | 17 | package v1alpha4 18 | 19 | import ( 20 | internalinterfaces "github.com/servicemeshinterface/smi-sdk-go/pkg/gen/client/specs/informers/externalversions/internalinterfaces" 21 | ) 22 | 23 | // Interface provides access to all the informers in this group version. 24 | type Interface interface { 25 | // HTTPRouteGroups returns a HTTPRouteGroupInformer. 26 | HTTPRouteGroups() HTTPRouteGroupInformer 27 | // TCPRoutes returns a TCPRouteInformer. 28 | TCPRoutes() TCPRouteInformer 29 | // UDPRoutes returns a UDPRouteInformer. 30 | UDPRoutes() UDPRouteInformer 31 | } 32 | 33 | type version 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 &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} 42 | } 43 | 44 | // HTTPRouteGroups returns a HTTPRouteGroupInformer. 45 | func (v *version) HTTPRouteGroups() HTTPRouteGroupInformer { 46 | return &hTTPRouteGroupInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} 47 | } 48 | 49 | // TCPRoutes returns a TCPRouteInformer. 50 | func (v *version) TCPRoutes() TCPRouteInformer { 51 | return &tCPRouteInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} 52 | } 53 | 54 | // UDPRoutes returns a UDPRouteInformer. 55 | func (v *version) UDPRoutes() UDPRouteInformer { 56 | return &uDPRouteInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} 57 | } 58 | -------------------------------------------------------------------------------- /pkg/apis/metrics/v1alpha1/resource.go: -------------------------------------------------------------------------------- 1 | package v1alpha1 2 | 3 | import ( 4 | "fmt" 5 | "path" 6 | 7 | v1 "k8s.io/api/core/v1" 8 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 9 | ) 10 | 11 | func uniqueSelfLink(obj *v1.ObjectReference) string { 12 | // If Namespace is empty, it is assumed that this is a non-namespaced resource. 13 | if obj.Namespace == "" { 14 | return path.Join(baseURL(), getKindName(obj.Kind), obj.Name) 15 | } 16 | 17 | return path.Join( 18 | baseURL(), 19 | "namespaces", 20 | obj.Namespace, 21 | getKindName(obj.Kind), 22 | obj.Name) 23 | } 24 | 25 | // NewTrafficMetrics constructs a TrafficMetrics with all the defaults 26 | func NewTrafficMetrics(obj, edge *v1.ObjectReference) *TrafficMetrics { 27 | selfLink := uniqueSelfLink(obj) 28 | 29 | if edge != nil { 30 | selfLink = path.Join(selfLink, "edges") 31 | } 32 | 33 | metrics := []*Metric{} 34 | for _, m := range AvailableMetrics { 35 | n := *m 36 | metrics = append(metrics, &n) 37 | } 38 | 39 | resource := &TrafficMetrics{ 40 | TypeMeta: metav1.TypeMeta{ 41 | Kind: "TrafficMetrics", 42 | APIVersion: APIVersion, 43 | }, 44 | ObjectMeta: metav1.ObjectMeta{ 45 | CreationTimestamp: metav1.Now(), 46 | Name: obj.Name, 47 | Namespace: obj.Namespace, 48 | SelfLink: selfLink, 49 | }, 50 | Resource: obj, 51 | Metrics: metrics, 52 | } 53 | 54 | if edge != nil { 55 | resource.Edge = &Edge{ 56 | Resource: edge, 57 | } 58 | } 59 | 60 | return resource 61 | } 62 | 63 | // +genclient 64 | // +genclient:noStatus 65 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 66 | 67 | // TrafficMetrics provide the metrics for a specific resource 68 | type TrafficMetrics struct { 69 | metav1.TypeMeta `json:",inline"` 70 | metav1.ObjectMeta `json:"metadata,omitempty"` 71 | 72 | *Interval `json:",inline"` 73 | 74 | Resource *v1.ObjectReference `json:"resource"` 75 | Edge *Edge `json:"edge"` 76 | Metrics []*Metric `json:"metrics"` 77 | } 78 | 79 | // Get returns a metric associated with a name 80 | func (t *TrafficMetrics) Get(name string) *Metric { 81 | for _, metric := range t.Metrics { 82 | if metric.Name == name { 83 | return metric 84 | } 85 | } 86 | 87 | return nil 88 | } 89 | 90 | // String returns a formatted string representation of this struct 91 | func (t *TrafficMetrics) String() string { 92 | return fmt.Sprintf("%#v", t) 93 | } 94 | -------------------------------------------------------------------------------- /pkg/apis/metrics/v1alpha2/resource.go: -------------------------------------------------------------------------------- 1 | package v1alpha2 2 | 3 | import ( 4 | "fmt" 5 | "path" 6 | 7 | v1 "k8s.io/api/core/v1" 8 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 9 | ) 10 | 11 | func uniqueSelfLink(obj *v1.ObjectReference) string { 12 | // If Namespace is empty, it is assumed that this is a non-namespaced resource. 13 | if obj.Namespace == "" { 14 | return path.Join(baseURL(), getKindName(obj.Kind), obj.Name) 15 | } 16 | 17 | return path.Join( 18 | baseURL(), 19 | "namespaces", 20 | obj.Namespace, 21 | getKindName(obj.Kind), 22 | obj.Name) 23 | } 24 | 25 | // NewTrafficMetrics constructs a TrafficMetrics with all the defaults 26 | func NewTrafficMetrics(obj, edge *v1.ObjectReference) *TrafficMetrics { 27 | selfLink := uniqueSelfLink(obj) 28 | 29 | if edge != nil { 30 | selfLink = path.Join(selfLink, "edges") 31 | } 32 | 33 | metrics := []*Metric{} 34 | for _, m := range AvailableMetrics { 35 | n := *m 36 | metrics = append(metrics, &n) 37 | } 38 | 39 | resource := &TrafficMetrics{ 40 | TypeMeta: metav1.TypeMeta{ 41 | Kind: "TrafficMetrics", 42 | APIVersion: APIVersion, 43 | }, 44 | ObjectMeta: metav1.ObjectMeta{ 45 | CreationTimestamp: metav1.Now(), 46 | Name: obj.Name, 47 | Namespace: obj.Namespace, 48 | SelfLink: selfLink, 49 | }, 50 | Resource: obj, 51 | Metrics: metrics, 52 | } 53 | 54 | if edge != nil { 55 | resource.Edge = &Edge{ 56 | Resource: edge, 57 | } 58 | } 59 | 60 | return resource 61 | } 62 | 63 | // +genclient 64 | // +genclient:noStatus 65 | // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object 66 | 67 | // TrafficMetrics provide the metrics for a specific resource 68 | type TrafficMetrics struct { 69 | metav1.TypeMeta `json:",inline"` 70 | metav1.ObjectMeta `json:"metadata,omitempty"` 71 | 72 | *Interval `json:",inline"` 73 | 74 | Resource *v1.ObjectReference `json:"resource"` 75 | Edge *Edge `json:"edge"` 76 | Backend *Backend `json:"backend"` 77 | Metrics []*Metric `json:"metrics"` 78 | } 79 | 80 | // Get returns a metric associated with a name 81 | func (t *TrafficMetrics) Get(name string) *Metric { 82 | for _, metric := range t.Metrics { 83 | if metric.Name == name { 84 | return metric 85 | } 86 | } 87 | 88 | return nil 89 | } 90 | 91 | // String returns a formatted string representation of this struct 92 | func (t *TrafficMetrics) String() string { 93 | return fmt.Sprintf("%#v", t) 94 | } 95 | -------------------------------------------------------------------------------- /pkg/gen/client/specs/clientset/versioned/fake/register.go: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 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 | // Code generated by client-gen. DO NOT EDIT. 16 | 17 | package fake 18 | 19 | import ( 20 | specsv1alpha1 "github.com/servicemeshinterface/smi-sdk-go/pkg/apis/specs/v1alpha1" 21 | specsv1alpha2 "github.com/servicemeshinterface/smi-sdk-go/pkg/apis/specs/v1alpha2" 22 | specsv1alpha3 "github.com/servicemeshinterface/smi-sdk-go/pkg/apis/specs/v1alpha3" 23 | specsv1alpha4 "github.com/servicemeshinterface/smi-sdk-go/pkg/apis/specs/v1alpha4" 24 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 25 | runtime "k8s.io/apimachinery/pkg/runtime" 26 | schema "k8s.io/apimachinery/pkg/runtime/schema" 27 | serializer "k8s.io/apimachinery/pkg/runtime/serializer" 28 | utilruntime "k8s.io/apimachinery/pkg/util/runtime" 29 | ) 30 | 31 | var scheme = runtime.NewScheme() 32 | var codecs = serializer.NewCodecFactory(scheme) 33 | var parameterCodec = runtime.NewParameterCodec(scheme) 34 | var localSchemeBuilder = runtime.SchemeBuilder{ 35 | specsv1alpha1.AddToScheme, 36 | specsv1alpha2.AddToScheme, 37 | specsv1alpha3.AddToScheme, 38 | specsv1alpha4.AddToScheme, 39 | } 40 | 41 | // AddToScheme adds all types of this clientset into the given scheme. This allows composition 42 | // of clientsets, like in: 43 | // 44 | // import ( 45 | // "k8s.io/client-go/kubernetes" 46 | // clientsetscheme "k8s.io/client-go/kubernetes/scheme" 47 | // aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" 48 | // ) 49 | // 50 | // kclientset, _ := kubernetes.NewForConfig(c) 51 | // _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) 52 | // 53 | // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types 54 | // correctly. 55 | var AddToScheme = localSchemeBuilder.AddToScheme 56 | 57 | func init() { 58 | v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) 59 | utilruntime.Must(AddToScheme(scheme)) 60 | } 61 | --------------------------------------------------------------------------------