pin supergloo\solo-kit

This commit is contained in:
Yuval Kohavi
2019-04-19 11:20:28 -04:00
parent 2173bfc1a0
commit 21c394ef7f
61 changed files with 6595 additions and 824 deletions
Generated
+104 -22
View File
@@ -9,6 +9,22 @@
revision = "fcb9a2d5f791d07be64506ab54434de65989d370"
version = "v0.37.4"
[[projects]]
branch = "master"
digest = "1:f12358576cd79bba0ae626530d23cde63416744f486c8bc817802c6907eaadd7"
name = "github.com/armon/go-metrics"
packages = ["."]
pruneopts = "NUT"
revision = "f0300d1749da6fa982027e449ec0c7a145510c3c"
[[projects]]
digest = "1:13d5750ba049ce46bf931792803f1d5584b04026df9badea5931e33c22aa34ee"
name = "github.com/avast/retry-go"
packages = ["."]
pruneopts = "NUT"
revision = "08d411bf8302219fe47ca04dbdf9de892010c5e5"
version = "v2.2.0"
[[projects]]
digest = "1:707ebe952a8b3d00b343c01536c79c73771d100f63ec6babeaed5c79e2b8a8dd"
name = "github.com/beorn7/perks"
@@ -33,6 +49,14 @@
revision = "72bf35d0ff611848c1dc9df0f976c81192392fa5"
version = "v4.1.0"
[[projects]]
digest = "1:81466b4218bf6adddac2572a30ac733a9255919bc2f470b4827a317bd4ee1756"
name = "github.com/ghodss/yaml"
packages = ["."]
pruneopts = "NUT"
revision = "0ca9ea5df5451ffdf184b4428c902747c2c11cd7"
version = "v1.0.0"
[[projects]]
digest = "1:895d2773c9e78e595dd5f946a25383d579d3094a9d8d9306dba27359f190f275"
name = "github.com/gogo/protobuf"
@@ -71,6 +95,14 @@
revision = "b5d812f8a3706043e23a9cd5babf2e5423744d30"
version = "v1.3.1"
[[projects]]
digest = "1:7f114b78210bf5b75f307fc97cff293633c835bab1e0ea8a744a44b39c042dfe"
name = "github.com/golang/snappy"
packages = ["."]
pruneopts = "NUT"
revision = "2a8bb927dd31d8daada140a5d09578521ce5c36a"
version = "v0.0.1"
[[projects]]
digest = "1:05f95ffdfcf651bdb0f05b40b69e7f5663047f8da75c72d58728acb59b5cc107"
name = "github.com/google/btree"
@@ -273,6 +305,17 @@
revision = "3d73dea227e0711e38b911ffa6fbafc8ff6b2991"
version = "v3.0.1"
[[projects]]
digest = "1:493282a1185f77368678d3886b7e999e37e920d22f69669545f1ee5ae10743a2"
name = "github.com/linkerd/linkerd2"
packages = [
"controller/gen/apis/serviceprofile",
"controller/gen/apis/serviceprofile/v1alpha1",
]
pruneopts = "NUT"
revision = "5e47cb150a33150e5aeddc6672d8a64701a970de"
version = "stable-2.2.1"
[[projects]]
digest = "1:0dbba7d4d4f3eeb01acd81af338ff4a3c4b0bb814d87368ea536e616f383240d"
name = "github.com/lyft/protoc-gen-validate"
@@ -436,7 +479,7 @@
version = "v1.0.0"
[[projects]]
digest = "1:5c71f77bf587abcb1a1f5fd731ab2cdb70f21b4c1d92d08941f9c9df3b7d9ac4"
digest = "1:cad7db5ed31bef1f9e4429ad0927b40dbf31535167ec4c768fd5985565111ea5"
name = "github.com/solo-io/gloo"
packages = [
"projects/gloo/pkg/api/v1",
@@ -455,11 +498,11 @@
"projects/gloo/pkg/api/v1/plugins/transformation",
]
pruneopts = "NUT"
revision = "f2fdf602bd6c96b0ebbc0d75bc8ac48c66f83db9"
version = "v0.13.14"
revision = "f767e64f7ee60139ff79e2abb547cd149067da04"
version = "v0.13.17"
[[projects]]
digest = "1:70a5a06704daa38aed3bacbc96b56c7c0203a0b5163f86596375cda70166ee52"
digest = "1:4a5b267a6929e4c3980066d745f87993c118f7797373a43537fdc69b3ee2d37e"
name = "github.com/solo-io/go-utils"
packages = [
"contextutils",
@@ -467,11 +510,11 @@
"kubeutils",
]
pruneopts = "NUT"
revision = "81b1a649eac8eb3f1243948896bbac1976591ca9"
version = "v0.7.3"
revision = "a27432d89f419897df796a17456410e49a9727c3"
version = "v0.7.11"
[[projects]]
digest = "1:87f25683c12f095ca49a3a30f66d75671c03b869502a404861a0258c64ecf540"
digest = "1:1cc9a8be450b7d9e77f100c7662133bf7bc8f0832f4eed3542599d3f35d28c46"
name = "github.com/solo-io/solo-kit"
packages = [
"pkg/api/v1/clients",
@@ -490,6 +533,7 @@
"pkg/api/v1/clients/kubesecret",
"pkg/api/v1/clients/memory",
"pkg/api/v1/clients/vault",
"pkg/api/v1/eventloop",
"pkg/api/v1/reconcile",
"pkg/api/v1/resources",
"pkg/api/v1/resources/core",
@@ -503,20 +547,22 @@
"pkg/utils/stringutils",
]
pruneopts = "NUT"
revision = "256a8a1dab5aa9700f49b74df06627bff196703d"
version = "v0.5.3"
revision = "ab46647c2845a4830d09db3690b3ace1b06845cd"
version = "v0.6.3"
[[projects]]
digest = "1:e76e4edcca47cb62c576ba5f605d102c554bcef35b1d3038383919b83ed9b1d7"
digest = "1:ba6f00e510774b2f1099d2f39a2ae36796ddbe406b02703b3395f26deb8d0f2c"
name = "github.com/solo-io/supergloo"
packages = [
"api/custom/kubepod",
"api/custom/linkerd",
"pkg/api/external/istio/authorization/v1alpha1",
"pkg/api/external/istio/networking/v1alpha3",
"pkg/api/external/kubernetes/core/v1",
"pkg/api/v1",
]
pruneopts = "NUT"
revision = "4569380e1f892716fec6df6a6ab5ae84fdbc786b"
version = "v0.3.8"
revision = "cb84ba5d7bd1099c5e52c09fc9229d1ee0fed9f9"
version = "v0.3.11"
[[projects]]
digest = "1:9d8420bbf131d1618bde6530af37c3799340d3762cc47210c1d9532a4c3a2779"
@@ -534,6 +580,28 @@
pruneopts = "NUT"
revision = "9cbb78b20423182f9e5b2a214dd255f5e117d2d1"
[[projects]]
digest = "1:1349e632a9915b7075f74c13474bfcae2594750c390d3c0b236e48bf6bce3fa2"
name = "go.opencensus.io"
packages = [
".",
"internal",
"internal/tagencoding",
"metric/metricdata",
"metric/metricproducer",
"resource",
"stats",
"stats/internal",
"stats/view",
"tag",
"trace",
"trace/internal",
"trace/tracestate",
]
pruneopts = "NUT"
revision = "75c0cca22312e51bfd4fafdbe9197ae399e18b38"
version = "v0.20.2"
[[projects]]
digest = "1:22f696cee54865fb8e9ff91df7b633f6b8f22037a8015253c6b6a71ca82219c7"
name = "go.uber.org/atomic"
@@ -748,6 +816,20 @@
revision = "05914d821849570fba9eacfb29466f2d8d3cd229"
version = "kubernetes-1.13.1"
[[projects]]
digest = "1:501a73762f1b2c4530206ffb657b39d8b58a9b40280d30e4509ae1232767962c"
name = "k8s.io/apiextensions-apiserver"
packages = [
"pkg/apis/apiextensions",
"pkg/apis/apiextensions/v1beta1",
"pkg/client/clientset/clientset",
"pkg/client/clientset/clientset/scheme",
"pkg/client/clientset/clientset/typed/apiextensions/v1beta1",
]
pruneopts = "NUT"
revision = "0fe22c71c47604641d9aa352c785b7912c200562"
version = "kubernetes-1.13.1"
[[projects]]
digest = "1:5ac33dce66ac11d4f41c157be7f13ba30c968c74d25a3a3a0a1eddf44b6b2176"
name = "k8s.io/apimachinery"
@@ -801,7 +883,7 @@
version = "kubernetes-1.13.1"
[[projects]]
digest = "1:9c1efd696862715ce928775ffa3e5c9fb41c1213f52cc47a6c22a516d15aa3ce"
digest = "1:ef9bda0e29102ac26750517500a2cb0bd7be69ba21ad267ab89a0b35d035328b"
name = "k8s.io/client-go"
packages = [
"discovery",
@@ -1052,14 +1134,6 @@
revision = "fd68e9863619f6ec2fdd8625fe1f02e7c877e480"
version = "v1.1.0"
[[projects]]
digest = "1:8730e0150dfb2b7e173890c8b9868e7a273082ef8e39f4940e3506a481cf895c"
name = "sigs.k8s.io/yaml"
packages = ["."]
pruneopts = "NUT"
revision = "fd68e9863619f6ec2fdd8625fe1f02e7c877e480"
version = "v1.1.0"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
@@ -1068,6 +1142,14 @@
"github.com/google/go-cmp/cmp/cmpopts",
"github.com/prometheus/client_golang/prometheus",
"github.com/prometheus/client_golang/prometheus/promhttp",
"github.com/solo-io/gloo/projects/gloo/pkg/api/v1",
"github.com/solo-io/solo-kit/pkg/api/v1/clients",
"github.com/solo-io/solo-kit/pkg/api/v1/clients/factory",
"github.com/solo-io/solo-kit/pkg/api/v1/clients/kube",
"github.com/solo-io/solo-kit/pkg/api/v1/clients/memory",
"github.com/solo-io/solo-kit/pkg/api/v1/resources/core",
"github.com/solo-io/solo-kit/pkg/errors",
"github.com/solo-io/supergloo/pkg/api/v1",
"github.com/stefanprodan/klog",
"go.uber.org/zap",
"go.uber.org/zap/zapcore",
+8
View File
@@ -64,3 +64,11 @@ required = [
name = "k8s.io/code-generator"
unused-packages = false
non-go = false
[[constraint]]
name = "github.com/solo-io/supergloo"
version = "v0.3.11"
[[constraint]]
name = "github.com/solo-io/solo-kit"
version = "v0.6.3"
@@ -1,7 +1,6 @@
// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package yaml
import (
+13 -55
View File
@@ -4,14 +4,13 @@ import (
"bytes"
"encoding/json"
"fmt"
"io"
"reflect"
"strconv"
"gopkg.in/yaml.v2"
)
// Marshal marshals the object into JSON then converts JSON to YAML and returns the
// Marshals the object into JSON then converts JSON to YAML and returns the
// YAML.
func Marshal(o interface{}) ([]byte, error) {
j, err := json.Marshal(o)
@@ -27,35 +26,15 @@ func Marshal(o interface{}) ([]byte, error) {
return y, nil
}
// JSONOpt is a decoding option for decoding from JSON format.
type JSONOpt func(*json.Decoder) *json.Decoder
// Unmarshal converts YAML to JSON then uses JSON to unmarshal into an object,
// optionally configuring the behavior of the JSON unmarshal.
func Unmarshal(y []byte, o interface{}, opts ...JSONOpt) error {
return yamlUnmarshal(y, o, false, opts...)
}
// UnmarshalStrict strictly converts YAML to JSON then uses JSON to unmarshal
// into an object, optionally configuring the behavior of the JSON unmarshal.
func UnmarshalStrict(y []byte, o interface{}, opts ...JSONOpt) error {
return yamlUnmarshal(y, o, true, append(opts, DisallowUnknownFields)...)
}
// yamlUnmarshal unmarshals the given YAML byte stream into the given interface,
// optionally performing the unmarshalling strictly
func yamlUnmarshal(y []byte, o interface{}, strict bool, opts ...JSONOpt) error {
// Converts YAML to JSON then uses JSON to unmarshal into an object.
func Unmarshal(y []byte, o interface{}) error {
vo := reflect.ValueOf(o)
unmarshalFn := yaml.Unmarshal
if strict {
unmarshalFn = yaml.UnmarshalStrict
}
j, err := yamlToJSON(y, &vo, unmarshalFn)
j, err := yamlToJSON(y, &vo)
if err != nil {
return fmt.Errorf("error converting YAML to JSON: %v", err)
}
err = jsonUnmarshal(bytes.NewReader(j), o, opts...)
err = json.Unmarshal(j, o)
if err != nil {
return fmt.Errorf("error unmarshaling JSON: %v", err)
}
@@ -63,22 +42,7 @@ func yamlUnmarshal(y []byte, o interface{}, strict bool, opts ...JSONOpt) error
return nil
}
// jsonUnmarshal unmarshals the JSON byte stream from the given reader into the
// object, optionally applying decoder options prior to decoding. We are not
// using json.Unmarshal directly as we want the chance to pass in non-default
// options.
func jsonUnmarshal(r io.Reader, o interface{}, opts ...JSONOpt) error {
d := json.NewDecoder(r)
for _, opt := range opts {
d = opt(d)
}
if err := d.Decode(&o); err != nil {
return fmt.Errorf("while decoding JSON: %v", err)
}
return nil
}
// JSONToYAML Converts JSON to YAML.
// Convert JSON to YAML.
func JSONToYAML(j []byte) ([]byte, error) {
// Convert the JSON to an object.
var jsonObj interface{}
@@ -96,8 +60,8 @@ func JSONToYAML(j []byte) ([]byte, error) {
return yaml.Marshal(jsonObj)
}
// YAMLToJSON converts YAML to JSON. Since JSON is a subset of YAML,
// passing JSON through this method should be a no-op.
// Convert YAML to JSON. Since JSON is a subset of YAML, passing JSON through
// this method should be a no-op.
//
// Things YAML can do that are not supported by JSON:
// * In YAML you can have binary and null keys in your maps. These are invalid
@@ -106,22 +70,14 @@ func JSONToYAML(j []byte) ([]byte, error) {
// use binary data with this library, encode the data as base64 as usual but do
// not use the !!binary tag in your YAML. This will ensure the original base64
// encoded data makes it all the way through to the JSON.
//
// For strict decoding of YAML, use YAMLToJSONStrict.
func YAMLToJSON(y []byte) ([]byte, error) {
return yamlToJSON(y, nil, yaml.Unmarshal)
return yamlToJSON(y, nil)
}
// YAMLToJSONStrict is like YAMLToJSON but enables strict YAML decoding,
// returning an error on any duplicate field names.
func YAMLToJSONStrict(y []byte) ([]byte, error) {
return yamlToJSON(y, nil, yaml.UnmarshalStrict)
}
func yamlToJSON(y []byte, jsonTarget *reflect.Value, yamlUnmarshal func([]byte, interface{}) error) ([]byte, error) {
func yamlToJSON(y []byte, jsonTarget *reflect.Value) ([]byte, error) {
// Convert the YAML to an object.
var yamlObj interface{}
err := yamlUnmarshal(y, &yamlObj)
err := yaml.Unmarshal(y, &yamlObj)
if err != nil {
return nil, err
}
@@ -316,4 +272,6 @@ func convertToJSONableObject(yamlObj interface{}, jsonTarget *reflect.Value) (in
}
return yamlObj, nil
}
return nil, nil
}
+201
View File
@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
@@ -0,0 +1,4 @@
package serviceprofile
// GroupName identifies the API Group Name for a ServiceProfile.
const GroupName = "linkerd.io"
@@ -0,0 +1,4 @@
// +k8s:deepcopy-gen=package
// +groupName=linkerd.io
package v1alpha1
@@ -0,0 +1,48 @@
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
sp "github.com/linkerd/linkerd2/controller/gen/apis/serviceprofile"
)
// SchemeGroupVersion is the identifier for the API which includes
// the name of the group and the version of the API
var SchemeGroupVersion = schema.GroupVersion{
Group: sp.GroupName,
Version: "v1alpha1",
}
// Kind takes an unqualified kind and returns back a Group qualified GroupKind
func Kind(kind string) schema.GroupKind {
return SchemeGroupVersion.WithKind(kind).GroupKind()
}
// Resource takes an unqualified resource and returns a Group qualified GroupResource
func Resource(resource string) schema.GroupResource {
return SchemeGroupVersion.WithResource(resource).GroupResource()
}
var (
// SchemeBuilder collects functions that add things to a scheme. It's to allow
// code to compile without explicitly referencing generated types. You should
// declare one in each package that will have generated deep copy or conversion
// functions.
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
// AddToScheme applies all the stored functions to the scheme. A non-nil error
// indicates that one function failed and the attempt was abandoned.
AddToScheme = SchemeBuilder.AddToScheme
)
// Adds the list of known types to Scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&ServiceProfile{},
&ServiceProfileList{},
)
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
}
@@ -0,0 +1,89 @@
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// +genclient
// +genclient:noStatus
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ServiceProfile describes a serviceProfile resource
type ServiceProfile struct {
// TypeMeta is the metadata for the resource, like kind and apiversion
metav1.TypeMeta `json:",inline"`
// ObjectMeta contains the metadata for the particular object, including
// things like...
// - name
// - namespace
// - self link
// - labels
// - ... etc ...
metav1.ObjectMeta `json:"metadata,omitempty"`
// Spec is the custom resource spec
Spec ServiceProfileSpec `json:"spec"`
}
// ServiceProfileSpec specifies a ServiceProfile resource.
type ServiceProfileSpec struct {
Routes []*RouteSpec `json:"routes"`
RetryBudget *RetryBudget `json:"retryBudget,omitempty"`
}
// RouteSpec specifies a Route resource.
type RouteSpec struct {
Name string `json:"name"`
Condition *RequestMatch `json:"condition"`
ResponseClasses []*ResponseClass `json:"responseClasses,omitempty"`
IsRetryable bool `json:"isRetryable,omitempty"`
Timeout string `json:"timeout,omitempty"`
}
// RequestMatch describes the conditions under which to match a Route.
type RequestMatch struct {
All []*RequestMatch `json:"all,omitempty"`
Not *RequestMatch `json:"not,omitempty"`
Any []*RequestMatch `json:"any,omitempty"`
PathRegex string `json:"pathRegex,omitempty"`
Method string `json:"method,omitempty"`
}
// ResponseClass describes how to classify a response (e.g. success or
// failures).
type ResponseClass struct {
Condition *ResponseMatch `json:"condition"`
IsFailure bool `json:"isFailure,omitempty"`
}
// ResponseMatch describes the conditions under which to classify a response.
type ResponseMatch struct {
All []*ResponseMatch `json:"all,omitempty"`
Not *ResponseMatch `json:"not,omitempty"`
Any []*ResponseMatch `json:"any,omitempty"`
Status *Range `json:"status,omitempty"`
}
// Range describes a range of integers (e.g. status codes).
type Range struct {
Min uint32 `json:"min,omitempty"`
Max uint32 `json:"max,omitempty"`
}
// RetryBudget describes the maximum number of retries that should be issued to
// this service.
type RetryBudget struct {
RetryRatio float32 `json:"retryRatio"`
MinRetriesPerSecond uint32 `json:"minRetriesPerSecond"`
TTL string `json:"ttl"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ServiceProfileList is a list of ServiceProfile resources.
type ServiceProfileList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []ServiceProfile `json:"items"`
}
@@ -0,0 +1,293 @@
// +build !ignore_autogenerated
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by deepcopy-gen. DO NOT EDIT.
package v1alpha1
import (
runtime "k8s.io/apimachinery/pkg/runtime"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Range) DeepCopyInto(out *Range) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Range.
func (in *Range) DeepCopy() *Range {
if in == nil {
return nil
}
out := new(Range)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RequestMatch) DeepCopyInto(out *RequestMatch) {
*out = *in
if in.All != nil {
in, out := &in.All, &out.All
*out = make([]*RequestMatch, len(*in))
for i := range *in {
if (*in)[i] != nil {
in, out := &(*in)[i], &(*out)[i]
*out = new(RequestMatch)
(*in).DeepCopyInto(*out)
}
}
}
if in.Not != nil {
in, out := &in.Not, &out.Not
*out = new(RequestMatch)
(*in).DeepCopyInto(*out)
}
if in.Any != nil {
in, out := &in.Any, &out.Any
*out = make([]*RequestMatch, len(*in))
for i := range *in {
if (*in)[i] != nil {
in, out := &(*in)[i], &(*out)[i]
*out = new(RequestMatch)
(*in).DeepCopyInto(*out)
}
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RequestMatch.
func (in *RequestMatch) DeepCopy() *RequestMatch {
if in == nil {
return nil
}
out := new(RequestMatch)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ResponseClass) DeepCopyInto(out *ResponseClass) {
*out = *in
if in.Condition != nil {
in, out := &in.Condition, &out.Condition
*out = new(ResponseMatch)
(*in).DeepCopyInto(*out)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResponseClass.
func (in *ResponseClass) DeepCopy() *ResponseClass {
if in == nil {
return nil
}
out := new(ResponseClass)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ResponseMatch) DeepCopyInto(out *ResponseMatch) {
*out = *in
if in.All != nil {
in, out := &in.All, &out.All
*out = make([]*ResponseMatch, len(*in))
for i := range *in {
if (*in)[i] != nil {
in, out := &(*in)[i], &(*out)[i]
*out = new(ResponseMatch)
(*in).DeepCopyInto(*out)
}
}
}
if in.Not != nil {
in, out := &in.Not, &out.Not
*out = new(ResponseMatch)
(*in).DeepCopyInto(*out)
}
if in.Any != nil {
in, out := &in.Any, &out.Any
*out = make([]*ResponseMatch, len(*in))
for i := range *in {
if (*in)[i] != nil {
in, out := &(*in)[i], &(*out)[i]
*out = new(ResponseMatch)
(*in).DeepCopyInto(*out)
}
}
}
if in.Status != nil {
in, out := &in.Status, &out.Status
*out = new(Range)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResponseMatch.
func (in *ResponseMatch) DeepCopy() *ResponseMatch {
if in == nil {
return nil
}
out := new(ResponseMatch)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RetryBudget) DeepCopyInto(out *RetryBudget) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RetryBudget.
func (in *RetryBudget) DeepCopy() *RetryBudget {
if in == nil {
return nil
}
out := new(RetryBudget)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RouteSpec) DeepCopyInto(out *RouteSpec) {
*out = *in
if in.Condition != nil {
in, out := &in.Condition, &out.Condition
*out = new(RequestMatch)
(*in).DeepCopyInto(*out)
}
if in.ResponseClasses != nil {
in, out := &in.ResponseClasses, &out.ResponseClasses
*out = make([]*ResponseClass, len(*in))
for i := range *in {
if (*in)[i] != nil {
in, out := &(*in)[i], &(*out)[i]
*out = new(ResponseClass)
(*in).DeepCopyInto(*out)
}
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouteSpec.
func (in *RouteSpec) DeepCopy() *RouteSpec {
if in == nil {
return nil
}
out := new(RouteSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ServiceProfile) DeepCopyInto(out *ServiceProfile) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceProfile.
func (in *ServiceProfile) DeepCopy() *ServiceProfile {
if in == nil {
return nil
}
out := new(ServiceProfile)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ServiceProfile) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ServiceProfileList) DeepCopyInto(out *ServiceProfileList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]ServiceProfile, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceProfileList.
func (in *ServiceProfileList) DeepCopy() *ServiceProfileList {
if in == nil {
return nil
}
out := new(ServiceProfileList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ServiceProfileList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ServiceProfileSpec) DeepCopyInto(out *ServiceProfileSpec) {
*out = *in
if in.Routes != nil {
in, out := &in.Routes, &out.Routes
*out = make([]*RouteSpec, len(*in))
for i := range *in {
if (*in)[i] != nil {
in, out := &(*in)[i], &(*out)[i]
*out = new(RouteSpec)
(*in).DeepCopyInto(*out)
}
}
}
if in.RetryBudget != nil {
in, out := &in.RetryBudget, &out.RetryBudget
*out = new(RetryBudget)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceProfileSpec.
func (in *ServiceProfileSpec) DeepCopy() *ServiceProfileSpec {
if in == nil {
return nil
}
out := new(ServiceProfileSpec)
in.DeepCopyInto(out)
return out
}
@@ -11,6 +11,7 @@ import (
"github.com/solo-io/go-utils/contextutils"
"github.com/solo-io/solo-kit/pkg/api/v1/clients"
"github.com/solo-io/solo-kit/pkg/api/v1/eventloop"
"github.com/solo-io/solo-kit/pkg/errors"
"github.com/solo-io/solo-kit/pkg/utils/errutils"
)
@@ -31,16 +32,12 @@ func (s ApiSyncers) Sync(ctx context.Context, snapshot *ApiSnapshot) error {
return multiErr.ErrorOrNil()
}
type ApiEventLoop interface {
Run(namespaces []string, opts clients.WatchOpts) (<-chan error, error)
}
type apiEventLoop struct {
emitter ApiEmitter
syncer ApiSyncer
}
func NewApiEventLoop(emitter ApiEmitter, syncer ApiSyncer) ApiEventLoop {
func NewApiEventLoop(emitter ApiEmitter, syncer ApiSyncer) eventloop.EventLoop {
return &apiEventLoop{
emitter: emitter,
syncer: syncer,
@@ -0,0 +1,265 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: github.com/solo-io/gloo/projects/gloo/api/v1/connection.proto
package v1
import (
bytes "bytes"
fmt "fmt"
math "math"
time "time"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
_ "github.com/gogo/protobuf/types"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
var _ = time.Kitchen
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
// Fine tune the settings for connections to an upstream
type ConnectionConfig struct {
// Maximum requests for a single upstream connection (unspecified or zero = no limit)
MaxRequestsPerConnection uint32 `protobuf:"varint,1,opt,name=max_requests_per_connection,json=maxRequestsPerConnection,proto3" json:"max_requests_per_connection,omitempty"`
// The timeout for new network connections to hosts in the cluster
ConnectTimeout *time.Duration `protobuf:"bytes,2,opt,name=connect_timeout,json=connectTimeout,proto3,stdduration" json:"connect_timeout,omitempty"`
// Configure OS-level tcp keepalive checks
TcpKeepalive *ConnectionConfig_TcpKeepAlive `protobuf:"bytes,3,opt,name=tcp_keepalive,json=tcpKeepalive,proto3" json:"tcp_keepalive,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ConnectionConfig) Reset() { *m = ConnectionConfig{} }
func (m *ConnectionConfig) String() string { return proto.CompactTextString(m) }
func (*ConnectionConfig) ProtoMessage() {}
func (*ConnectionConfig) Descriptor() ([]byte, []int) {
return fileDescriptor_56610fe13cf10c84, []int{0}
}
func (m *ConnectionConfig) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ConnectionConfig.Unmarshal(m, b)
}
func (m *ConnectionConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ConnectionConfig.Marshal(b, m, deterministic)
}
func (m *ConnectionConfig) XXX_Merge(src proto.Message) {
xxx_messageInfo_ConnectionConfig.Merge(m, src)
}
func (m *ConnectionConfig) XXX_Size() int {
return xxx_messageInfo_ConnectionConfig.Size(m)
}
func (m *ConnectionConfig) XXX_DiscardUnknown() {
xxx_messageInfo_ConnectionConfig.DiscardUnknown(m)
}
var xxx_messageInfo_ConnectionConfig proto.InternalMessageInfo
func (m *ConnectionConfig) GetMaxRequestsPerConnection() uint32 {
if m != nil {
return m.MaxRequestsPerConnection
}
return 0
}
func (m *ConnectionConfig) GetConnectTimeout() *time.Duration {
if m != nil {
return m.ConnectTimeout
}
return nil
}
func (m *ConnectionConfig) GetTcpKeepalive() *ConnectionConfig_TcpKeepAlive {
if m != nil {
return m.TcpKeepalive
}
return nil
}
// If set then set SO_KEEPALIVE on the socket to enable TCP Keepalives.
// see more info here: https://www.envoyproxy.io/docs/envoy/latest/api-v2/api/v2/core/address.proto#envoy-api-msg-core-tcpkeepalive
type ConnectionConfig_TcpKeepAlive struct {
// Maximum number of keepalive probes to send without response before deciding the connection is dead.
KeepaliveProbes uint32 `protobuf:"varint,1,opt,name=keepalive_probes,json=keepaliveProbes,proto3" json:"keepalive_probes,omitempty"`
// The number of seconds a connection needs to be idle before keep-alive probes start being sent. This is rounded up to the second.
KeepaliveTime *time.Duration `protobuf:"bytes,2,opt,name=keepalive_time,json=keepaliveTime,proto3,stdduration" json:"keepalive_time,omitempty"`
// The number of seconds between keep-alive probes. This is rounded up to the second.
KeepaliveInterval *time.Duration `protobuf:"bytes,3,opt,name=keepalive_interval,json=keepaliveInterval,proto3,stdduration" json:"keepalive_interval,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ConnectionConfig_TcpKeepAlive) Reset() { *m = ConnectionConfig_TcpKeepAlive{} }
func (m *ConnectionConfig_TcpKeepAlive) String() string { return proto.CompactTextString(m) }
func (*ConnectionConfig_TcpKeepAlive) ProtoMessage() {}
func (*ConnectionConfig_TcpKeepAlive) Descriptor() ([]byte, []int) {
return fileDescriptor_56610fe13cf10c84, []int{0, 0}
}
func (m *ConnectionConfig_TcpKeepAlive) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ConnectionConfig_TcpKeepAlive.Unmarshal(m, b)
}
func (m *ConnectionConfig_TcpKeepAlive) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ConnectionConfig_TcpKeepAlive.Marshal(b, m, deterministic)
}
func (m *ConnectionConfig_TcpKeepAlive) XXX_Merge(src proto.Message) {
xxx_messageInfo_ConnectionConfig_TcpKeepAlive.Merge(m, src)
}
func (m *ConnectionConfig_TcpKeepAlive) XXX_Size() int {
return xxx_messageInfo_ConnectionConfig_TcpKeepAlive.Size(m)
}
func (m *ConnectionConfig_TcpKeepAlive) XXX_DiscardUnknown() {
xxx_messageInfo_ConnectionConfig_TcpKeepAlive.DiscardUnknown(m)
}
var xxx_messageInfo_ConnectionConfig_TcpKeepAlive proto.InternalMessageInfo
func (m *ConnectionConfig_TcpKeepAlive) GetKeepaliveProbes() uint32 {
if m != nil {
return m.KeepaliveProbes
}
return 0
}
func (m *ConnectionConfig_TcpKeepAlive) GetKeepaliveTime() *time.Duration {
if m != nil {
return m.KeepaliveTime
}
return nil
}
func (m *ConnectionConfig_TcpKeepAlive) GetKeepaliveInterval() *time.Duration {
if m != nil {
return m.KeepaliveInterval
}
return nil
}
func init() {
proto.RegisterType((*ConnectionConfig)(nil), "gloo.solo.io.ConnectionConfig")
proto.RegisterType((*ConnectionConfig_TcpKeepAlive)(nil), "gloo.solo.io.ConnectionConfig.TcpKeepAlive")
}
func init() {
proto.RegisterFile("github.com/solo-io/gloo/projects/gloo/api/v1/connection.proto", fileDescriptor_56610fe13cf10c84)
}
var fileDescriptor_56610fe13cf10c84 = []byte{
// 367 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0x4d, 0x4e, 0xdb, 0x40,
0x14, 0x96, 0x9b, 0xaa, 0x8b, 0x69, 0xfe, 0x3a, 0xea, 0xc2, 0x4d, 0xa5, 0x34, 0xea, 0x2a, 0x55,
0xd5, 0x99, 0xb6, 0x48, 0xec, 0xb2, 0x20, 0x41, 0x08, 0x84, 0x84, 0x22, 0x2b, 0x2b, 0x36, 0x96,
0x6d, 0x5e, 0x86, 0x21, 0xb6, 0xdf, 0x30, 0x1e, 0x87, 0x1c, 0x85, 0x23, 0x70, 0x0d, 0x8e, 0xc0,
0x09, 0x90, 0x38, 0x09, 0xb2, 0x3d, 0xd8, 0x11, 0x2c, 0xc8, 0xce, 0x6f, 0xbe, 0x9f, 0xf7, 0x7d,
0xd6, 0x23, 0x13, 0x21, 0xcd, 0x65, 0x1e, 0xb2, 0x08, 0x13, 0x9e, 0x61, 0x8c, 0x7f, 0x24, 0x72,
0x11, 0x23, 0x72, 0xa5, 0xf1, 0x0a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 0x22, 0xfd,
0xda, 0xde, 0x57, 0x1a, 0x43, 0xc8, 0x6c, 0xc1, 0x5e, 0xfd, 0x3e, 0x2f, 0x9f, 0xe9, 0x11, 0xe9,
0x36, 0xd4, 0xa2, 0xd9, 0xae, 0xb5, 0x3a, 0xb5, 0xac, 0x28, 0x46, 0xcf, 0x08, 0x6d, 0x7c, 0x64,
0x6a, 0x40, 0xaf, 0x83, 0xd8, 0x56, 0x7b, 0xd7, 0xeb, 0x4b, 0x2d, 0x3d, 0xb1, 0xca, 0xe9, 0xfe,
0xdd, 0xd3, 0xd0, 0x39, 0xff, 0xbb, 0xdb, 0xb1, 0xa9, 0x95, 0xb0, 0x07, 0x17, 0x7e, 0x2a, 0x77,
0xec, 0x3d, 0x07, 0x00, 0x00, 0xff, 0xff, 0x84, 0x69, 0x71, 0xdb, 0xa7, 0x02, 0x00, 0x00,
}
func (this *ConnectionConfig) Equal(that interface{}) bool {
if that == nil {
return this == nil
}
that1, ok := that.(*ConnectionConfig)
if !ok {
that2, ok := that.(ConnectionConfig)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
return this == nil
} else if this == nil {
return false
}
if this.MaxRequestsPerConnection != that1.MaxRequestsPerConnection {
return false
}
if this.ConnectTimeout != nil && that1.ConnectTimeout != nil {
if *this.ConnectTimeout != *that1.ConnectTimeout {
return false
}
} else if this.ConnectTimeout != nil {
return false
} else if that1.ConnectTimeout != nil {
return false
}
if !this.TcpKeepalive.Equal(that1.TcpKeepalive) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *ConnectionConfig_TcpKeepAlive) Equal(that interface{}) bool {
if that == nil {
return this == nil
}
that1, ok := that.(*ConnectionConfig_TcpKeepAlive)
if !ok {
that2, ok := that.(ConnectionConfig_TcpKeepAlive)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
return this == nil
} else if this == nil {
return false
}
if this.KeepaliveProbes != that1.KeepaliveProbes {
return false
}
if this.KeepaliveTime != nil && that1.KeepaliveTime != nil {
if *this.KeepaliveTime != *that1.KeepaliveTime {
return false
}
} else if this.KeepaliveTime != nil {
return false
} else if that1.KeepaliveTime != nil {
return false
}
if this.KeepaliveInterval != nil && that1.KeepaliveInterval != nil {
if *this.KeepaliveInterval != *that1.KeepaliveInterval {
return false
}
} else if this.KeepaliveInterval != nil {
return false
} else if that1.KeepaliveInterval != nil {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
@@ -11,6 +11,7 @@ import (
"github.com/solo-io/go-utils/contextutils"
"github.com/solo-io/solo-kit/pkg/api/v1/clients"
"github.com/solo-io/solo-kit/pkg/api/v1/eventloop"
"github.com/solo-io/solo-kit/pkg/errors"
"github.com/solo-io/solo-kit/pkg/utils/errutils"
)
@@ -31,16 +32,12 @@ func (s DiscoverySyncers) Sync(ctx context.Context, snapshot *DiscoverySnapshot)
return multiErr.ErrorOrNil()
}
type DiscoveryEventLoop interface {
Run(namespaces []string, opts clients.WatchOpts) (<-chan error, error)
}
type discoveryEventLoop struct {
emitter DiscoveryEmitter
syncer DiscoverySyncer
}
func NewDiscoveryEventLoop(emitter DiscoveryEmitter, syncer DiscoverySyncer) DiscoveryEventLoop {
func NewDiscoveryEventLoop(emitter DiscoveryEmitter, syncer DiscoverySyncer) eventloop.EventLoop {
return &discoveryEventLoop{
emitter: emitter,
syncer: syncer,
+71 -58
View File
@@ -439,6 +439,7 @@ type UpstreamSpec struct {
// will be used.
CircuitBreakers *CircuitBreakerConfig `protobuf:"bytes,7,opt,name=circuit_breakers,json=circuitBreakers,proto3" json:"circuit_breakers,omitempty"`
LoadBalancerConfig *LoadBalancerConfig `protobuf:"bytes,8,opt,name=load_balancer_config,json=loadBalancerConfig,proto3" json:"load_balancer_config,omitempty"`
ConnectionConfig *ConnectionConfig `protobuf:"bytes,9,opt,name=connection_config,json=connectionConfig,proto3" json:"connection_config,omitempty"`
// Note to developers: new Upstream Plugins must be added to this oneof field
// to be usable by Gloo.
//
@@ -533,6 +534,13 @@ func (m *UpstreamSpec) GetLoadBalancerConfig() *LoadBalancerConfig {
return nil
}
func (m *UpstreamSpec) GetConnectionConfig() *ConnectionConfig {
if m != nil {
return m.ConnectionConfig
}
return nil
}
func (m *UpstreamSpec) GetKube() *kubernetes.UpstreamSpec {
if x, ok := m.GetUpstreamType().(*UpstreamSpec_Kube); ok {
return x.Kube
@@ -712,64 +720,66 @@ func init() {
}
var fileDescriptor_ae47d2df5fad2a45 = []byte{
// 912 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0x4f, 0x73, 0xdc, 0x34,
0x18, 0xc6, 0xd9, 0x64, 0xbb, 0x29, 0x22, 0x65, 0x3b, 0x9a, 0x1e, 0x96, 0x0c, 0xb4, 0x99, 0x3d,
0x40, 0x53, 0xa6, 0x32, 0x94, 0x99, 0x42, 0x3b, 0x53, 0x08, 0xbb, 0xa1, 0x64, 0x98, 0x74, 0xc8,
0xb8, 0xfc, 0xbf, 0xec, 0x68, 0x15, 0xad, 0x23, 0xe2, 0xb5, 0x3c, 0xd2, 0x6b, 0xd2, 0x70, 0xe2,
0x3b, 0x70, 0xe1, 0x23, 0x70, 0xe1, 0x83, 0x70, 0xe2, 0xc8, 0x91, 0x19, 0x3e, 0x09, 0x23, 0xe9,
0xf5, 0x66, 0x6d, 0xb6, 0x1d, 0xc7, 0xe9, 0xc1, 0xb6, 0x6c, 0xbd, 0xcf, 0xcf, 0xf2, 0xab, 0x47,
0x7a, 0x4d, 0x1e, 0x26, 0x0a, 0x8e, 0x8b, 0x29, 0x13, 0x7a, 0x1e, 0x59, 0x9d, 0xea, 0xbb, 0x4a,
0x47, 0x49, 0xaa, 0x75, 0x94, 0x1b, 0xfd, 0xa3, 0x14, 0x60, 0xc3, 0x1d, 0xcf, 0x55, 0xf4, 0xd3,
0xfb, 0x51, 0x9e, 0x16, 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, 0x42, 0xec, 0xa8, 0x4f, 0xae, 0x15, 0xd8, 0xe3, 0x1d, 0x35, 0xba, 0xff, 0xfb,
0xbf, 0x37, 0x3b, 0x3f, 0xbc, 0xd7, 0xac, 0x68, 0xe6, 0x27, 0x09, 0x16, 0xce, 0x69, 0xcf, 0x6f,
0x2d, 0x1f, 0xfc, 0x17, 0x00, 0x00, 0xff, 0xff, 0xbd, 0x8a, 0x6a, 0x3d, 0x7a, 0x0c, 0x00, 0x00,
// 942 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0xdd, 0x72, 0xdb, 0x44,
0x14, 0xc7, 0x71, 0x3e, 0x9c, 0x76, 0x49, 0x71, 0xd8, 0xe9, 0x85, 0xc9, 0x40, 0x9a, 0xf1, 0x05,
0x34, 0x65, 0xba, 0x82, 0x32, 0x53, 0x68, 0x67, 0x0a, 0xc1, 0x0e, 0x25, 0x03, 0xe9, 0x90, 0x51,
0xf9, 0xbe, 0xf1, 0xac, 0x37, 0x6b, 0x65, 0x1b, 0x59, 0xab, 0xd9, 0x3d, 0x22, 0x0d, 0x57, 0xbc,
0x03, 0x37, 0x5c, 0xf0, 0x00, 0xdc, 0xf0, 0x20, 0x3c, 0x01, 0x97, 0xcc, 0xf0, 0x24, 0x8c, 0x76,
0x8f, 0x64, 0x4b, 0xb8, 0x1d, 0x5b, 0xc9, 0x85, 0xad, 0x95, 0xf6, 0xfc, 0x7f, 0xda, 0x8f, 0xff,
0x9e, 0x23, 0xf2, 0x30, 0x52, 0x70, 0x9a, 0x8d, 0x98, 0xd0, 0x93, 0xc0, 0xea, 0x58, 0xdf, 0x55,
0x3a, 0x88, 0x62, 0xad, 0x83, 0xd4, 0xe8, 0x67, 0x52, 0x80, 0xf5, 0x77, 0x3c, 0x55, 0xc1, 0x4f,
0xef, 0x07, 0x69, 0x9c, 0x45, 0x2a, 0xb1, 0x2c, 0x35, 0x1a,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, 0xc7,
0x6b, 0x7a, 0x34, 0xf8, 0x80, 0xb4, 0xfd, 0x17, 0x4d, 0x79, 0xec, 0x8b, 0x0f, 0x9c, 0x45, 0xa6,
0xe0, 0x63, 0xfb, 0x1d, 0x72, 0x23, 0xc3, 0x1e, 0x67, 0xcf, 0xfe, 0xfd, 0x3f, 0xfe, 0xdd, 0x69,
0xfd, 0xf8, 0xde, 0x62, 0x15, 0x38, 0x3d, 0x8b, 0xb0, 0x0a, 0x8f, 0xda, 0x2e, 0x4f, 0x7d, 0xf0,
0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xda, 0xd4, 0x1c, 0xd1, 0x06, 0x0d, 0x00, 0x00,
}
func (this *ListenerPlugins) Equal(that interface{}) bool {
@@ -1037,6 +1047,9 @@ func (this *UpstreamSpec) Equal(that interface{}) bool {
if !this.LoadBalancerConfig.Equal(that1.LoadBalancerConfig) {
return false
}
if !this.ConnectionConfig.Equal(that1.ConnectionConfig) {
return false
}
if that1.UpstreamType == nil {
if this.UpstreamType != nil {
return false
+113 -96
View File
@@ -10,6 +10,7 @@ import (
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
types "github.com/gogo/protobuf/types"
core "github.com/solo-io/solo-kit/pkg/api/v1/resources/core"
)
@@ -159,10 +160,12 @@ type Listener struct {
// Multiple SslConfigs are supported for the pupose of SNI. Be aware that the SNI domain provided in the SSL Config
// must match a domain in virtual host
// TODO(ilackarms): ensure that ssl configs without a matching virtual host are errored
SslConfiguations []*SslConfig `protobuf:"bytes,5,rep,name=ssl_configuations,json=sslConfiguations,proto3" json:"ssl_configuations,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
SslConfiguations []*SslConfig `protobuf:"bytes,5,rep,name=ssl_configuations,json=sslConfiguations,proto3" json:"ssl_configuations,omitempty"`
// Enable ProxyProtocol support for this listener
UseProxyProto *types.BoolValue `protobuf:"bytes,6,opt,name=use_proxy_proto,json=useProxyProto,proto3" json:"use_proxy_proto,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Listener) Reset() { *m = Listener{} }
@@ -242,6 +245,13 @@ func (m *Listener) GetSslConfiguations() []*SslConfig {
return nil
}
func (m *Listener) GetUseProxyProto() *types.BoolValue {
if m != nil {
return m.UseProxyProto
}
return nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*Listener) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _Listener_OneofMarshaler, _Listener_OneofUnmarshaler, _Listener_OneofSizer, []interface{}{
@@ -1730,98 +1740,102 @@ func init() {
}
var fileDescriptor_c6a47f72e9923590 = []byte{
// 1449 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0xcb, 0x72, 0x1b, 0x45,
0x14, 0xb5, 0x2c, 0x4b, 0x96, 0xae, 0x34, 0xb2, 0xdc, 0x51, 0x1c, 0x39, 0x81, 0xc4, 0x99, 0x54,
0x0a, 0x57, 0x25, 0xd8, 0xc4, 0x81, 0x54, 0x1e, 0x55, 0xa1, 0x2c, 0x5b, 0x44, 0x54, 0xc5, 0x0f,
0xda, 0x4e, 0x52, 0xc9, 0x66, 0x6a, 0x3c, 0xd3, 0x1e, 0x4d, 0x32, 0x52, 0x4f, 0xba, 0x5b, 0x7e,
0xfc, 0x00, 0x5f, 0xc0, 0x82, 0x4f, 0xe0, 0x13, 0x58, 0x52, 0xac, 0xd8, 0xf0, 0x01, 0x6c, 0xb2,
0x60, 0xc5, 0x9a, 0x0d, 0x5b, 0xaa, 0x1f, 0x33, 0x9a, 0x31, 0x0a, 0x24, 0x05, 0x0b, 0x56, 0x9a,
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, 0xeb, 0x01, 0x41, 0x37,
0x60, 0x5e, 0x6f, 0xe2, 0x31, 0xe2, 0x93, 0xa1, 0x08, 0xdd, 0x88, 0xab, 0x23, 0x5f, 0x31, 0x6e,
0x6f, 0x8c, 0xf5, 0x9d, 0x3b, 0xdf, 0xfd, 0x7a, 0xb9, 0xf0, 0xe2, 0x93, 0x77, 0xfb, 0xff, 0x13,
0xbf, 0x0a, 0xcc, 0x7f, 0xa0, 0x83, 0xb2, 0xfa, 0xf3, 0x73, 0xfb, 0xcf, 0x00, 0x00, 0x00, 0xff,
0xff, 0x97, 0x14, 0x0c, 0xa0, 0x9d, 0x0e, 0x00, 0x00,
// 1508 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0xcd, 0x6e, 0xdb, 0xca,
0x15, 0xb6, 0x2c, 0x4b, 0x96, 0x8e, 0x44, 0x59, 0x9e, 0x28, 0x8e, 0xec, 0xb4, 0x89, 0xc3, 0x20,
0xa8, 0x81, 0xa4, 0x52, 0xe3, 0xb4, 0x41, 0x7e, 0x80, 0x14, 0x96, 0xad, 0x46, 0x05, 0x62, 0x5b,
0x1d, 0x3b, 0x0e, 0x92, 0x0d, 0x41, 0x93, 0x23, 0x8a, 0x09, 0xa5, 0x61, 0x66, 0x86, 0xfe, 0x79,
0x81, 0x3e, 0x41, 0x17, 0x7d, 0x84, 0x3e, 0x42, 0x81, 0x6e, 0x8a, 0xae, 0xba, 0xe9, 0x03, 0x74,
0x93, 0x45, 0x57, 0x5d, 0x77, 0xd3, 0xed, 0x05, 0x67, 0x86, 0x14, 0xe9, 0xab, 0xdc, 0x9b, 0xe0,
0xde, 0xc5, 0x5d, 0x89, 0xe7, 0xcc, 0x77, 0xce, 0x9c, 0xff, 0x33, 0x82, 0x27, 0x9e, 0x2f, 0xc6,
0xd1, 0x69, 0xc7, 0xa1, 0x93, 0x2e, 0xa7, 0x01, 0xfd, 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, 0xeb, 0x71, 0x29, 0x03, 0x1a, 0xe8, 0x35, 0x78, 0x0f, 0x1a, 0xe4, 0x22, 0xa4,
0x9c, 0xa4, 0xa8, 0x92, 0x44, 0x19, 0x8a, 0x9b, 0xc0, 0x6e, 0xc4, 0x6f, 0xa3, 0x0b, 0xcb, 0xf6,
0x88, 0x4c, 0x62, 0x15, 0x97, 0x27, 0xf6, 0xc5, 0x8e, 0x47, 0xd0, 0x7d, 0x58, 0x55, 0x97, 0x38,
0x8c, 0xb8, 0x64, 0x2a, 0x7c, 0x3b, 0xe0, 0xb2, 0xe5, 0x2b, 0xda, 0xec, 0xdd, 0x19, 0xbf, 0xf7,
0xf8, 0x2f, 0xff, 0xb9, 0x55, 0x78, 0xf7, 0xab, 0x2f, 0xfb, 0x0f, 0x15, 0x7e, 0xf0, 0xf4, 0xff,
0xa8, 0xd3, 0xb2, 0x7c, 0x6b, 0x3f, 0xfa, 0x26, 0x00, 0x00, 0xff, 0xff, 0xbe, 0x6f, 0x56, 0x77,
0x01, 0x0f, 0x00, 0x00,
}
func (this *Proxy) Equal(that interface{}) bool {
@@ -1907,6 +1921,9 @@ func (this *Listener) Equal(that interface{}) bool {
return false
}
}
if !this.UseProxyProto.Equal(that1.UseProxyProto) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
@@ -11,6 +11,7 @@ import (
"github.com/solo-io/go-utils/contextutils"
"github.com/solo-io/solo-kit/pkg/api/v1/clients"
"github.com/solo-io/solo-kit/pkg/api/v1/eventloop"
"github.com/solo-io/solo-kit/pkg/errors"
"github.com/solo-io/solo-kit/pkg/utils/errutils"
)
@@ -31,16 +32,12 @@ func (s SetupSyncers) Sync(ctx context.Context, snapshot *SetupSnapshot) error {
return multiErr.ErrorOrNil()
}
type SetupEventLoop interface {
Run(namespaces []string, opts clients.WatchOpts) (<-chan error, error)
}
type setupEventLoop struct {
emitter SetupEmitter
syncer SetupSyncer
}
func NewSetupEventLoop(emitter SetupEmitter, syncer SetupSyncer) SetupEventLoop {
func NewSetupEventLoop(emitter SetupEmitter, syncer SetupSyncer) eventloop.EventLoop {
return &setupEventLoop{
emitter: emitter,
syncer: syncer,
+8 -1
View File
@@ -21,6 +21,7 @@ import (
"context"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
type loggerKey struct{}
@@ -31,8 +32,14 @@ type loggerKey struct{}
// that code that doesn't set the logger correctly can be caught at runtime.
var fallbackLogger *zap.SugaredLogger
func buildLogger() (*zap.Logger, error) {
config := zap.NewProductionConfig()
config.EncoderConfig.EncodeTime = zapcore.ISO8601TimeEncoder
return config.Build()
}
func init() {
if logger, err := zap.NewProduction(); err != nil {
if logger, err := buildLogger(); err != nil {
// We failed to create a fallback logger. Our fallback
// unfortunately falls back to noop.
@@ -62,9 +62,16 @@ func (o ReadOpts) WithDefaults() ReadOpts {
return o
}
type StorageWriteOpts interface {
StorageWriteOptsTag()
}
type WriteOpts struct {
Ctx context.Context
OverwriteExisting bool
// Implementation dependant write opts
StorageWriteOpts StorageWriteOpts
}
func (o WriteOpts) WithDefaults() WriteOpts {
+23 -10
View File
@@ -17,14 +17,16 @@ type KubeCoreCache interface {
PodLister() kubelisters.PodLister
ConfigMapLister() kubelisters.ConfigMapLister
SecretLister() kubelisters.SecretLister
NamespaceLister() kubelisters.NamespaceLister
Subscribe() <-chan struct{}
Unsubscribe(<-chan struct{})
}
type KubeCoreCaches struct {
type kubeCoreCaches struct {
podLister kubelisters.PodLister
configMapLister kubelisters.ConfigMapLister
secretLister kubelisters.SecretLister
namespaceLister kubelisters.NamespaceLister
cacheUpdatedWatchers []chan struct{}
cacheUpdatedWatchersMutex sync.Mutex
@@ -32,23 +34,29 @@ type KubeCoreCaches struct {
// This context should live as long as the cache is desired. i.e. if the cache is shared
// across clients, it should get a context that has a longer lifetime than the clients themselves
func NewKubeCoreCache(ctx context.Context, client kubernetes.Interface) (*KubeCoreCaches, error) {
func NewKubeCoreCache(ctx context.Context, client kubernetes.Interface) (*kubeCoreCaches, error) {
resyncDuration := 12 * time.Hour
kubeInformerFactory := kubeinformers.NewSharedInformerFactory(client, resyncDuration)
pods := kubeInformerFactory.Core().V1().Pods()
configMaps := kubeInformerFactory.Core().V1().ConfigMaps()
secrets := kubeInformerFactory.Core().V1().Secrets()
namespaces := kubeInformerFactory.Core().V1().Namespaces()
k := &KubeCoreCaches{
k := &kubeCoreCaches{
podLister: pods.Lister(),
configMapLister: configMaps.Lister(),
secretLister: secrets.Lister(),
namespaceLister: namespaces.Lister(),
}
kubeController := controller.NewController("kube-plugin-controller",
controller.NewLockingSyncHandler(k.updatedOccured),
pods.Informer(), configMaps.Informer(), secrets.Informer())
pods.Informer(),
configMaps.Informer(),
secrets.Informer(),
namespaces.Informer(),
)
stop := ctx.Done()
err := kubeController.Run(2, stop)
@@ -59,19 +67,24 @@ func NewKubeCoreCache(ctx context.Context, client kubernetes.Interface) (*KubeCo
return k, nil
}
func (k *KubeCoreCaches) PodLister() kubelisters.PodLister {
func (k *kubeCoreCaches) PodLister() kubelisters.PodLister {
return k.podLister
}
func (k *KubeCoreCaches) ConfigMapLister() kubelisters.ConfigMapLister {
func (k *kubeCoreCaches) ConfigMapLister() kubelisters.ConfigMapLister {
return k.configMapLister
}
func (k *KubeCoreCaches) SecretLister() kubelisters.SecretLister {
func (k *kubeCoreCaches) SecretLister() kubelisters.SecretLister {
return k.secretLister
}
func (k *KubeCoreCaches) Subscribe() <-chan struct{} {
func (k *kubeCoreCaches) NamespaceLister() kubelisters.NamespaceLister {
return k.namespaceLister
}
func (k *kubeCoreCaches) Subscribe() <-chan struct{} {
k.cacheUpdatedWatchersMutex.Lock()
defer k.cacheUpdatedWatchersMutex.Unlock()
c := make(chan struct{}, 10)
@@ -79,7 +92,7 @@ func (k *KubeCoreCaches) Subscribe() <-chan struct{} {
return c
}
func (k *KubeCoreCaches) Unsubscribe(c <-chan struct{}) {
func (k *kubeCoreCaches) Unsubscribe(c <-chan struct{}) {
k.cacheUpdatedWatchersMutex.Lock()
defer k.cacheUpdatedWatchersMutex.Unlock()
for i, cacheUpdated := range k.cacheUpdatedWatchers {
@@ -90,7 +103,7 @@ func (k *KubeCoreCaches) Unsubscribe(c <-chan struct{}) {
}
}
func (k *KubeCoreCaches) updatedOccured() {
func (k *kubeCoreCaches) updatedOccured() {
k.cacheUpdatedWatchersMutex.Lock()
defer k.cacheUpdatedWatchersMutex.Unlock()
for _, cacheUpdated := range k.cacheUpdatedWatchers {
@@ -86,6 +86,17 @@ func init() {
view.Register(CreateCountView, UpdateCountView, DeleteCountView, InFlightSumView, EventsCountView)
}
// Kuberenetes specific write options.
// Allows modifing a resource just before it is written.
// This allows to make kubernetes specific changes, like adding an owner reference.
type KubeWriteOpts struct {
PreWriteCallback func(r *v1.Resource)
}
func (*KubeWriteOpts) StorageWriteOptsTag() {}
var _ clients.StorageWriteOpts = new(KubeWriteOpts)
// lazy start in list & watch
// register informers in register
type ResourceClient struct {
@@ -191,6 +202,12 @@ func (rc *ResourceClient) Write(resource resources.Resource, opts clients.WriteO
ctx = ctxWithTags
}
if opts.StorageWriteOpts != nil {
if kubeOpts, ok := opts.StorageWriteOpts.(*KubeWriteOpts); ok {
kubeOpts.PreWriteCallback(resourceCrd)
}
}
if rc.exist(ctx, meta.Namespace, meta.Name) {
if !opts.OverwriteExisting {
return nil, errors.NewExistErr(meta)
@@ -25,7 +25,7 @@ import (
var (
MLists = stats.Int64("kube/lists", "The number of lists", "1")
MWatches = stats.Int64("kube/lists", "The number of watches", "1")
MWatches = stats.Int64("kube/watches", "The number of watches", "1")
KeyKind, _ = tag.NewKey("kind")
KeyNamespaceKind, _ = tag.NewKey("ns")
+10
View File
@@ -0,0 +1,10 @@
package eventloop
import (
"github.com/solo-io/solo-kit/pkg/api/v1/clients"
)
// common interface for event loops
type EventLoop interface {
Run(namespaces []string, opts clients.WatchOpts) (<-chan error, error)
}
@@ -360,7 +360,7 @@ func Validate(resource Resource) error {
}
func ValidateName(name string) error {
errs := validation.IsDNS1035Label(name)
errs := validation.IsDNS1123Subdomain(name)
if len(name) < 1 {
errs = append(errs, "name cannot be empty. Given: "+name)
}
+30
View File
@@ -0,0 +1,30 @@
package kubepod
import (
"reflect"
"github.com/solo-io/solo-kit/pkg/api/v1/resources/core"
"github.com/solo-io/solo-kit/pkg/utils/kubeutils"
kubev1 "k8s.io/api/core/v1"
)
type Pod kubev1.Pod
func (p *Pod) Clone() *Pod {
vp := kubev1.Pod(*p)
copy := vp.DeepCopy()
newP := Pod(*copy)
return &newP
}
func (p *Pod) GetMetadata() core.Metadata {
return kubeutils.FromKubeMeta(p.ObjectMeta)
}
func (p *Pod) SetMetadata(meta core.Metadata) {
p.ObjectMeta = kubeutils.ToKubeMeta(meta)
}
func (p *Pod) Equal(that interface{}) bool {
return reflect.DeepEqual(p, that)
}
@@ -0,0 +1,30 @@
package linkerd
import (
"reflect"
"github.com/linkerd/linkerd2/controller/gen/apis/serviceprofile/v1alpha1"
"github.com/solo-io/solo-kit/pkg/api/v1/resources/core"
"github.com/solo-io/solo-kit/pkg/utils/kubeutils"
)
type ServiceProfile v1alpha1.ServiceProfile
func (p *ServiceProfile) GetMetadata() core.Metadata {
return kubeutils.FromKubeMeta(p.ObjectMeta)
}
func (p *ServiceProfile) SetMetadata(meta core.Metadata) {
p.ObjectMeta = kubeutils.ToKubeMeta(meta)
}
func (p *ServiceProfile) Equal(that interface{}) bool {
return reflect.DeepEqual(p, that)
}
func (p *ServiceProfile) Clone() *ServiceProfile {
vp := v1alpha1.ServiceProfile(*p)
copy := vp.DeepCopy()
newP := ServiceProfile(*copy)
return &newP
}
@@ -0,0 +1,170 @@
// Code generated by solo-kit. DO NOT EDIT.
package v1alpha1
import (
"sort"
"github.com/solo-io/solo-kit/pkg/api/v1/clients/kube/crd"
"github.com/solo-io/solo-kit/pkg/api/v1/resources"
"github.com/solo-io/solo-kit/pkg/api/v1/resources/core"
"github.com/solo-io/solo-kit/pkg/errors"
"github.com/solo-io/solo-kit/pkg/utils/hashutils"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)
func NewMeshPolicy(namespace, name string) *MeshPolicy {
meshpolicy := &MeshPolicy{}
meshpolicy.SetMetadata(core.Metadata{
Name: name,
Namespace: namespace,
})
return meshpolicy
}
func (r *MeshPolicy) SetMetadata(meta core.Metadata) {
r.Metadata = meta
}
func (r *MeshPolicy) SetStatus(status core.Status) {
r.Status = status
}
func (r *MeshPolicy) Hash() uint64 {
metaCopy := r.GetMetadata()
metaCopy.ResourceVersion = ""
return hashutils.HashAll(
metaCopy,
r.Targets,
r.Peers,
r.PeerIsOptional,
r.Origins,
r.OriginIsOptional,
r.PrincipalBinding,
)
}
type MeshPolicyList []*MeshPolicy
type MeshpoliciesByNamespace map[string]MeshPolicyList
// namespace is optional, if left empty, names can collide if the list contains more than one with the same name
func (list MeshPolicyList) Find(namespace, name string) (*MeshPolicy, error) {
for _, meshPolicy := range list {
if meshPolicy.GetMetadata().Name == name {
if namespace == "" || meshPolicy.GetMetadata().Namespace == namespace {
return meshPolicy, nil
}
}
}
return nil, errors.Errorf("list did not find meshPolicy %v.%v", namespace, name)
}
func (list MeshPolicyList) AsResources() resources.ResourceList {
var ress resources.ResourceList
for _, meshPolicy := range list {
ress = append(ress, meshPolicy)
}
return ress
}
func (list MeshPolicyList) AsInputResources() resources.InputResourceList {
var ress resources.InputResourceList
for _, meshPolicy := range list {
ress = append(ress, meshPolicy)
}
return ress
}
func (list MeshPolicyList) Names() []string {
var names []string
for _, meshPolicy := range list {
names = append(names, meshPolicy.GetMetadata().Name)
}
return names
}
func (list MeshPolicyList) NamespacesDotNames() []string {
var names []string
for _, meshPolicy := range list {
names = append(names, meshPolicy.GetMetadata().Namespace+"."+meshPolicy.GetMetadata().Name)
}
return names
}
func (list MeshPolicyList) Sort() MeshPolicyList {
sort.SliceStable(list, func(i, j int) bool {
return list[i].GetMetadata().Less(list[j].GetMetadata())
})
return list
}
func (list MeshPolicyList) Clone() MeshPolicyList {
var meshPolicyList MeshPolicyList
for _, meshPolicy := range list {
meshPolicyList = append(meshPolicyList, resources.Clone(meshPolicy).(*MeshPolicy))
}
return meshPolicyList
}
func (list MeshPolicyList) Each(f func(element *MeshPolicy)) {
for _, meshPolicy := range list {
f(meshPolicy)
}
}
func (list MeshPolicyList) AsInterfaces() []interface{} {
var asInterfaces []interface{}
list.Each(func(element *MeshPolicy) {
asInterfaces = append(asInterfaces, element)
})
return asInterfaces
}
func (byNamespace MeshpoliciesByNamespace) Add(meshPolicy ...*MeshPolicy) {
for _, item := range meshPolicy {
byNamespace[item.GetMetadata().Namespace] = append(byNamespace[item.GetMetadata().Namespace], item)
}
}
func (byNamespace MeshpoliciesByNamespace) Clear(namespace string) {
delete(byNamespace, namespace)
}
func (byNamespace MeshpoliciesByNamespace) List() MeshPolicyList {
var list MeshPolicyList
for _, meshPolicyList := range byNamespace {
list = append(list, meshPolicyList...)
}
return list.Sort()
}
func (byNamespace MeshpoliciesByNamespace) Clone() MeshpoliciesByNamespace {
cloned := make(MeshpoliciesByNamespace)
for ns, list := range byNamespace {
cloned[ns] = list.Clone()
}
return cloned
}
var _ resources.Resource = &MeshPolicy{}
// Kubernetes Adapter for MeshPolicy
func (o *MeshPolicy) GetObjectKind() schema.ObjectKind {
t := MeshPolicyCrd.TypeMeta()
return &t
}
func (o *MeshPolicy) DeepCopyObject() runtime.Object {
return resources.Clone(o).(*MeshPolicy)
}
var MeshPolicyCrd = crd.NewCrd("authentication.istio.io",
"meshpolicies",
"authentication.istio.io",
"v1alpha1",
"MeshPolicy",
"meshpolicy",
true,
&MeshPolicy{})
@@ -0,0 +1,118 @@
// Code generated by solo-kit. DO NOT EDIT.
package v1alpha1
import (
"github.com/solo-io/solo-kit/pkg/api/v1/clients"
"github.com/solo-io/solo-kit/pkg/api/v1/clients/factory"
"github.com/solo-io/solo-kit/pkg/api/v1/resources"
"github.com/solo-io/solo-kit/pkg/errors"
)
type MeshPolicyClient interface {
BaseClient() clients.ResourceClient
Register() error
Read(name string, opts clients.ReadOpts) (*MeshPolicy, error)
Write(resource *MeshPolicy, opts clients.WriteOpts) (*MeshPolicy, error)
Delete(name string, opts clients.DeleteOpts) error
List(opts clients.ListOpts) (MeshPolicyList, error)
Watch(opts clients.WatchOpts) (<-chan MeshPolicyList, <-chan error, error)
}
type meshPolicyClient struct {
rc clients.ResourceClient
}
func NewMeshPolicyClient(rcFactory factory.ResourceClientFactory) (MeshPolicyClient, error) {
return NewMeshPolicyClientWithToken(rcFactory, "")
}
func NewMeshPolicyClientWithToken(rcFactory factory.ResourceClientFactory, token string) (MeshPolicyClient, error) {
rc, err := rcFactory.NewResourceClient(factory.NewResourceClientParams{
ResourceType: &MeshPolicy{},
Token: token,
})
if err != nil {
return nil, errors.Wrapf(err, "creating base MeshPolicy resource client")
}
return NewMeshPolicyClientWithBase(rc), nil
}
func NewMeshPolicyClientWithBase(rc clients.ResourceClient) MeshPolicyClient {
return &meshPolicyClient{
rc: rc,
}
}
func (client *meshPolicyClient) BaseClient() clients.ResourceClient {
return client.rc
}
func (client *meshPolicyClient) Register() error {
return client.rc.Register()
}
func (client *meshPolicyClient) Read(name string, opts clients.ReadOpts) (*MeshPolicy, error) {
opts = opts.WithDefaults()
resource, err := client.rc.Read("", name, opts)
if err != nil {
return nil, err
}
return resource.(*MeshPolicy), nil
}
func (client *meshPolicyClient) Write(meshPolicy *MeshPolicy, opts clients.WriteOpts) (*MeshPolicy, error) {
opts = opts.WithDefaults()
resource, err := client.rc.Write(meshPolicy, opts)
if err != nil {
return nil, err
}
return resource.(*MeshPolicy), nil
}
func (client *meshPolicyClient) Delete(name string, opts clients.DeleteOpts) error {
opts = opts.WithDefaults()
return client.rc.Delete("", name, opts)
}
func (client *meshPolicyClient) List(opts clients.ListOpts) (MeshPolicyList, error) {
opts = opts.WithDefaults()
resourceList, err := client.rc.List("", opts)
if err != nil {
return nil, err
}
return convertToMeshPolicy(resourceList), nil
}
func (client *meshPolicyClient) Watch(opts clients.WatchOpts) (<-chan MeshPolicyList, <-chan error, error) {
opts = opts.WithDefaults()
resourcesChan, errs, initErr := client.rc.Watch("", opts)
if initErr != nil {
return nil, nil, initErr
}
meshpoliciesChan := make(chan MeshPolicyList)
go func() {
for {
select {
case resourceList := <-resourcesChan:
meshpoliciesChan <- convertToMeshPolicy(resourceList)
case <-opts.Ctx.Done():
close(meshpoliciesChan)
return
}
}
}()
return meshpoliciesChan, errs, nil
}
func convertToMeshPolicy(resources resources.ResourceList) MeshPolicyList {
var meshPolicyList MeshPolicyList
for _, resource := range resources {
meshPolicyList = append(meshPolicyList, resource.(*MeshPolicy))
}
return meshPolicyList
}
@@ -0,0 +1,47 @@
// Code generated by solo-kit. DO NOT EDIT.
package v1alpha1
import (
"github.com/solo-io/go-utils/contextutils"
"github.com/solo-io/solo-kit/pkg/api/v1/clients"
"github.com/solo-io/solo-kit/pkg/api/v1/reconcile"
"github.com/solo-io/solo-kit/pkg/api/v1/resources"
)
// Option to copy anything from the original to the desired before writing. Return value of false means don't update
type TransitionMeshPolicyFunc func(original, desired *MeshPolicy) (bool, error)
type MeshPolicyReconciler interface {
Reconcile(namespace string, desiredResources MeshPolicyList, transition TransitionMeshPolicyFunc, opts clients.ListOpts) error
}
func meshPolicysToResources(list MeshPolicyList) resources.ResourceList {
var resourceList resources.ResourceList
for _, meshPolicy := range list {
resourceList = append(resourceList, meshPolicy)
}
return resourceList
}
func NewMeshPolicyReconciler(client MeshPolicyClient) MeshPolicyReconciler {
return &meshPolicyReconciler{
base: reconcile.NewReconciler(client.BaseClient()),
}
}
type meshPolicyReconciler struct {
base reconcile.Reconciler
}
func (r *meshPolicyReconciler) Reconcile(namespace string, desiredResources MeshPolicyList, transition TransitionMeshPolicyFunc, opts clients.ListOpts) error {
opts = opts.WithDefaults()
opts.Ctx = contextutils.WithLogger(opts.Ctx, "meshPolicy_reconciler")
var transitionResources reconcile.TransitionResourcesFunc
if transition != nil {
transitionResources = func(original, desired resources.Resource) (bool, error) {
return transition(original.(*MeshPolicy), desired.(*MeshPolicy))
}
}
return r.base.Reconcile(namespace, meshPolicysToResources(desiredResources), transitionResources, opts)
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,170 @@
// Code generated by solo-kit. DO NOT EDIT.
package v1alpha1
import (
"sort"
"github.com/solo-io/solo-kit/pkg/api/v1/clients/kube/crd"
"github.com/solo-io/solo-kit/pkg/api/v1/resources"
"github.com/solo-io/solo-kit/pkg/api/v1/resources/core"
"github.com/solo-io/solo-kit/pkg/errors"
"github.com/solo-io/solo-kit/pkg/utils/hashutils"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)
func NewPolicy(namespace, name string) *Policy {
policy := &Policy{}
policy.SetMetadata(core.Metadata{
Name: name,
Namespace: namespace,
})
return policy
}
func (r *Policy) SetMetadata(meta core.Metadata) {
r.Metadata = meta
}
func (r *Policy) SetStatus(status core.Status) {
r.Status = status
}
func (r *Policy) Hash() uint64 {
metaCopy := r.GetMetadata()
metaCopy.ResourceVersion = ""
return hashutils.HashAll(
metaCopy,
r.Targets,
r.Peers,
r.PeerIsOptional,
r.Origins,
r.OriginIsOptional,
r.PrincipalBinding,
)
}
type PolicyList []*Policy
type PoliciesByNamespace map[string]PolicyList
// namespace is optional, if left empty, names can collide if the list contains more than one with the same name
func (list PolicyList) Find(namespace, name string) (*Policy, error) {
for _, policy := range list {
if policy.GetMetadata().Name == name {
if namespace == "" || policy.GetMetadata().Namespace == namespace {
return policy, nil
}
}
}
return nil, errors.Errorf("list did not find policy %v.%v", namespace, name)
}
func (list PolicyList) AsResources() resources.ResourceList {
var ress resources.ResourceList
for _, policy := range list {
ress = append(ress, policy)
}
return ress
}
func (list PolicyList) AsInputResources() resources.InputResourceList {
var ress resources.InputResourceList
for _, policy := range list {
ress = append(ress, policy)
}
return ress
}
func (list PolicyList) Names() []string {
var names []string
for _, policy := range list {
names = append(names, policy.GetMetadata().Name)
}
return names
}
func (list PolicyList) NamespacesDotNames() []string {
var names []string
for _, policy := range list {
names = append(names, policy.GetMetadata().Namespace+"."+policy.GetMetadata().Name)
}
return names
}
func (list PolicyList) Sort() PolicyList {
sort.SliceStable(list, func(i, j int) bool {
return list[i].GetMetadata().Less(list[j].GetMetadata())
})
return list
}
func (list PolicyList) Clone() PolicyList {
var policyList PolicyList
for _, policy := range list {
policyList = append(policyList, resources.Clone(policy).(*Policy))
}
return policyList
}
func (list PolicyList) Each(f func(element *Policy)) {
for _, policy := range list {
f(policy)
}
}
func (list PolicyList) AsInterfaces() []interface{} {
var asInterfaces []interface{}
list.Each(func(element *Policy) {
asInterfaces = append(asInterfaces, element)
})
return asInterfaces
}
func (byNamespace PoliciesByNamespace) Add(policy ...*Policy) {
for _, item := range policy {
byNamespace[item.GetMetadata().Namespace] = append(byNamespace[item.GetMetadata().Namespace], item)
}
}
func (byNamespace PoliciesByNamespace) Clear(namespace string) {
delete(byNamespace, namespace)
}
func (byNamespace PoliciesByNamespace) List() PolicyList {
var list PolicyList
for _, policyList := range byNamespace {
list = append(list, policyList...)
}
return list.Sort()
}
func (byNamespace PoliciesByNamespace) Clone() PoliciesByNamespace {
cloned := make(PoliciesByNamespace)
for ns, list := range byNamespace {
cloned[ns] = list.Clone()
}
return cloned
}
var _ resources.Resource = &Policy{}
// Kubernetes Adapter for Policy
func (o *Policy) GetObjectKind() schema.ObjectKind {
t := PolicyCrd.TypeMeta()
return &t
}
func (o *Policy) DeepCopyObject() runtime.Object {
return resources.Clone(o).(*Policy)
}
var PolicyCrd = crd.NewCrd("authentication.istio.io",
"policies",
"authentication.istio.io",
"v1alpha1",
"Policy",
"policy",
false,
&Policy{})
@@ -0,0 +1,118 @@
// Code generated by solo-kit. DO NOT EDIT.
package v1alpha1
import (
"github.com/solo-io/solo-kit/pkg/api/v1/clients"
"github.com/solo-io/solo-kit/pkg/api/v1/clients/factory"
"github.com/solo-io/solo-kit/pkg/api/v1/resources"
"github.com/solo-io/solo-kit/pkg/errors"
)
type PolicyClient interface {
BaseClient() clients.ResourceClient
Register() error
Read(namespace, name string, opts clients.ReadOpts) (*Policy, error)
Write(resource *Policy, opts clients.WriteOpts) (*Policy, error)
Delete(namespace, name string, opts clients.DeleteOpts) error
List(namespace string, opts clients.ListOpts) (PolicyList, error)
Watch(namespace string, opts clients.WatchOpts) (<-chan PolicyList, <-chan error, error)
}
type policyClient struct {
rc clients.ResourceClient
}
func NewPolicyClient(rcFactory factory.ResourceClientFactory) (PolicyClient, error) {
return NewPolicyClientWithToken(rcFactory, "")
}
func NewPolicyClientWithToken(rcFactory factory.ResourceClientFactory, token string) (PolicyClient, error) {
rc, err := rcFactory.NewResourceClient(factory.NewResourceClientParams{
ResourceType: &Policy{},
Token: token,
})
if err != nil {
return nil, errors.Wrapf(err, "creating base Policy resource client")
}
return NewPolicyClientWithBase(rc), nil
}
func NewPolicyClientWithBase(rc clients.ResourceClient) PolicyClient {
return &policyClient{
rc: rc,
}
}
func (client *policyClient) BaseClient() clients.ResourceClient {
return client.rc
}
func (client *policyClient) Register() error {
return client.rc.Register()
}
func (client *policyClient) Read(namespace, name string, opts clients.ReadOpts) (*Policy, error) {
opts = opts.WithDefaults()
resource, err := client.rc.Read(namespace, name, opts)
if err != nil {
return nil, err
}
return resource.(*Policy), nil
}
func (client *policyClient) Write(policy *Policy, opts clients.WriteOpts) (*Policy, error) {
opts = opts.WithDefaults()
resource, err := client.rc.Write(policy, opts)
if err != nil {
return nil, err
}
return resource.(*Policy), nil
}
func (client *policyClient) Delete(namespace, name string, opts clients.DeleteOpts) error {
opts = opts.WithDefaults()
return client.rc.Delete(namespace, name, opts)
}
func (client *policyClient) List(namespace string, opts clients.ListOpts) (PolicyList, error) {
opts = opts.WithDefaults()
resourceList, err := client.rc.List(namespace, opts)
if err != nil {
return nil, err
}
return convertToPolicy(resourceList), nil
}
func (client *policyClient) Watch(namespace string, opts clients.WatchOpts) (<-chan PolicyList, <-chan error, error) {
opts = opts.WithDefaults()
resourcesChan, errs, initErr := client.rc.Watch(namespace, opts)
if initErr != nil {
return nil, nil, initErr
}
policiesChan := make(chan PolicyList)
go func() {
for {
select {
case resourceList := <-resourcesChan:
policiesChan <- convertToPolicy(resourceList)
case <-opts.Ctx.Done():
close(policiesChan)
return
}
}
}()
return policiesChan, errs, nil
}
func convertToPolicy(resources resources.ResourceList) PolicyList {
var policyList PolicyList
for _, resource := range resources {
policyList = append(policyList, resource.(*Policy))
}
return policyList
}
@@ -0,0 +1,47 @@
// Code generated by solo-kit. DO NOT EDIT.
package v1alpha1
import (
"github.com/solo-io/go-utils/contextutils"
"github.com/solo-io/solo-kit/pkg/api/v1/clients"
"github.com/solo-io/solo-kit/pkg/api/v1/reconcile"
"github.com/solo-io/solo-kit/pkg/api/v1/resources"
)
// Option to copy anything from the original to the desired before writing. Return value of false means don't update
type TransitionPolicyFunc func(original, desired *Policy) (bool, error)
type PolicyReconciler interface {
Reconcile(namespace string, desiredResources PolicyList, transition TransitionPolicyFunc, opts clients.ListOpts) error
}
func policysToResources(list PolicyList) resources.ResourceList {
var resourceList resources.ResourceList
for _, policy := range list {
resourceList = append(resourceList, policy)
}
return resourceList
}
func NewPolicyReconciler(client PolicyClient) PolicyReconciler {
return &policyReconciler{
base: reconcile.NewReconciler(client.BaseClient()),
}
}
type policyReconciler struct {
base reconcile.Reconciler
}
func (r *policyReconciler) Reconcile(namespace string, desiredResources PolicyList, transition TransitionPolicyFunc, opts clients.ListOpts) error {
opts = opts.WithDefaults()
opts.Ctx = contextutils.WithLogger(opts.Ctx, "policy_reconciler")
var transitionResources reconcile.TransitionResourcesFunc
if transition != nil {
transitionResources = func(original, desired resources.Resource) (bool, error) {
return transition(original.(*Policy), desired.(*Policy))
}
}
return r.base.Reconcile(namespace, policysToResources(desiredResources), transitionResources, opts)
}
@@ -1,148 +0,0 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: github.com/solo-io/supergloo/api/external/kubernetes/core/v1/kube_types.proto
package v1
import (
bytes "bytes"
fmt "fmt"
math "math"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
core "github.com/solo-io/solo-kit/pkg/api/v1/resources/core"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
//
//Intermediary proto representation of a kubernetes pod.
//Used to integrate solo-kit with kubernetes API
type Pod struct {
// Metadata contains the object metadata for this resource
Metadata core.Metadata `protobuf:"bytes,101,opt,name=metadata,proto3" json:"metadata"`
// the kubernetes pod spec as an inline json string
Spec string `protobuf:"bytes,1,opt,name=spec,proto3" json:"spec,omitempty"`
// the kubernetes pod status as an inline json string
Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Pod) Reset() { *m = Pod{} }
func (m *Pod) String() string { return proto.CompactTextString(m) }
func (*Pod) ProtoMessage() {}
func (*Pod) Descriptor() ([]byte, []int) {
return fileDescriptor_c148cb2834f27f59, []int{0}
}
func (m *Pod) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Pod.Unmarshal(m, b)
}
func (m *Pod) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Pod.Marshal(b, m, deterministic)
}
func (m *Pod) XXX_Merge(src proto.Message) {
xxx_messageInfo_Pod.Merge(m, src)
}
func (m *Pod) XXX_Size() int {
return xxx_messageInfo_Pod.Size(m)
}
func (m *Pod) XXX_DiscardUnknown() {
xxx_messageInfo_Pod.DiscardUnknown(m)
}
var xxx_messageInfo_Pod proto.InternalMessageInfo
func (m *Pod) GetMetadata() core.Metadata {
if m != nil {
return m.Metadata
}
return core.Metadata{}
}
func (m *Pod) GetSpec() string {
if m != nil {
return m.Spec
}
return ""
}
func (m *Pod) GetStatus() string {
if m != nil {
return m.Status
}
return ""
}
func init() {
proto.RegisterType((*Pod)(nil), "core.kubernetes.io.Pod")
}
func init() {
proto.RegisterFile("github.com/solo-io/supergloo/api/external/kubernetes/core/v1/kube_types.proto", fileDescriptor_c148cb2834f27f59)
}
var fileDescriptor_c148cb2834f27f59 = []byte{
// 270 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xf2, 0x4d, 0xcf, 0x2c, 0xc9,
0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x2f, 0xce, 0xcf, 0xc9, 0xd7, 0xcd, 0xcc, 0xd7, 0x2f,
0x2e, 0x2d, 0x48, 0x2d, 0x4a, 0xcf, 0xc9, 0xcf, 0xd7, 0x4f, 0x2c, 0xc8, 0xd4, 0x4f, 0xad, 0x28,
0x49, 0x2d, 0xca, 0x4b, 0xcc, 0xd1, 0xcf, 0x2e, 0x4d, 0x4a, 0x2d, 0xca, 0x4b, 0x2d, 0x49, 0x2d,
0xd6, 0x4f, 0xce, 0x2f, 0x4a, 0xd5, 0x2f, 0x33, 0x04, 0x0b, 0xc5, 0x97, 0x54, 0x16, 0xa4, 0x16,
0xeb, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0x09, 0x81, 0x64, 0xf4, 0x10, 0x2a, 0xf5, 0x32, 0xf3,
0xa5, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0xd2, 0xfa, 0x20, 0x16, 0x44, 0xa5, 0x94, 0x21, 0x36,
0x8b, 0x41, 0x74, 0x76, 0x66, 0x09, 0xd8, 0xde, 0x32, 0x43, 0xfd, 0xdc, 0xd4, 0x92, 0xc4, 0x94,
0xc4, 0x92, 0x44, 0x12, 0xb4, 0xc0, 0xf8, 0x10, 0x2d, 0x4a, 0x0d, 0x8c, 0x5c, 0xcc, 0x01, 0xf9,
0x29, 0x42, 0x16, 0x5c, 0x1c, 0x30, 0xc3, 0x24, 0x52, 0x15, 0x18, 0x35, 0xb8, 0x8d, 0xc4, 0xf4,
0xc0, 0x4e, 0x05, 0xa9, 0xd7, 0xcb, 0xcc, 0xd7, 0xf3, 0x85, 0xca, 0x3a, 0xb1, 0x9c, 0xb8, 0x27,
0xcf, 0x10, 0x04, 0x57, 0x2d, 0x24, 0xc4, 0xc5, 0x52, 0x5c, 0x90, 0x9a, 0x2c, 0xc1, 0xa8, 0xc0,
0xa8, 0xc1, 0x19, 0x04, 0x66, 0x0b, 0x89, 0x71, 0xb1, 0x15, 0x97, 0x24, 0x96, 0x94, 0x16, 0x4b,
0x30, 0x81, 0x45, 0xa1, 0x3c, 0x2b, 0xe1, 0xa6, 0x8f, 0x2c, 0xac, 0x5c, 0xcc, 0x05, 0xf9, 0x29,
0x4d, 0x1f, 0x59, 0xd8, 0x84, 0x58, 0x0a, 0xf2, 0x53, 0x8a, 0x9d, 0xdc, 0x56, 0x3c, 0x92, 0x63,
0x8c, 0x72, 0xc0, 0x1b, 0xce, 0x05, 0xd9, 0xe9, 0x84, 0xc2, 0x3a, 0x89, 0x0d, 0xec, 0x23, 0x63,
0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xef, 0x5f, 0x36, 0x43, 0xb2, 0x01, 0x00, 0x00,
}
func (this *Pod) Equal(that interface{}) bool {
if that == nil {
return this == nil
}
that1, ok := that.(*Pod)
if !ok {
that2, ok := that.(Pod)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
return this == nil
} else if this == nil {
return false
}
if !this.Metadata.Equal(&that1.Metadata) {
return false
}
if this.Spec != that1.Spec {
return false
}
if this.Status != that1.Status {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
+2 -5
View File
@@ -11,6 +11,7 @@ import (
"github.com/solo-io/go-utils/contextutils"
"github.com/solo-io/solo-kit/pkg/api/v1/clients"
"github.com/solo-io/solo-kit/pkg/api/v1/eventloop"
"github.com/solo-io/solo-kit/pkg/errors"
"github.com/solo-io/solo-kit/pkg/utils/errutils"
)
@@ -31,16 +32,12 @@ func (s ConfigSyncers) Sync(ctx context.Context, snapshot *ConfigSnapshot) error
return multiErr.ErrorOrNil()
}
type ConfigEventLoop interface {
Run(namespaces []string, opts clients.WatchOpts) (<-chan error, error)
}
type configEventLoop struct {
emitter ConfigEmitter
syncer ConfigSyncer
}
func NewConfigEventLoop(emitter ConfigEmitter, syncer ConfigSyncer) ConfigEventLoop {
func NewConfigEventLoop(emitter ConfigEmitter, syncer ConfigSyncer) eventloop.EventLoop {
return &configEventLoop{
emitter: emitter,
syncer: syncer,
+1 -2
View File
@@ -6,7 +6,6 @@ import (
"fmt"
gloo_solo_io "github.com/solo-io/gloo/projects/gloo/pkg/api/v1"
core_kubernetes_io "github.com/solo-io/supergloo/pkg/api/external/kubernetes/core/v1"
"github.com/solo-io/solo-kit/pkg/utils/hashutils"
"go.uber.org/zap"
@@ -20,7 +19,7 @@ type ConfigSnapshot struct {
Securityrules SecurityrulesByNamespace
Tlssecrets TlssecretsByNamespace
Upstreams gloo_solo_io.UpstreamsByNamespace
Pods core_kubernetes_io.PodsByNamespace
Pods PodsByNamespace
}
func (s ConfigSnapshot) Clone() ConfigSnapshot {
@@ -7,7 +7,6 @@ import (
"time"
gloo_solo_io "github.com/solo-io/gloo/projects/gloo/pkg/api/v1"
core_kubernetes_io "github.com/solo-io/supergloo/pkg/api/external/kubernetes/core/v1"
"go.opencensus.io/stats"
"go.opencensus.io/stats/view"
@@ -51,15 +50,15 @@ type ConfigEmitter interface {
SecurityRule() SecurityRuleClient
TlsSecret() TlsSecretClient
Upstream() gloo_solo_io.UpstreamClient
Pod() core_kubernetes_io.PodClient
Pod() PodClient
Snapshots(watchNamespaces []string, opts clients.WatchOpts) (<-chan *ConfigSnapshot, <-chan error, error)
}
func NewConfigEmitter(meshClient MeshClient, meshIngressClient MeshIngressClient, meshGroupClient MeshGroupClient, routingRuleClient RoutingRuleClient, securityRuleClient SecurityRuleClient, tlsSecretClient TlsSecretClient, upstreamClient gloo_solo_io.UpstreamClient, podClient core_kubernetes_io.PodClient) ConfigEmitter {
func NewConfigEmitter(meshClient MeshClient, meshIngressClient MeshIngressClient, meshGroupClient MeshGroupClient, routingRuleClient RoutingRuleClient, securityRuleClient SecurityRuleClient, tlsSecretClient TlsSecretClient, upstreamClient gloo_solo_io.UpstreamClient, podClient PodClient) ConfigEmitter {
return NewConfigEmitterWithEmit(meshClient, meshIngressClient, meshGroupClient, routingRuleClient, securityRuleClient, tlsSecretClient, upstreamClient, podClient, make(chan struct{}))
}
func NewConfigEmitterWithEmit(meshClient MeshClient, meshIngressClient MeshIngressClient, meshGroupClient MeshGroupClient, routingRuleClient RoutingRuleClient, securityRuleClient SecurityRuleClient, tlsSecretClient TlsSecretClient, upstreamClient gloo_solo_io.UpstreamClient, podClient core_kubernetes_io.PodClient, emit <-chan struct{}) ConfigEmitter {
func NewConfigEmitterWithEmit(meshClient MeshClient, meshIngressClient MeshIngressClient, meshGroupClient MeshGroupClient, routingRuleClient RoutingRuleClient, securityRuleClient SecurityRuleClient, tlsSecretClient TlsSecretClient, upstreamClient gloo_solo_io.UpstreamClient, podClient PodClient, emit <-chan struct{}) ConfigEmitter {
return &configEmitter{
mesh: meshClient,
meshIngress: meshIngressClient,
@@ -82,7 +81,7 @@ type configEmitter struct {
securityRule SecurityRuleClient
tlsSecret TlsSecretClient
upstream gloo_solo_io.UpstreamClient
pod core_kubernetes_io.PodClient
pod PodClient
}
func (c *configEmitter) Register() error {
@@ -141,7 +140,7 @@ func (c *configEmitter) Upstream() gloo_solo_io.UpstreamClient {
return c.upstream
}
func (c *configEmitter) Pod() core_kubernetes_io.PodClient {
func (c *configEmitter) Pod() PodClient {
return c.pod
}
@@ -205,7 +204,7 @@ func (c *configEmitter) Snapshots(watchNamespaces []string, opts clients.WatchOp
upstreamChan := make(chan upstreamListWithNamespace)
/* Create channel for Pod */
type podListWithNamespace struct {
list core_kubernetes_io.PodList
list PodList
namespace string
}
podChan := make(chan podListWithNamespace)
@@ -0,0 +1,93 @@
// Code generated by solo-kit. DO NOT EDIT.
package v1
import (
"context"
"go.opencensus.io/trace"
"github.com/hashicorp/go-multierror"
"github.com/solo-io/go-utils/contextutils"
"github.com/solo-io/solo-kit/pkg/api/v1/clients"
"github.com/solo-io/solo-kit/pkg/api/v1/eventloop"
"github.com/solo-io/solo-kit/pkg/errors"
"github.com/solo-io/solo-kit/pkg/utils/errutils"
)
type DiscoverySyncer interface {
Sync(context.Context, *DiscoverySnapshot) error
}
type DiscoverySyncers []DiscoverySyncer
func (s DiscoverySyncers) Sync(ctx context.Context, snapshot *DiscoverySnapshot) error {
var multiErr *multierror.Error
for _, syncer := range s {
if err := syncer.Sync(ctx, snapshot); err != nil {
multiErr = multierror.Append(multiErr, err)
}
}
return multiErr.ErrorOrNil()
}
type discoveryEventLoop struct {
emitter DiscoveryEmitter
syncer DiscoverySyncer
}
func NewDiscoveryEventLoop(emitter DiscoveryEmitter, syncer DiscoverySyncer) eventloop.EventLoop {
return &discoveryEventLoop{
emitter: emitter,
syncer: syncer,
}
}
func (el *discoveryEventLoop) Run(namespaces []string, opts clients.WatchOpts) (<-chan error, error) {
opts = opts.WithDefaults()
opts.Ctx = contextutils.WithLogger(opts.Ctx, "v1.event_loop")
logger := contextutils.LoggerFrom(opts.Ctx)
logger.Infof("event loop started")
errs := make(chan error)
watch, emitterErrs, err := el.emitter.Snapshots(namespaces, opts)
if err != nil {
return nil, errors.Wrapf(err, "starting snapshot watch")
}
go errutils.AggregateErrs(opts.Ctx, errs, emitterErrs, "v1.emitter errors")
go func() {
// create a new context for each loop, cancel it before each loop
var cancel context.CancelFunc = func() {}
// use closure to allow cancel function to be updated as context changes
defer func() { cancel() }()
for {
select {
case snapshot, ok := <-watch:
if !ok {
return
}
// cancel any open watches from previous loop
cancel()
ctx, span := trace.StartSpan(opts.Ctx, "discovery.supergloo.solo.io.EventLoopSync")
ctx, canc := context.WithCancel(ctx)
cancel = canc
err := el.syncer.Sync(ctx, snapshot)
span.End()
if err != nil {
select {
case errs <- err:
default:
logger.Errorf("write error channel is full! could not propagate err: %v", err)
}
}
case <-opts.Ctx.Done():
return
}
}
}()
return errs, nil
}
@@ -0,0 +1,90 @@
// Code generated by solo-kit. DO NOT EDIT.
package v1
import (
"fmt"
"github.com/solo-io/solo-kit/pkg/utils/hashutils"
"go.uber.org/zap"
)
type DiscoverySnapshot struct {
Pods PodsByNamespace
Meshes MeshesByNamespace
Installs InstallsByNamespace
}
func (s DiscoverySnapshot) Clone() DiscoverySnapshot {
return DiscoverySnapshot{
Pods: s.Pods.Clone(),
Meshes: s.Meshes.Clone(),
Installs: s.Installs.Clone(),
}
}
func (s DiscoverySnapshot) Hash() uint64 {
return hashutils.HashAll(
s.hashPods(),
s.hashMeshes(),
s.hashInstalls(),
)
}
func (s DiscoverySnapshot) hashPods() uint64 {
return hashutils.HashAll(s.Pods.List().AsInterfaces()...)
}
func (s DiscoverySnapshot) hashMeshes() uint64 {
return hashutils.HashAll(s.Meshes.List().AsInterfaces()...)
}
func (s DiscoverySnapshot) hashInstalls() uint64 {
return hashutils.HashAll(s.Installs.List().AsInterfaces()...)
}
func (s DiscoverySnapshot) HashFields() []zap.Field {
var fields []zap.Field
fields = append(fields, zap.Uint64("pods", s.hashPods()))
fields = append(fields, zap.Uint64("meshes", s.hashMeshes()))
fields = append(fields, zap.Uint64("installs", s.hashInstalls()))
return append(fields, zap.Uint64("snapshotHash", s.Hash()))
}
type DiscoverySnapshotStringer struct {
Version uint64
Pods []string
Meshes []string
Installs []string
}
func (ss DiscoverySnapshotStringer) String() string {
s := fmt.Sprintf("DiscoverySnapshot %v\n", ss.Version)
s += fmt.Sprintf(" Pods %v\n", len(ss.Pods))
for _, name := range ss.Pods {
s += fmt.Sprintf(" %v\n", name)
}
s += fmt.Sprintf(" Meshes %v\n", len(ss.Meshes))
for _, name := range ss.Meshes {
s += fmt.Sprintf(" %v\n", name)
}
s += fmt.Sprintf(" Installs %v\n", len(ss.Installs))
for _, name := range ss.Installs {
s += fmt.Sprintf(" %v\n", name)
}
return s
}
func (s DiscoverySnapshot) Stringer() DiscoverySnapshotStringer {
return DiscoverySnapshotStringer{
Version: s.Hash(),
Pods: s.Pods.List().NamespacesDotNames(),
Meshes: s.Meshes.List().NamespacesDotNames(),
Installs: s.Installs.List().NamespacesDotNames(),
}
}
@@ -0,0 +1,249 @@
// Code generated by solo-kit. DO NOT EDIT.
package v1
import (
"sync"
"time"
"go.opencensus.io/stats"
"go.opencensus.io/stats/view"
"go.opencensus.io/tag"
"github.com/solo-io/solo-kit/pkg/api/v1/clients"
"github.com/solo-io/solo-kit/pkg/errors"
"github.com/solo-io/solo-kit/pkg/utils/errutils"
)
var (
mDiscoverySnapshotIn = stats.Int64("discovery.supergloo.solo.io/snap_emitter/snap_in", "The number of snapshots in", "1")
mDiscoverySnapshotOut = stats.Int64("discovery.supergloo.solo.io/snap_emitter/snap_out", "The number of snapshots out", "1")
discoverysnapshotInView = &view.View{
Name: "discovery.supergloo.solo.io_snap_emitter/snap_in",
Measure: mDiscoverySnapshotIn,
Description: "The number of snapshots updates coming in",
Aggregation: view.Count(),
TagKeys: []tag.Key{},
}
discoverysnapshotOutView = &view.View{
Name: "discovery.supergloo.solo.io/snap_emitter/snap_out",
Measure: mDiscoverySnapshotOut,
Description: "The number of snapshots updates going out",
Aggregation: view.Count(),
TagKeys: []tag.Key{},
}
)
func init() {
view.Register(discoverysnapshotInView, discoverysnapshotOutView)
}
type DiscoveryEmitter interface {
Register() error
Pod() PodClient
Mesh() MeshClient
Install() InstallClient
Snapshots(watchNamespaces []string, opts clients.WatchOpts) (<-chan *DiscoverySnapshot, <-chan error, error)
}
func NewDiscoveryEmitter(podClient PodClient, meshClient MeshClient, installClient InstallClient) DiscoveryEmitter {
return NewDiscoveryEmitterWithEmit(podClient, meshClient, installClient, make(chan struct{}))
}
func NewDiscoveryEmitterWithEmit(podClient PodClient, meshClient MeshClient, installClient InstallClient, emit <-chan struct{}) DiscoveryEmitter {
return &discoveryEmitter{
pod: podClient,
mesh: meshClient,
install: installClient,
forceEmit: emit,
}
}
type discoveryEmitter struct {
forceEmit <-chan struct{}
pod PodClient
mesh MeshClient
install InstallClient
}
func (c *discoveryEmitter) Register() error {
if err := c.pod.Register(); err != nil {
return err
}
if err := c.mesh.Register(); err != nil {
return err
}
if err := c.install.Register(); err != nil {
return err
}
return nil
}
func (c *discoveryEmitter) Pod() PodClient {
return c.pod
}
func (c *discoveryEmitter) Mesh() MeshClient {
return c.mesh
}
func (c *discoveryEmitter) Install() InstallClient {
return c.install
}
func (c *discoveryEmitter) Snapshots(watchNamespaces []string, opts clients.WatchOpts) (<-chan *DiscoverySnapshot, <-chan error, error) {
if len(watchNamespaces) == 0 {
watchNamespaces = []string{""}
}
for _, ns := range watchNamespaces {
if ns == "" && len(watchNamespaces) > 1 {
return nil, nil, errors.Errorf("the \"\" namespace is used to watch all namespaces. Snapshots can either be tracked for " +
"specific namespaces or \"\" AllNamespaces, but not both.")
}
}
errs := make(chan error)
var done sync.WaitGroup
ctx := opts.Ctx
/* Create channel for Pod */
type podListWithNamespace struct {
list PodList
namespace string
}
podChan := make(chan podListWithNamespace)
/* Create channel for Mesh */
type meshListWithNamespace struct {
list MeshList
namespace string
}
meshChan := make(chan meshListWithNamespace)
/* Create channel for Install */
type installListWithNamespace struct {
list InstallList
namespace string
}
installChan := make(chan installListWithNamespace)
for _, namespace := range watchNamespaces {
/* Setup namespaced watch for Pod */
podNamespacesChan, podErrs, err := c.pod.Watch(namespace, opts)
if err != nil {
return nil, nil, errors.Wrapf(err, "starting Pod watch")
}
done.Add(1)
go func(namespace string) {
defer done.Done()
errutils.AggregateErrs(ctx, errs, podErrs, namespace+"-pods")
}(namespace)
/* Setup namespaced watch for Mesh */
meshNamespacesChan, meshErrs, err := c.mesh.Watch(namespace, opts)
if err != nil {
return nil, nil, errors.Wrapf(err, "starting Mesh watch")
}
done.Add(1)
go func(namespace string) {
defer done.Done()
errutils.AggregateErrs(ctx, errs, meshErrs, namespace+"-meshes")
}(namespace)
/* Setup namespaced watch for Install */
installNamespacesChan, installErrs, err := c.install.Watch(namespace, opts)
if err != nil {
return nil, nil, errors.Wrapf(err, "starting Install watch")
}
done.Add(1)
go func(namespace string) {
defer done.Done()
errutils.AggregateErrs(ctx, errs, installErrs, namespace+"-installs")
}(namespace)
/* Watch for changes and update snapshot */
go func(namespace string) {
for {
select {
case <-ctx.Done():
return
case podList := <-podNamespacesChan:
select {
case <-ctx.Done():
return
case podChan <- podListWithNamespace{list: podList, namespace: namespace}:
}
case meshList := <-meshNamespacesChan:
select {
case <-ctx.Done():
return
case meshChan <- meshListWithNamespace{list: meshList, namespace: namespace}:
}
case installList := <-installNamespacesChan:
select {
case <-ctx.Done():
return
case installChan <- installListWithNamespace{list: installList, namespace: namespace}:
}
}
}
}(namespace)
}
snapshots := make(chan *DiscoverySnapshot)
go func() {
originalSnapshot := DiscoverySnapshot{}
currentSnapshot := originalSnapshot.Clone()
timer := time.NewTicker(time.Second * 1)
sync := func() {
if originalSnapshot.Hash() == currentSnapshot.Hash() {
return
}
stats.Record(ctx, mDiscoverySnapshotOut.M(1))
originalSnapshot = currentSnapshot.Clone()
sentSnapshot := currentSnapshot.Clone()
snapshots <- &sentSnapshot
}
for {
record := func() { stats.Record(ctx, mDiscoverySnapshotIn.M(1)) }
select {
case <-timer.C:
sync()
case <-ctx.Done():
close(snapshots)
done.Wait()
close(errs)
return
case <-c.forceEmit:
sentSnapshot := currentSnapshot.Clone()
snapshots <- &sentSnapshot
case podNamespacedList := <-podChan:
record()
namespace := podNamespacedList.namespace
podList := podNamespacedList.list
currentSnapshot.Pods[namespace] = podList
case meshNamespacedList := <-meshChan:
record()
namespace := meshNamespacedList.namespace
meshList := meshNamespacedList.list
currentSnapshot.Meshes[namespace] = meshList
case installNamespacedList := <-installChan:
record()
namespace := installNamespacedList.namespace
installList := installNamespacedList.list
currentSnapshot.Installs[namespace] = installList
}
}
}()
return snapshots, errs, nil
}
+328 -193
View File
@@ -217,10 +217,160 @@ func _Install_OneofSizer(msg proto.Message) (n int) {
return n
}
//
//Generic container for mesh installs handled by supergloo
//
//Holds all configuration shared between different mesh types
type MeshInstall struct {
// The type of mesh to install
// currently only istio is supported
//
// Types that are valid to be assigned to MeshInstallType:
// *MeshInstall_IstioMesh
// *MeshInstall_LinkerdMesh
MeshInstallType isMeshInstall_MeshInstallType `protobuf_oneof:"mesh_install_type"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *MeshInstall) Reset() { *m = MeshInstall{} }
func (m *MeshInstall) String() string { return proto.CompactTextString(m) }
func (*MeshInstall) ProtoMessage() {}
func (*MeshInstall) Descriptor() ([]byte, []int) {
return fileDescriptor_7b058d98c63047dc, []int{1}
}
func (m *MeshInstall) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_MeshInstall.Unmarshal(m, b)
}
func (m *MeshInstall) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_MeshInstall.Marshal(b, m, deterministic)
}
func (m *MeshInstall) XXX_Merge(src proto.Message) {
xxx_messageInfo_MeshInstall.Merge(m, src)
}
func (m *MeshInstall) XXX_Size() int {
return xxx_messageInfo_MeshInstall.Size(m)
}
func (m *MeshInstall) XXX_DiscardUnknown() {
xxx_messageInfo_MeshInstall.DiscardUnknown(m)
}
var xxx_messageInfo_MeshInstall proto.InternalMessageInfo
type isMeshInstall_MeshInstallType interface {
isMeshInstall_MeshInstallType()
Equal(interface{}) bool
}
type MeshInstall_IstioMesh struct {
IstioMesh *IstioInstall `protobuf:"bytes,2,opt,name=istio_mesh,json=istioMesh,proto3,oneof"`
}
type MeshInstall_LinkerdMesh struct {
LinkerdMesh *LinkerdInstall `protobuf:"bytes,3,opt,name=linkerd_mesh,json=linkerdMesh,proto3,oneof"`
}
func (*MeshInstall_IstioMesh) isMeshInstall_MeshInstallType() {}
func (*MeshInstall_LinkerdMesh) isMeshInstall_MeshInstallType() {}
func (m *MeshInstall) GetMeshInstallType() isMeshInstall_MeshInstallType {
if m != nil {
return m.MeshInstallType
}
return nil
}
func (m *MeshInstall) GetIstioMesh() *IstioInstall {
if x, ok := m.GetMeshInstallType().(*MeshInstall_IstioMesh); ok {
return x.IstioMesh
}
return nil
}
func (m *MeshInstall) GetLinkerdMesh() *LinkerdInstall {
if x, ok := m.GetMeshInstallType().(*MeshInstall_LinkerdMesh); ok {
return x.LinkerdMesh
}
return nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*MeshInstall) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _MeshInstall_OneofMarshaler, _MeshInstall_OneofUnmarshaler, _MeshInstall_OneofSizer, []interface{}{
(*MeshInstall_IstioMesh)(nil),
(*MeshInstall_LinkerdMesh)(nil),
}
}
func _MeshInstall_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*MeshInstall)
// mesh_install_type
switch x := m.MeshInstallType.(type) {
case *MeshInstall_IstioMesh:
_ = b.EncodeVarint(2<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.IstioMesh); err != nil {
return err
}
case *MeshInstall_LinkerdMesh:
_ = b.EncodeVarint(3<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.LinkerdMesh); err != nil {
return err
}
case nil:
default:
return fmt.Errorf("MeshInstall.MeshInstallType has unexpected type %T", x)
}
return nil
}
func _MeshInstall_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*MeshInstall)
switch tag {
case 2: // mesh_install_type.istio_mesh
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(IstioInstall)
err := b.DecodeMessage(msg)
m.MeshInstallType = &MeshInstall_IstioMesh{msg}
return true, err
case 3: // mesh_install_type.linkerd_mesh
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(LinkerdInstall)
err := b.DecodeMessage(msg)
m.MeshInstallType = &MeshInstall_LinkerdMesh{msg}
return true, err
default:
return false, nil
}
}
func _MeshInstall_OneofSizer(msg proto.Message) (n int) {
m := msg.(*MeshInstall)
// mesh_install_type
switch x := m.MeshInstallType.(type) {
case *MeshInstall_IstioMesh:
s := proto.Size(x.IstioMesh)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *MeshInstall_LinkerdMesh:
s := proto.Size(x.LinkerdMesh)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
// Installation options for Istio
type IstioInstall struct {
// which version of the istio helm chart to install
// ignored if using custom helm chart
IstioVersion string `protobuf:"bytes,2,opt,name=istio_version,json=istioVersion,proto3" json:"istio_version,omitempty"`
// enable auto injection of pods
EnableAutoInject bool `protobuf:"varint,3,opt,name=enable_auto_inject,json=enableAutoInject,proto3" json:"enable_auto_inject,omitempty"`
@@ -245,7 +395,7 @@ func (m *IstioInstall) Reset() { *m = IstioInstall{} }
func (m *IstioInstall) String() string { return proto.CompactTextString(m) }
func (*IstioInstall) ProtoMessage() {}
func (*IstioInstall) Descriptor() ([]byte, []int) {
return fileDescriptor_7b058d98c63047dc, []int{1}
return fileDescriptor_7b058d98c63047dc, []int{2}
}
func (m *IstioInstall) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_IstioInstall.Unmarshal(m, b)
@@ -314,134 +464,62 @@ func (m *IstioInstall) GetInstallJaeger() bool {
return false
}
//
//Generic container for mesh installs handled by supergloo
//
//Holds all configuration shared between different mesh types
type MeshInstall struct {
// The type of mesh to install
// currently only istio is supported
//
// Types that are valid to be assigned to MeshInstallType:
// *MeshInstall_IstioMesh
MeshInstallType isMeshInstall_MeshInstallType `protobuf_oneof:"mesh_install_type"`
// reference to the Mesh crd that was created from this install
// read-only, set by the server after successful installation.
InstalledMesh *core.ResourceRef `protobuf:"bytes,6,opt,name=installed_mesh,json=installedMesh,proto3" json:"installed_mesh,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
// Installation options for Linkerd
type LinkerdInstall struct {
// which version of the Linkerd helm chart to install
LinkerdVersion string `protobuf:"bytes,2,opt,name=linkerd_version,json=linkerdVersion,proto3" json:"linkerd_version,omitempty"`
// enable auto injection of pods
EnableAutoInject bool `protobuf:"varint,3,opt,name=enable_auto_inject,json=enableAutoInject,proto3" json:"enable_auto_inject,omitempty"`
// enable mutual tls between pods
EnableMtls bool `protobuf:"varint,4,opt,name=enable_mtls,json=enableMtls,proto3" json:"enable_mtls,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *MeshInstall) Reset() { *m = MeshInstall{} }
func (m *MeshInstall) String() string { return proto.CompactTextString(m) }
func (*MeshInstall) ProtoMessage() {}
func (*MeshInstall) Descriptor() ([]byte, []int) {
return fileDescriptor_7b058d98c63047dc, []int{2}
func (m *LinkerdInstall) Reset() { *m = LinkerdInstall{} }
func (m *LinkerdInstall) String() string { return proto.CompactTextString(m) }
func (*LinkerdInstall) ProtoMessage() {}
func (*LinkerdInstall) Descriptor() ([]byte, []int) {
return fileDescriptor_7b058d98c63047dc, []int{3}
}
func (m *MeshInstall) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_MeshInstall.Unmarshal(m, b)
func (m *LinkerdInstall) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_LinkerdInstall.Unmarshal(m, b)
}
func (m *MeshInstall) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_MeshInstall.Marshal(b, m, deterministic)
func (m *LinkerdInstall) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_LinkerdInstall.Marshal(b, m, deterministic)
}
func (m *MeshInstall) XXX_Merge(src proto.Message) {
xxx_messageInfo_MeshInstall.Merge(m, src)
func (m *LinkerdInstall) XXX_Merge(src proto.Message) {
xxx_messageInfo_LinkerdInstall.Merge(m, src)
}
func (m *MeshInstall) XXX_Size() int {
return xxx_messageInfo_MeshInstall.Size(m)
func (m *LinkerdInstall) XXX_Size() int {
return xxx_messageInfo_LinkerdInstall.Size(m)
}
func (m *MeshInstall) XXX_DiscardUnknown() {
xxx_messageInfo_MeshInstall.DiscardUnknown(m)
func (m *LinkerdInstall) XXX_DiscardUnknown() {
xxx_messageInfo_LinkerdInstall.DiscardUnknown(m)
}
var xxx_messageInfo_MeshInstall proto.InternalMessageInfo
var xxx_messageInfo_LinkerdInstall proto.InternalMessageInfo
type isMeshInstall_MeshInstallType interface {
isMeshInstall_MeshInstallType()
Equal(interface{}) bool
}
type MeshInstall_IstioMesh struct {
IstioMesh *IstioInstall `protobuf:"bytes,2,opt,name=istio_mesh,json=istioMesh,proto3,oneof"`
}
func (*MeshInstall_IstioMesh) isMeshInstall_MeshInstallType() {}
func (m *MeshInstall) GetMeshInstallType() isMeshInstall_MeshInstallType {
func (m *LinkerdInstall) GetLinkerdVersion() string {
if m != nil {
return m.MeshInstallType
return m.LinkerdVersion
}
return nil
return ""
}
func (m *MeshInstall) GetIstioMesh() *IstioInstall {
if x, ok := m.GetMeshInstallType().(*MeshInstall_IstioMesh); ok {
return x.IstioMesh
}
return nil
}
func (m *MeshInstall) GetInstalledMesh() *core.ResourceRef {
func (m *LinkerdInstall) GetEnableAutoInject() bool {
if m != nil {
return m.InstalledMesh
return m.EnableAutoInject
}
return nil
return false
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*MeshInstall) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _MeshInstall_OneofMarshaler, _MeshInstall_OneofUnmarshaler, _MeshInstall_OneofSizer, []interface{}{
(*MeshInstall_IstioMesh)(nil),
func (m *LinkerdInstall) GetEnableMtls() bool {
if m != nil {
return m.EnableMtls
}
}
func _MeshInstall_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*MeshInstall)
// mesh_install_type
switch x := m.MeshInstallType.(type) {
case *MeshInstall_IstioMesh:
_ = b.EncodeVarint(2<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.IstioMesh); err != nil {
return err
}
case nil:
default:
return fmt.Errorf("MeshInstall.MeshInstallType has unexpected type %T", x)
}
return nil
}
func _MeshInstall_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*MeshInstall)
switch tag {
case 2: // mesh_install_type.istio_mesh
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(IstioInstall)
err := b.DecodeMessage(msg)
m.MeshInstallType = &MeshInstall_IstioMesh{msg}
return true, err
default:
return false, nil
}
}
func _MeshInstall_OneofSizer(msg proto.Message) (n int) {
m := msg.(*MeshInstall)
// mesh_install_type
switch x := m.MeshInstallType.(type) {
case *MeshInstall_IstioMesh:
s := proto.Size(x.IstioMesh)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
return false
}
//
@@ -467,7 +545,7 @@ func (m *MeshIngressInstall) Reset() { *m = MeshIngressInstall{} }
func (m *MeshIngressInstall) String() string { return proto.CompactTextString(m) }
func (*MeshIngressInstall) ProtoMessage() {}
func (*MeshIngressInstall) Descriptor() ([]byte, []int) {
return fileDescriptor_7b058d98c63047dc, []int{3}
return fileDescriptor_7b058d98c63047dc, []int{4}
}
func (m *MeshIngressInstall) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_MeshIngressInstall.Unmarshal(m, b)
@@ -590,7 +668,7 @@ func (m *GlooInstall) Reset() { *m = GlooInstall{} }
func (m *GlooInstall) String() string { return proto.CompactTextString(m) }
func (*GlooInstall) ProtoMessage() {}
func (*GlooInstall) Descriptor() ([]byte, []int) {
return fileDescriptor_7b058d98c63047dc, []int{4}
return fileDescriptor_7b058d98c63047dc, []int{5}
}
func (m *GlooInstall) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GlooInstall.Unmarshal(m, b)
@@ -626,8 +704,9 @@ func (m *GlooInstall) GetMeshes() []*core.ResourceRef {
func init() {
proto.RegisterType((*Install)(nil), "supergloo.solo.io.Install")
proto.RegisterType((*IstioInstall)(nil), "supergloo.solo.io.IstioInstall")
proto.RegisterType((*MeshInstall)(nil), "supergloo.solo.io.MeshInstall")
proto.RegisterType((*IstioInstall)(nil), "supergloo.solo.io.IstioInstall")
proto.RegisterType((*LinkerdInstall)(nil), "supergloo.solo.io.LinkerdInstall")
proto.RegisterType((*MeshIngressInstall)(nil), "supergloo.solo.io.MeshIngressInstall")
proto.RegisterType((*GlooInstall)(nil), "supergloo.solo.io.GlooInstall")
}
@@ -637,50 +716,52 @@ func init() {
}
var fileDescriptor_7b058d98c63047dc = []byte{
// 679 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xcd, 0x4e, 0xdb, 0x4a,
0x14, 0xc6, 0x10, 0x85, 0xe4, 0x24, 0x70, 0xc9, 0x5c, 0x40, 0x86, 0x05, 0xe1, 0xe6, 0x0a, 0xc1,
0x02, 0x1c, 0xd1, 0x1f, 0xa9, 0x62, 0x05, 0x41, 0x2a, 0x50, 0x89, 0xaa, 0x72, 0xa5, 0x2e, 0xba,
0xb1, 0x06, 0xe7, 0xc4, 0x19, 0x70, 0x3c, 0xd6, 0xcc, 0x18, 0xa9, 0x5b, 0x1e, 0xa6, 0xaa, 0xfa,
0x20, 0x55, 0x9f, 0x82, 0x45, 0xdf, 0x80, 0xbe, 0x40, 0xab, 0x19, 0x8f, 0x4d, 0x52, 0x28, 0xa5,
0x2b, 0x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xe6, 0x2e, 0x54, 0x75, 0xcf, 0xa8, 0x65, 0xcc,
0x3c, 0x2c, 0xc3, 0x02, 0x7b, 0x3b, 0x9f, 0xbe, 0xad, 0x39, 0xef, 0x37, 0x1f, 0x7c, 0xac, 0xd3,
0x8b, 0xc8, 0xbe, 0x61, 0x67, 0x55, 0xf3, 0x76, 0x3d, 0xfd, 0x19, 0x00, 0x00, 0xff, 0xff, 0xb6,
0x48, 0x64, 0x0f, 0xde, 0x05, 0x00, 0x00,
// 708 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xcd, 0x4e, 0xdb, 0x40,
0x10, 0xc6, 0x10, 0x85, 0x64, 0x12, 0x52, 0xb2, 0x05, 0x64, 0x38, 0x10, 0x48, 0x85, 0xe0, 0x00,
0x8e, 0xe8, 0x8f, 0x54, 0x71, 0x2a, 0x41, 0x82, 0x52, 0x95, 0xaa, 0x72, 0xa5, 0x1e, 0x7a, 0xb1,
0x16, 0x67, 0xe2, 0x2c, 0x38, 0xde, 0x68, 0x77, 0x8d, 0xd4, 0x2b, 0xa7, 0x3e, 0x4a, 0x55, 0xf5,
0x39, 0xaa, 0x3e, 0x05, 0x87, 0xbe, 0x01, 0x7d, 0x81, 0x56, 0xbb, 0x5e, 0x87, 0xa4, 0xa4, 0x88,
0x1e, 0x7a, 0x8a, 0x3d, 0xf3, 0x7d, 0xdf, 0x7e, 0x33, 0x3b, 0xe3, 0xc0, 0x6e, 0xc4, 0x54, 0x2f,
0x3d, 0xf5, 0x42, 0xde, 0x6f, 0x49, 0x1e, 0xf3, 0x1d, 0xc6, 0x5b, 0x32, 0x1d, 0xa0, 0x88, 0x62,
0xce, 0x5b, 0x74, 0xc0, 0x5a, 0x17, 0xbb, 0x2d, 0x96, 0x48, 0x45, 0xe3, 0xd8, 0x1b, 0x08, 0xae,
0x38, 0xa9, 0x0f, 0xf3, 0x9e, 0x66, 0x78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ea, 0x69, 0xd1, 0x7c, 0x4c, 0x9f, 0xfc, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x18, 0x43, 0x7d, 0x15,
0x6f, 0x06, 0x00, 0x00,
}
func (this *Install) Equal(that interface{}) bool {
@@ -776,6 +857,87 @@ func (this *Install_Ingress) Equal(that interface{}) bool {
}
return true
}
func (this *MeshInstall) Equal(that interface{}) bool {
if that == nil {
return this == nil
}
that1, ok := that.(*MeshInstall)
if !ok {
that2, ok := that.(MeshInstall)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
return this == nil
} else if this == nil {
return false
}
if that1.MeshInstallType == nil {
if this.MeshInstallType != nil {
return false
}
} else if this.MeshInstallType == nil {
return false
} else if !this.MeshInstallType.Equal(that1.MeshInstallType) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *MeshInstall_IstioMesh) Equal(that interface{}) bool {
if that == nil {
return this == nil
}
that1, ok := that.(*MeshInstall_IstioMesh)
if !ok {
that2, ok := that.(MeshInstall_IstioMesh)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
return this == nil
} else if this == nil {
return false
}
if !this.IstioMesh.Equal(that1.IstioMesh) {
return false
}
return true
}
func (this *MeshInstall_LinkerdMesh) Equal(that interface{}) bool {
if that == nil {
return this == nil
}
that1, ok := that.(*MeshInstall_LinkerdMesh)
if !ok {
that2, ok := that.(MeshInstall_LinkerdMesh)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
return this == nil
} else if this == nil {
return false
}
if !this.LinkerdMesh.Equal(that1.LinkerdMesh) {
return false
}
return true
}
func (this *IstioInstall) Equal(that interface{}) bool {
if that == nil {
return this == nil
@@ -821,14 +983,14 @@ func (this *IstioInstall) Equal(that interface{}) bool {
}
return true
}
func (this *MeshInstall) Equal(that interface{}) bool {
func (this *LinkerdInstall) Equal(that interface{}) bool {
if that == nil {
return this == nil
}
that1, ok := that.(*MeshInstall)
that1, ok := that.(*LinkerdInstall)
if !ok {
that2, ok := that.(MeshInstall)
that2, ok := that.(LinkerdInstall)
if ok {
that1 = &that2
} else {
@@ -840,16 +1002,13 @@ func (this *MeshInstall) Equal(that interface{}) bool {
} else if this == nil {
return false
}
if that1.MeshInstallType == nil {
if this.MeshInstallType != nil {
return false
}
} else if this.MeshInstallType == nil {
return false
} else if !this.MeshInstallType.Equal(that1.MeshInstallType) {
if this.LinkerdVersion != that1.LinkerdVersion {
return false
}
if !this.InstalledMesh.Equal(that1.InstalledMesh) {
if this.EnableAutoInject != that1.EnableAutoInject {
return false
}
if this.EnableMtls != that1.EnableMtls {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
@@ -857,30 +1016,6 @@ func (this *MeshInstall) Equal(that interface{}) bool {
}
return true
}
func (this *MeshInstall_IstioMesh) Equal(that interface{}) bool {
if that == nil {
return this == nil
}
that1, ok := that.(*MeshInstall_IstioMesh)
if !ok {
that2, ok := that.(MeshInstall_IstioMesh)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
return this == nil
} else if this == nil {
return false
}
if !this.IstioMesh.Equal(that1.IstioMesh) {
return false
}
return true
}
func (this *MeshIngressInstall) Equal(that interface{}) bool {
if that == nil {
return this == nil
+2 -5
View File
@@ -11,6 +11,7 @@ import (
"github.com/solo-io/go-utils/contextutils"
"github.com/solo-io/solo-kit/pkg/api/v1/clients"
"github.com/solo-io/solo-kit/pkg/api/v1/eventloop"
"github.com/solo-io/solo-kit/pkg/errors"
"github.com/solo-io/solo-kit/pkg/utils/errutils"
)
@@ -31,16 +32,12 @@ func (s InstallSyncers) Sync(ctx context.Context, snapshot *InstallSnapshot) err
return multiErr.ErrorOrNil()
}
type InstallEventLoop interface {
Run(namespaces []string, opts clients.WatchOpts) (<-chan error, error)
}
type installEventLoop struct {
emitter InstallEmitter
syncer InstallSyncer
}
func NewInstallEventLoop(emitter InstallEmitter, syncer InstallSyncer) InstallEventLoop {
func NewInstallEventLoop(emitter InstallEmitter, syncer InstallSyncer) eventloop.EventLoop {
return &installEventLoop{
emitter: emitter,
syncer: syncer,
@@ -0,0 +1,93 @@
// Code generated by solo-kit. DO NOT EDIT.
package v1
import (
"context"
"go.opencensus.io/trace"
"github.com/hashicorp/go-multierror"
"github.com/solo-io/go-utils/contextutils"
"github.com/solo-io/solo-kit/pkg/api/v1/clients"
"github.com/solo-io/solo-kit/pkg/api/v1/eventloop"
"github.com/solo-io/solo-kit/pkg/errors"
"github.com/solo-io/solo-kit/pkg/utils/errutils"
)
type IstioDiscoverySyncer interface {
Sync(context.Context, *IstioDiscoverySnapshot) error
}
type IstioDiscoverySyncers []IstioDiscoverySyncer
func (s IstioDiscoverySyncers) Sync(ctx context.Context, snapshot *IstioDiscoverySnapshot) error {
var multiErr *multierror.Error
for _, syncer := range s {
if err := syncer.Sync(ctx, snapshot); err != nil {
multiErr = multierror.Append(multiErr, err)
}
}
return multiErr.ErrorOrNil()
}
type istioDiscoveryEventLoop struct {
emitter IstioDiscoveryEmitter
syncer IstioDiscoverySyncer
}
func NewIstioDiscoveryEventLoop(emitter IstioDiscoveryEmitter, syncer IstioDiscoverySyncer) eventloop.EventLoop {
return &istioDiscoveryEventLoop{
emitter: emitter,
syncer: syncer,
}
}
func (el *istioDiscoveryEventLoop) Run(namespaces []string, opts clients.WatchOpts) (<-chan error, error) {
opts = opts.WithDefaults()
opts.Ctx = contextutils.WithLogger(opts.Ctx, "v1.event_loop")
logger := contextutils.LoggerFrom(opts.Ctx)
logger.Infof("event loop started")
errs := make(chan error)
watch, emitterErrs, err := el.emitter.Snapshots(namespaces, opts)
if err != nil {
return nil, errors.Wrapf(err, "starting snapshot watch")
}
go errutils.AggregateErrs(opts.Ctx, errs, emitterErrs, "v1.emitter errors")
go func() {
// create a new context for each loop, cancel it before each loop
var cancel context.CancelFunc = func() {}
// use closure to allow cancel function to be updated as context changes
defer func() { cancel() }()
for {
select {
case snapshot, ok := <-watch:
if !ok {
return
}
// cancel any open watches from previous loop
cancel()
ctx, span := trace.StartSpan(opts.Ctx, "istioDiscovery.supergloo.solo.io.EventLoopSync")
ctx, canc := context.WithCancel(ctx)
cancel = canc
err := el.syncer.Sync(ctx, snapshot)
span.End()
if err != nil {
select {
case errs <- err:
default:
logger.Errorf("write error channel is full! could not propagate err: %v", err)
}
}
case <-opts.Ctx.Done():
return
}
}
}()
return errs, nil
}
@@ -0,0 +1,92 @@
// Code generated by solo-kit. DO NOT EDIT.
package v1
import (
"fmt"
istio_authentication_v1alpha1 "github.com/solo-io/supergloo/pkg/api/external/istio/authorization/v1alpha1"
"github.com/solo-io/solo-kit/pkg/utils/hashutils"
"go.uber.org/zap"
)
type IstioDiscoverySnapshot struct {
Meshes MeshesByNamespace
Installs InstallsByNamespace
Meshpolicies istio_authentication_v1alpha1.MeshPolicyList
}
func (s IstioDiscoverySnapshot) Clone() IstioDiscoverySnapshot {
return IstioDiscoverySnapshot{
Meshes: s.Meshes.Clone(),
Installs: s.Installs.Clone(),
Meshpolicies: s.Meshpolicies.Clone(),
}
}
func (s IstioDiscoverySnapshot) Hash() uint64 {
return hashutils.HashAll(
s.hashMeshes(),
s.hashInstalls(),
s.hashMeshpolicies(),
)
}
func (s IstioDiscoverySnapshot) hashMeshes() uint64 {
return hashutils.HashAll(s.Meshes.List().AsInterfaces()...)
}
func (s IstioDiscoverySnapshot) hashInstalls() uint64 {
return hashutils.HashAll(s.Installs.List().AsInterfaces()...)
}
func (s IstioDiscoverySnapshot) hashMeshpolicies() uint64 {
return hashutils.HashAll(s.Meshpolicies.AsInterfaces()...)
}
func (s IstioDiscoverySnapshot) HashFields() []zap.Field {
var fields []zap.Field
fields = append(fields, zap.Uint64("meshes", s.hashMeshes()))
fields = append(fields, zap.Uint64("installs", s.hashInstalls()))
fields = append(fields, zap.Uint64("meshpolicies", s.hashMeshpolicies()))
return append(fields, zap.Uint64("snapshotHash", s.Hash()))
}
type IstioDiscoverySnapshotStringer struct {
Version uint64
Meshes []string
Installs []string
Meshpolicies []string
}
func (ss IstioDiscoverySnapshotStringer) String() string {
s := fmt.Sprintf("IstioDiscoverySnapshot %v\n", ss.Version)
s += fmt.Sprintf(" Meshes %v\n", len(ss.Meshes))
for _, name := range ss.Meshes {
s += fmt.Sprintf(" %v\n", name)
}
s += fmt.Sprintf(" Installs %v\n", len(ss.Installs))
for _, name := range ss.Installs {
s += fmt.Sprintf(" %v\n", name)
}
s += fmt.Sprintf(" Meshpolicies %v\n", len(ss.Meshpolicies))
for _, name := range ss.Meshpolicies {
s += fmt.Sprintf(" %v\n", name)
}
return s
}
func (s IstioDiscoverySnapshot) Stringer() IstioDiscoverySnapshotStringer {
return IstioDiscoverySnapshotStringer{
Version: s.Hash(),
Meshes: s.Meshes.List().NamespacesDotNames(),
Installs: s.Installs.List().NamespacesDotNames(),
Meshpolicies: s.Meshpolicies.Names(),
}
}
@@ -0,0 +1,236 @@
// Code generated by solo-kit. DO NOT EDIT.
package v1
import (
"sync"
"time"
istio_authentication_v1alpha1 "github.com/solo-io/supergloo/pkg/api/external/istio/authorization/v1alpha1"
"go.opencensus.io/stats"
"go.opencensus.io/stats/view"
"go.opencensus.io/tag"
"github.com/solo-io/solo-kit/pkg/api/v1/clients"
"github.com/solo-io/solo-kit/pkg/errors"
"github.com/solo-io/solo-kit/pkg/utils/errutils"
)
var (
mIstioDiscoverySnapshotIn = stats.Int64("istioDiscovery.supergloo.solo.io/snap_emitter/snap_in", "The number of snapshots in", "1")
mIstioDiscoverySnapshotOut = stats.Int64("istioDiscovery.supergloo.solo.io/snap_emitter/snap_out", "The number of snapshots out", "1")
istioDiscoverysnapshotInView = &view.View{
Name: "istioDiscovery.supergloo.solo.io_snap_emitter/snap_in",
Measure: mIstioDiscoverySnapshotIn,
Description: "The number of snapshots updates coming in",
Aggregation: view.Count(),
TagKeys: []tag.Key{},
}
istioDiscoverysnapshotOutView = &view.View{
Name: "istioDiscovery.supergloo.solo.io/snap_emitter/snap_out",
Measure: mIstioDiscoverySnapshotOut,
Description: "The number of snapshots updates going out",
Aggregation: view.Count(),
TagKeys: []tag.Key{},
}
)
func init() {
view.Register(istioDiscoverysnapshotInView, istioDiscoverysnapshotOutView)
}
type IstioDiscoveryEmitter interface {
Register() error
Mesh() MeshClient
Install() InstallClient
MeshPolicy() istio_authentication_v1alpha1.MeshPolicyClient
Snapshots(watchNamespaces []string, opts clients.WatchOpts) (<-chan *IstioDiscoverySnapshot, <-chan error, error)
}
func NewIstioDiscoveryEmitter(meshClient MeshClient, installClient InstallClient, meshPolicyClient istio_authentication_v1alpha1.MeshPolicyClient) IstioDiscoveryEmitter {
return NewIstioDiscoveryEmitterWithEmit(meshClient, installClient, meshPolicyClient, make(chan struct{}))
}
func NewIstioDiscoveryEmitterWithEmit(meshClient MeshClient, installClient InstallClient, meshPolicyClient istio_authentication_v1alpha1.MeshPolicyClient, emit <-chan struct{}) IstioDiscoveryEmitter {
return &istioDiscoveryEmitter{
mesh: meshClient,
install: installClient,
meshPolicy: meshPolicyClient,
forceEmit: emit,
}
}
type istioDiscoveryEmitter struct {
forceEmit <-chan struct{}
mesh MeshClient
install InstallClient
meshPolicy istio_authentication_v1alpha1.MeshPolicyClient
}
func (c *istioDiscoveryEmitter) Register() error {
if err := c.mesh.Register(); err != nil {
return err
}
if err := c.install.Register(); err != nil {
return err
}
if err := c.meshPolicy.Register(); err != nil {
return err
}
return nil
}
func (c *istioDiscoveryEmitter) Mesh() MeshClient {
return c.mesh
}
func (c *istioDiscoveryEmitter) Install() InstallClient {
return c.install
}
func (c *istioDiscoveryEmitter) MeshPolicy() istio_authentication_v1alpha1.MeshPolicyClient {
return c.meshPolicy
}
func (c *istioDiscoveryEmitter) Snapshots(watchNamespaces []string, opts clients.WatchOpts) (<-chan *IstioDiscoverySnapshot, <-chan error, error) {
if len(watchNamespaces) == 0 {
watchNamespaces = []string{""}
}
for _, ns := range watchNamespaces {
if ns == "" && len(watchNamespaces) > 1 {
return nil, nil, errors.Errorf("the \"\" namespace is used to watch all namespaces. Snapshots can either be tracked for " +
"specific namespaces or \"\" AllNamespaces, but not both.")
}
}
errs := make(chan error)
var done sync.WaitGroup
ctx := opts.Ctx
/* Create channel for Mesh */
type meshListWithNamespace struct {
list MeshList
namespace string
}
meshChan := make(chan meshListWithNamespace)
/* Create channel for Install */
type installListWithNamespace struct {
list InstallList
namespace string
}
installChan := make(chan installListWithNamespace)
/* Create channel for MeshPolicy */
for _, namespace := range watchNamespaces {
/* Setup namespaced watch for Mesh */
meshNamespacesChan, meshErrs, err := c.mesh.Watch(namespace, opts)
if err != nil {
return nil, nil, errors.Wrapf(err, "starting Mesh watch")
}
done.Add(1)
go func(namespace string) {
defer done.Done()
errutils.AggregateErrs(ctx, errs, meshErrs, namespace+"-meshes")
}(namespace)
/* Setup namespaced watch for Install */
installNamespacesChan, installErrs, err := c.install.Watch(namespace, opts)
if err != nil {
return nil, nil, errors.Wrapf(err, "starting Install watch")
}
done.Add(1)
go func(namespace string) {
defer done.Done()
errutils.AggregateErrs(ctx, errs, installErrs, namespace+"-installs")
}(namespace)
/* Watch for changes and update snapshot */
go func(namespace string) {
for {
select {
case <-ctx.Done():
return
case meshList := <-meshNamespacesChan:
select {
case <-ctx.Done():
return
case meshChan <- meshListWithNamespace{list: meshList, namespace: namespace}:
}
case installList := <-installNamespacesChan:
select {
case <-ctx.Done():
return
case installChan <- installListWithNamespace{list: installList, namespace: namespace}:
}
}
}
}(namespace)
}
/* Setup cluster-wide watch for MeshPolicy */
meshPolicyChan, meshPolicyErrs, err := c.meshPolicy.Watch(opts)
if err != nil {
return nil, nil, errors.Wrapf(err, "starting MeshPolicy watch")
}
done.Add(1)
go func() {
defer done.Done()
errutils.AggregateErrs(ctx, errs, meshPolicyErrs, "meshpolicies")
}()
snapshots := make(chan *IstioDiscoverySnapshot)
go func() {
originalSnapshot := IstioDiscoverySnapshot{}
currentSnapshot := originalSnapshot.Clone()
timer := time.NewTicker(time.Second * 1)
sync := func() {
if originalSnapshot.Hash() == currentSnapshot.Hash() {
return
}
stats.Record(ctx, mIstioDiscoverySnapshotOut.M(1))
originalSnapshot = currentSnapshot.Clone()
sentSnapshot := currentSnapshot.Clone()
snapshots <- &sentSnapshot
}
for {
record := func() { stats.Record(ctx, mIstioDiscoverySnapshotIn.M(1)) }
select {
case <-timer.C:
sync()
case <-ctx.Done():
close(snapshots)
done.Wait()
close(errs)
return
case <-c.forceEmit:
sentSnapshot := currentSnapshot.Clone()
snapshots <- &sentSnapshot
case meshNamespacedList := <-meshChan:
record()
namespace := meshNamespacedList.namespace
meshList := meshNamespacedList.list
currentSnapshot.Meshes[namespace] = meshList
case installNamespacedList := <-installChan:
record()
namespace := installNamespacedList.namespace
installList := installNamespacedList.list
currentSnapshot.Installs[namespace] = installList
case meshPolicyList := <-meshPolicyChan:
record()
currentSnapshot.Meshpolicies = meshPolicyList
}
}
}()
return snapshots, errs, nil
}
@@ -0,0 +1,93 @@
// Code generated by solo-kit. DO NOT EDIT.
package v1
import (
"context"
"go.opencensus.io/trace"
"github.com/hashicorp/go-multierror"
"github.com/solo-io/go-utils/contextutils"
"github.com/solo-io/solo-kit/pkg/api/v1/clients"
"github.com/solo-io/solo-kit/pkg/api/v1/eventloop"
"github.com/solo-io/solo-kit/pkg/errors"
"github.com/solo-io/solo-kit/pkg/utils/errutils"
)
type LinkerdDiscoverySyncer interface {
Sync(context.Context, *LinkerdDiscoverySnapshot) error
}
type LinkerdDiscoverySyncers []LinkerdDiscoverySyncer
func (s LinkerdDiscoverySyncers) Sync(ctx context.Context, snapshot *LinkerdDiscoverySnapshot) error {
var multiErr *multierror.Error
for _, syncer := range s {
if err := syncer.Sync(ctx, snapshot); err != nil {
multiErr = multierror.Append(multiErr, err)
}
}
return multiErr.ErrorOrNil()
}
type linkerdDiscoveryEventLoop struct {
emitter LinkerdDiscoveryEmitter
syncer LinkerdDiscoverySyncer
}
func NewLinkerdDiscoveryEventLoop(emitter LinkerdDiscoveryEmitter, syncer LinkerdDiscoverySyncer) eventloop.EventLoop {
return &linkerdDiscoveryEventLoop{
emitter: emitter,
syncer: syncer,
}
}
func (el *linkerdDiscoveryEventLoop) Run(namespaces []string, opts clients.WatchOpts) (<-chan error, error) {
opts = opts.WithDefaults()
opts.Ctx = contextutils.WithLogger(opts.Ctx, "v1.event_loop")
logger := contextutils.LoggerFrom(opts.Ctx)
logger.Infof("event loop started")
errs := make(chan error)
watch, emitterErrs, err := el.emitter.Snapshots(namespaces, opts)
if err != nil {
return nil, errors.Wrapf(err, "starting snapshot watch")
}
go errutils.AggregateErrs(opts.Ctx, errs, emitterErrs, "v1.emitter errors")
go func() {
// create a new context for each loop, cancel it before each loop
var cancel context.CancelFunc = func() {}
// use closure to allow cancel function to be updated as context changes
defer func() { cancel() }()
for {
select {
case snapshot, ok := <-watch:
if !ok {
return
}
// cancel any open watches from previous loop
cancel()
ctx, span := trace.StartSpan(opts.Ctx, "linkerdDiscovery.supergloo.solo.io.EventLoopSync")
ctx, canc := context.WithCancel(ctx)
cancel = canc
err := el.syncer.Sync(ctx, snapshot)
span.End()
if err != nil {
select {
case errs <- err:
default:
logger.Errorf("write error channel is full! could not propagate err: %v", err)
}
}
case <-opts.Ctx.Done():
return
}
}
}()
return errs, nil
}
@@ -0,0 +1,75 @@
// Code generated by solo-kit. DO NOT EDIT.
package v1
import (
"fmt"
"github.com/solo-io/solo-kit/pkg/utils/hashutils"
"go.uber.org/zap"
)
type LinkerdDiscoverySnapshot struct {
Meshes MeshesByNamespace
Installs InstallsByNamespace
}
func (s LinkerdDiscoverySnapshot) Clone() LinkerdDiscoverySnapshot {
return LinkerdDiscoverySnapshot{
Meshes: s.Meshes.Clone(),
Installs: s.Installs.Clone(),
}
}
func (s LinkerdDiscoverySnapshot) Hash() uint64 {
return hashutils.HashAll(
s.hashMeshes(),
s.hashInstalls(),
)
}
func (s LinkerdDiscoverySnapshot) hashMeshes() uint64 {
return hashutils.HashAll(s.Meshes.List().AsInterfaces()...)
}
func (s LinkerdDiscoverySnapshot) hashInstalls() uint64 {
return hashutils.HashAll(s.Installs.List().AsInterfaces()...)
}
func (s LinkerdDiscoverySnapshot) HashFields() []zap.Field {
var fields []zap.Field
fields = append(fields, zap.Uint64("meshes", s.hashMeshes()))
fields = append(fields, zap.Uint64("installs", s.hashInstalls()))
return append(fields, zap.Uint64("snapshotHash", s.Hash()))
}
type LinkerdDiscoverySnapshotStringer struct {
Version uint64
Meshes []string
Installs []string
}
func (ss LinkerdDiscoverySnapshotStringer) String() string {
s := fmt.Sprintf("LinkerdDiscoverySnapshot %v\n", ss.Version)
s += fmt.Sprintf(" Meshes %v\n", len(ss.Meshes))
for _, name := range ss.Meshes {
s += fmt.Sprintf(" %v\n", name)
}
s += fmt.Sprintf(" Installs %v\n", len(ss.Installs))
for _, name := range ss.Installs {
s += fmt.Sprintf(" %v\n", name)
}
return s
}
func (s LinkerdDiscoverySnapshot) Stringer() LinkerdDiscoverySnapshotStringer {
return LinkerdDiscoverySnapshotStringer{
Version: s.Hash(),
Meshes: s.Meshes.List().NamespacesDotNames(),
Installs: s.Installs.List().NamespacesDotNames(),
}
}
@@ -0,0 +1,209 @@
// Code generated by solo-kit. DO NOT EDIT.
package v1
import (
"sync"
"time"
"go.opencensus.io/stats"
"go.opencensus.io/stats/view"
"go.opencensus.io/tag"
"github.com/solo-io/solo-kit/pkg/api/v1/clients"
"github.com/solo-io/solo-kit/pkg/errors"
"github.com/solo-io/solo-kit/pkg/utils/errutils"
)
var (
mLinkerdDiscoverySnapshotIn = stats.Int64("linkerdDiscovery.supergloo.solo.io/snap_emitter/snap_in", "The number of snapshots in", "1")
mLinkerdDiscoverySnapshotOut = stats.Int64("linkerdDiscovery.supergloo.solo.io/snap_emitter/snap_out", "The number of snapshots out", "1")
linkerdDiscoverysnapshotInView = &view.View{
Name: "linkerdDiscovery.supergloo.solo.io_snap_emitter/snap_in",
Measure: mLinkerdDiscoverySnapshotIn,
Description: "The number of snapshots updates coming in",
Aggregation: view.Count(),
TagKeys: []tag.Key{},
}
linkerdDiscoverysnapshotOutView = &view.View{
Name: "linkerdDiscovery.supergloo.solo.io/snap_emitter/snap_out",
Measure: mLinkerdDiscoverySnapshotOut,
Description: "The number of snapshots updates going out",
Aggregation: view.Count(),
TagKeys: []tag.Key{},
}
)
func init() {
view.Register(linkerdDiscoverysnapshotInView, linkerdDiscoverysnapshotOutView)
}
type LinkerdDiscoveryEmitter interface {
Register() error
Mesh() MeshClient
Install() InstallClient
Snapshots(watchNamespaces []string, opts clients.WatchOpts) (<-chan *LinkerdDiscoverySnapshot, <-chan error, error)
}
func NewLinkerdDiscoveryEmitter(meshClient MeshClient, installClient InstallClient) LinkerdDiscoveryEmitter {
return NewLinkerdDiscoveryEmitterWithEmit(meshClient, installClient, make(chan struct{}))
}
func NewLinkerdDiscoveryEmitterWithEmit(meshClient MeshClient, installClient InstallClient, emit <-chan struct{}) LinkerdDiscoveryEmitter {
return &linkerdDiscoveryEmitter{
mesh: meshClient,
install: installClient,
forceEmit: emit,
}
}
type linkerdDiscoveryEmitter struct {
forceEmit <-chan struct{}
mesh MeshClient
install InstallClient
}
func (c *linkerdDiscoveryEmitter) Register() error {
if err := c.mesh.Register(); err != nil {
return err
}
if err := c.install.Register(); err != nil {
return err
}
return nil
}
func (c *linkerdDiscoveryEmitter) Mesh() MeshClient {
return c.mesh
}
func (c *linkerdDiscoveryEmitter) Install() InstallClient {
return c.install
}
func (c *linkerdDiscoveryEmitter) Snapshots(watchNamespaces []string, opts clients.WatchOpts) (<-chan *LinkerdDiscoverySnapshot, <-chan error, error) {
if len(watchNamespaces) == 0 {
watchNamespaces = []string{""}
}
for _, ns := range watchNamespaces {
if ns == "" && len(watchNamespaces) > 1 {
return nil, nil, errors.Errorf("the \"\" namespace is used to watch all namespaces. Snapshots can either be tracked for " +
"specific namespaces or \"\" AllNamespaces, but not both.")
}
}
errs := make(chan error)
var done sync.WaitGroup
ctx := opts.Ctx
/* Create channel for Mesh */
type meshListWithNamespace struct {
list MeshList
namespace string
}
meshChan := make(chan meshListWithNamespace)
/* Create channel for Install */
type installListWithNamespace struct {
list InstallList
namespace string
}
installChan := make(chan installListWithNamespace)
for _, namespace := range watchNamespaces {
/* Setup namespaced watch for Mesh */
meshNamespacesChan, meshErrs, err := c.mesh.Watch(namespace, opts)
if err != nil {
return nil, nil, errors.Wrapf(err, "starting Mesh watch")
}
done.Add(1)
go func(namespace string) {
defer done.Done()
errutils.AggregateErrs(ctx, errs, meshErrs, namespace+"-meshes")
}(namespace)
/* Setup namespaced watch for Install */
installNamespacesChan, installErrs, err := c.install.Watch(namespace, opts)
if err != nil {
return nil, nil, errors.Wrapf(err, "starting Install watch")
}
done.Add(1)
go func(namespace string) {
defer done.Done()
errutils.AggregateErrs(ctx, errs, installErrs, namespace+"-installs")
}(namespace)
/* Watch for changes and update snapshot */
go func(namespace string) {
for {
select {
case <-ctx.Done():
return
case meshList := <-meshNamespacesChan:
select {
case <-ctx.Done():
return
case meshChan <- meshListWithNamespace{list: meshList, namespace: namespace}:
}
case installList := <-installNamespacesChan:
select {
case <-ctx.Done():
return
case installChan <- installListWithNamespace{list: installList, namespace: namespace}:
}
}
}
}(namespace)
}
snapshots := make(chan *LinkerdDiscoverySnapshot)
go func() {
originalSnapshot := LinkerdDiscoverySnapshot{}
currentSnapshot := originalSnapshot.Clone()
timer := time.NewTicker(time.Second * 1)
sync := func() {
if originalSnapshot.Hash() == currentSnapshot.Hash() {
return
}
stats.Record(ctx, mLinkerdDiscoverySnapshotOut.M(1))
originalSnapshot = currentSnapshot.Clone()
sentSnapshot := currentSnapshot.Clone()
snapshots <- &sentSnapshot
}
for {
record := func() { stats.Record(ctx, mLinkerdDiscoverySnapshotIn.M(1)) }
select {
case <-timer.C:
sync()
case <-ctx.Done():
close(snapshots)
done.Wait()
close(errs)
return
case <-c.forceEmit:
sentSnapshot := currentSnapshot.Clone()
snapshots <- &sentSnapshot
case meshNamespacedList := <-meshChan:
record()
namespace := meshNamespacedList.namespace
meshList := meshNamespacedList.list
currentSnapshot.Meshes[namespace] = meshList
case installNamespacedList := <-installChan:
record()
namespace := installNamespacedList.namespace
installList := installNamespacedList.list
currentSnapshot.Installs[namespace] = installList
}
}
}()
return snapshots, errs, nil
}
+349 -65
View File
@@ -36,6 +36,7 @@ type Mesh struct {
// Types that are valid to be assigned to MeshType:
// *Mesh_Istio
// *Mesh_AwsAppMesh
// *Mesh_LinkerdMesh
MeshType isMesh_MeshType `protobuf_oneof:"mesh_type"`
// mtls config specifies configuration options for enabling mutual
// tls between pods in this mesh
@@ -43,10 +44,12 @@ type Mesh struct {
// configuration for propagating stats and metrics from
// mesh controllers and sidecars to a centralized datastore
// such as prometheus
MonitoringConfig *MonitoringConfig `protobuf:"bytes,3,opt,name=monitoring_config,json=monitoringConfig,proto3" json:"monitoring_config,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
MonitoringConfig *MonitoringConfig `protobuf:"bytes,3,opt,name=monitoring_config,json=monitoringConfig,proto3" json:"monitoring_config,omitempty"`
// object which represents the data mesh discovery finds about a given mesh
DiscoveryMetadata *DiscoveryMetadata `protobuf:"bytes,6,opt,name=discovery_metadata,json=discoveryMetadata,proto3" json:"discovery_metadata,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Mesh) Reset() { *m = Mesh{} }
@@ -84,9 +87,13 @@ type Mesh_Istio struct {
type Mesh_AwsAppMesh struct {
AwsAppMesh *AwsAppMesh `protobuf:"bytes,4,opt,name=aws_app_mesh,json=awsAppMesh,proto3,oneof"`
}
type Mesh_LinkerdMesh struct {
LinkerdMesh *LinkerdMesh `protobuf:"bytes,5,opt,name=linkerd_mesh,json=linkerdMesh,proto3,oneof"`
}
func (*Mesh_Istio) isMesh_MeshType() {}
func (*Mesh_AwsAppMesh) isMesh_MeshType() {}
func (*Mesh_Istio) isMesh_MeshType() {}
func (*Mesh_AwsAppMesh) isMesh_MeshType() {}
func (*Mesh_LinkerdMesh) isMesh_MeshType() {}
func (m *Mesh) GetMeshType() isMesh_MeshType {
if m != nil {
@@ -123,6 +130,13 @@ func (m *Mesh) GetAwsAppMesh() *AwsAppMesh {
return nil
}
func (m *Mesh) GetLinkerdMesh() *LinkerdMesh {
if x, ok := m.GetMeshType().(*Mesh_LinkerdMesh); ok {
return x.LinkerdMesh
}
return nil
}
func (m *Mesh) GetMtlsConfig() *MtlsConfig {
if m != nil {
return m.MtlsConfig
@@ -137,11 +151,19 @@ func (m *Mesh) GetMonitoringConfig() *MonitoringConfig {
return nil
}
func (m *Mesh) GetDiscoveryMetadata() *DiscoveryMetadata {
if m != nil {
return m.DiscoveryMetadata
}
return nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*Mesh) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _Mesh_OneofMarshaler, _Mesh_OneofUnmarshaler, _Mesh_OneofSizer, []interface{}{
(*Mesh_Istio)(nil),
(*Mesh_AwsAppMesh)(nil),
(*Mesh_LinkerdMesh)(nil),
}
}
@@ -159,6 +181,11 @@ func _Mesh_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
if err := b.EncodeMessage(x.AwsAppMesh); err != nil {
return err
}
case *Mesh_LinkerdMesh:
_ = b.EncodeVarint(5<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.LinkerdMesh); err != nil {
return err
}
case nil:
default:
return fmt.Errorf("Mesh.MeshType has unexpected type %T", x)
@@ -185,6 +212,14 @@ func _Mesh_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (
err := b.DecodeMessage(msg)
m.MeshType = &Mesh_AwsAppMesh{msg}
return true, err
case 5: // mesh_type.linkerd_mesh
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(LinkerdMesh)
err := b.DecodeMessage(msg)
m.MeshType = &Mesh_LinkerdMesh{msg}
return true, err
default:
return false, nil
}
@@ -204,6 +239,11 @@ func _Mesh_OneofSizer(msg proto.Message) (n int) {
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case *Mesh_LinkerdMesh:
s := proto.Size(x.LinkerdMesh)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
@@ -211,20 +251,98 @@ func _Mesh_OneofSizer(msg proto.Message) (n int) {
return n
}
// Generic discovery data shared between different meshes
type DiscoveryMetadata struct {
// list of namespaces which we know are being injected by a given mesh
InjectedNamespaceLabel string `protobuf:"bytes,1,opt,name=injected_namespace_label,json=injectedNamespaceLabel,proto3" json:"injected_namespace_label,omitempty"`
// Whether or not auto-injection is enabled for a given mesh
EnableAutoInject bool `protobuf:"varint,2,opt,name=enable_auto_inject,json=enableAutoInject,proto3" json:"enable_auto_inject,omitempty"`
// version of the mesh which is installed
MeshVersion string `protobuf:"bytes,3,opt,name=mesh_version,json=meshVersion,proto3" json:"mesh_version,omitempty"`
// namespace which the mesh is installed into
InstallationNamespace string `protobuf:"bytes,4,opt,name=installation_namespace,json=installationNamespace,proto3" json:"installation_namespace,omitempty"`
// discovered mtls config of the given mesh
MtlsConfig *MtlsConfig `protobuf:"bytes,5,opt,name=mtls_config,json=mtlsConfig,proto3" json:"mtls_config,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *DiscoveryMetadata) Reset() { *m = DiscoveryMetadata{} }
func (m *DiscoveryMetadata) String() string { return proto.CompactTextString(m) }
func (*DiscoveryMetadata) ProtoMessage() {}
func (*DiscoveryMetadata) Descriptor() ([]byte, []int) {
return fileDescriptor_713281dd1a237b0d, []int{1}
}
func (m *DiscoveryMetadata) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DiscoveryMetadata.Unmarshal(m, b)
}
func (m *DiscoveryMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_DiscoveryMetadata.Marshal(b, m, deterministic)
}
func (m *DiscoveryMetadata) XXX_Merge(src proto.Message) {
xxx_messageInfo_DiscoveryMetadata.Merge(m, src)
}
func (m *DiscoveryMetadata) XXX_Size() int {
return xxx_messageInfo_DiscoveryMetadata.Size(m)
}
func (m *DiscoveryMetadata) XXX_DiscardUnknown() {
xxx_messageInfo_DiscoveryMetadata.DiscardUnknown(m)
}
var xxx_messageInfo_DiscoveryMetadata proto.InternalMessageInfo
func (m *DiscoveryMetadata) GetInjectedNamespaceLabel() string {
if m != nil {
return m.InjectedNamespaceLabel
}
return ""
}
func (m *DiscoveryMetadata) GetEnableAutoInject() bool {
if m != nil {
return m.EnableAutoInject
}
return false
}
func (m *DiscoveryMetadata) GetMeshVersion() string {
if m != nil {
return m.MeshVersion
}
return ""
}
func (m *DiscoveryMetadata) GetInstallationNamespace() string {
if m != nil {
return m.InstallationNamespace
}
return ""
}
func (m *DiscoveryMetadata) GetMtlsConfig() *MtlsConfig {
if m != nil {
return m.MtlsConfig
}
return nil
}
// Mesh object representing an installed Istio control plane
type IstioMesh struct {
// where the istio control plane has been installed
InstallationNamespace string `protobuf:"bytes,1,opt,name=installation_namespace,json=installationNamespace,proto3" json:"installation_namespace,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
InstallationNamespace string `protobuf:"bytes,1,opt,name=installation_namespace,json=installationNamespace,proto3" json:"installation_namespace,omitempty"`
// version of istio which has been installed
IstioVersion string `protobuf:"bytes,2,opt,name=istio_version,json=istioVersion,proto3" json:"istio_version,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *IstioMesh) Reset() { *m = IstioMesh{} }
func (m *IstioMesh) String() string { return proto.CompactTextString(m) }
func (*IstioMesh) ProtoMessage() {}
func (*IstioMesh) Descriptor() ([]byte, []int) {
return fileDescriptor_713281dd1a237b0d, []int{1}
return fileDescriptor_713281dd1a237b0d, []int{2}
}
func (m *IstioMesh) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_IstioMesh.Unmarshal(m, b)
@@ -251,6 +369,13 @@ func (m *IstioMesh) GetInstallationNamespace() string {
return ""
}
func (m *IstioMesh) GetIstioVersion() string {
if m != nil {
return m.IstioVersion
}
return ""
}
// Mesh object representing AWS App Mesh
type AwsAppMesh struct {
// Reference to the secret that holds the AWS credentials that will be used to access the AWS App Mesh service.
@@ -282,7 +407,7 @@ func (m *AwsAppMesh) Reset() { *m = AwsAppMesh{} }
func (m *AwsAppMesh) String() string { return proto.CompactTextString(m) }
func (*AwsAppMesh) ProtoMessage() {}
func (*AwsAppMesh) Descriptor() ([]byte, []int) {
return fileDescriptor_713281dd1a237b0d, []int{2}
return fileDescriptor_713281dd1a237b0d, []int{3}
}
func (m *AwsAppMesh) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_AwsAppMesh.Unmarshal(m, b)
@@ -344,6 +469,55 @@ func (m *AwsAppMesh) GetSidecarPatchConfigMap() *core.ResourceRef {
return nil
}
// Mesh object representing an installed Linkerd control plane
type LinkerdMesh struct {
// where the Linkerd control plane has been installed
InstallationNamespace string `protobuf:"bytes,1,opt,name=installation_namespace,json=installationNamespace,proto3" json:"installation_namespace,omitempty"`
// version of istio which has been installed
LinkerdVersion string `protobuf:"bytes,2,opt,name=linkerd_version,json=linkerdVersion,proto3" json:"linkerd_version,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *LinkerdMesh) Reset() { *m = LinkerdMesh{} }
func (m *LinkerdMesh) String() string { return proto.CompactTextString(m) }
func (*LinkerdMesh) ProtoMessage() {}
func (*LinkerdMesh) Descriptor() ([]byte, []int) {
return fileDescriptor_713281dd1a237b0d, []int{4}
}
func (m *LinkerdMesh) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_LinkerdMesh.Unmarshal(m, b)
}
func (m *LinkerdMesh) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_LinkerdMesh.Marshal(b, m, deterministic)
}
func (m *LinkerdMesh) XXX_Merge(src proto.Message) {
xxx_messageInfo_LinkerdMesh.Merge(m, src)
}
func (m *LinkerdMesh) XXX_Size() int {
return xxx_messageInfo_LinkerdMesh.Size(m)
}
func (m *LinkerdMesh) XXX_DiscardUnknown() {
xxx_messageInfo_LinkerdMesh.DiscardUnknown(m)
}
var xxx_messageInfo_LinkerdMesh proto.InternalMessageInfo
func (m *LinkerdMesh) GetInstallationNamespace() string {
if m != nil {
return m.InstallationNamespace
}
return ""
}
func (m *LinkerdMesh) GetLinkerdVersion() string {
if m != nil {
return m.LinkerdVersion
}
return ""
}
// the encryption configuration that will be applied by the role
type MtlsConfig struct {
// whether or not mutual TLS should be enabled between pods in this mesh
@@ -356,7 +530,7 @@ type MtlsConfig struct {
//
// if mtlsEnabled is false, this field is ignored
// If deploying to Consul, Consul Connect requires that the cert and key are generated using ec, not rsa.
RootCertificate *core.ResourceRef `protobuf:"bytes,2,opt,name=root_certificate,json=rootCertificate,proto3" json:"root_certificate,omitempty"`
RootCertificate *core.ResourceRef `protobuf:"bytes,3,opt,name=root_certificate,json=rootCertificate,proto3" json:"root_certificate,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@@ -366,7 +540,7 @@ func (m *MtlsConfig) Reset() { *m = MtlsConfig{} }
func (m *MtlsConfig) String() string { return proto.CompactTextString(m) }
func (*MtlsConfig) ProtoMessage() {}
func (*MtlsConfig) Descriptor() ([]byte, []int) {
return fileDescriptor_713281dd1a237b0d, []int{3}
return fileDescriptor_713281dd1a237b0d, []int{5}
}
func (m *MtlsConfig) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_MtlsConfig.Unmarshal(m, b)
@@ -419,7 +593,7 @@ func (m *MonitoringConfig) Reset() { *m = MonitoringConfig{} }
func (m *MonitoringConfig) String() string { return proto.CompactTextString(m) }
func (*MonitoringConfig) ProtoMessage() {}
func (*MonitoringConfig) Descriptor() ([]byte, []int) {
return fileDescriptor_713281dd1a237b0d, []int{4}
return fileDescriptor_713281dd1a237b0d, []int{6}
}
func (m *MonitoringConfig) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_MonitoringConfig.Unmarshal(m, b)
@@ -463,7 +637,7 @@ func (m *MeshGroup) Reset() { *m = MeshGroup{} }
func (m *MeshGroup) String() string { return proto.CompactTextString(m) }
func (*MeshGroup) ProtoMessage() {}
func (*MeshGroup) Descriptor() ([]byte, []int) {
return fileDescriptor_713281dd1a237b0d, []int{5}
return fileDescriptor_713281dd1a237b0d, []int{7}
}
func (m *MeshGroup) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_MeshGroup.Unmarshal(m, b)
@@ -506,8 +680,10 @@ func (m *MeshGroup) GetMeshes() []*core.ResourceRef {
func init() {
proto.RegisterType((*Mesh)(nil), "supergloo.solo.io.Mesh")
proto.RegisterType((*DiscoveryMetadata)(nil), "supergloo.solo.io.DiscoveryMetadata")
proto.RegisterType((*IstioMesh)(nil), "supergloo.solo.io.IstioMesh")
proto.RegisterType((*AwsAppMesh)(nil), "supergloo.solo.io.AwsAppMesh")
proto.RegisterType((*LinkerdMesh)(nil), "supergloo.solo.io.LinkerdMesh")
proto.RegisterType((*MtlsConfig)(nil), "supergloo.solo.io.MtlsConfig")
proto.RegisterType((*MonitoringConfig)(nil), "supergloo.solo.io.MonitoringConfig")
proto.RegisterType((*MeshGroup)(nil), "supergloo.solo.io.MeshGroup")
@@ -518,55 +694,64 @@ func init() {
}
var fileDescriptor_713281dd1a237b0d = []byte{
// 753 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x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 0x6c, 0xe5, 0x06, 0x00,
0x00,
// 902 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x55, 0xc1, 0x6e, 0xdb, 0x46,
0x10, 0x8d, 0x2c, 0x59, 0xb0, 0x46, 0x6a, 0x23, 0x6d, 0x6d, 0x83, 0x09, 0x5a, 0x27, 0x55, 0x0a,
0xa4, 0x87, 0x84, 0x84, 0xd3, 0x16, 0x30, 0x7c, 0x28, 0x60, 0x3b, 0x45, 0x1a, 0x20, 0x0a, 0x0c,
0xba, 0xe8, 0xa1, 0x17, 0x62, 0x45, 0x8e, 0xa8, 0xad, 0x49, 0xee, 0x62, 0x77, 0x69, 0x23, 0x57,
0xff, 0x43, 0xff, 0xa1, 0x9f, 0xd2, 0x63, 0xef, 0x45, 0x73, 0xe8, 0x1f, 0xb8, 0x5f, 0x50, 0xec,
0x72, 0x49, 0xc5, 0x8e, 0xac, 0x3a, 0x3d, 0xf5, 0x44, 0xee, 0xcc, 0x7b, 0x6f, 0x67, 0x67, 0x66,
0x67, 0xc1, 0x4f, 0x99, 0x9e, 0x97, 0x53, 0x3f, 0xe6, 0x79, 0xa0, 0x78, 0xc6, 0x9f, 0x32, 0x1e,
0xa8, 0x52, 0xa0, 0x4c, 0x33, 0xce, 0x03, 0x2a, 0x58, 0x70, 0xb6, 0x1b, 0xe4, 0xa8, 0xe6, 0xbe,
0x90, 0x5c, 0x73, 0x32, 0x6a, 0x9c, 0xbe, 0x81, 0xfb, 0x8c, 0xdf, 0xdf, 0x4c, 0x79, 0xca, 0xad,
0x37, 0x30, 0x7f, 0x15, 0xf0, 0xfe, 0x4e, 0xca, 0x79, 0x9a, 0x61, 0x60, 0x57, 0xd3, 0x72, 0x16,
0x24, 0xa5, 0xa4, 0x9a, 0xf1, 0xe2, 0x26, 0xff, 0xb9, 0xa4, 0x42, 0xa0, 0x54, 0xce, 0xbf, 0xbb,
0x2c, 0x30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x5a, 0xca, 0xc7, 0x70,
0xb7, 0x1e, 0x3a, 0x57, 0x8b, 0xf9, 0xb1, 0x33, 0xd7, 0xe5, 0x2c, 0x01, 0x16, 0x1d, 0x65, 0xfb,
0xdb, 0x74, 0x61, 0x95, 0xe6, 0xc4, 0xee, 0xb1, 0x11, 0xda, 0xce, 0xfc, 0xae, 0x32, 0x91, 0xe7,
0x30, 0x94, 0x9c, 0xeb, 0x28, 0x46, 0xa9, 0xd9, 0x8c, 0xc5, 0x54, 0xa3, 0x1b, 0x24, 0x2b, 0xce,
0x7a, 0xd7, 0x50, 0x8e, 0x16, 0x8c, 0xf1, 0x1c, 0x86, 0xd7, 0x67, 0x0c, 0xf9, 0x01, 0xb6, 0x84,
0xe4, 0x39, 0xea, 0x39, 0x96, 0xf5, 0x45, 0xc8, 0xa9, 0x50, 0x5e, 0xeb, 0x61, 0x7b, 0xa5, 0xbc,
0x9b, 0xf5, 0x9b, 0x0b, 0xf6, 0x51, 0x43, 0x1e, 0xff, 0xd1, 0x82, 0x9e, 0xc9, 0xe4, 0x0b, 0xc9,
0x4b, 0xf1, 0x7f, 0x78, 0x88, 0x76, 0xc1, 0x0d, 0x36, 0xaf, 0xfd, 0x2f, 0xe7, 0x0a, 0x1d, 0x70,
0xdf, 0xbb, 0xb8, 0xec, 0x74, 0x60, 0x2d, 0x4f, 0x2f, 0x2e, 0x3b, 0x03, 0x02, 0xc6, 0x9a, 0x9a,
0xe3, 0xa8, 0xc3, 0xa7, 0xbf, 0xfe, 0xb5, 0xd3, 0xfa, 0xe9, 0xf1, 0xca, 0xb7, 0x59, 0x9c, 0xa6,
0xee, 0x7d, 0x9e, 0x76, 0xed, 0xbb, 0xfc, 0xd5, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xf5, 0x8a,
0xe3, 0x3c, 0x2b, 0x09, 0x00, 0x00,
}
func (this *Mesh) Equal(that interface{}) bool {
@@ -609,6 +794,9 @@ func (this *Mesh) Equal(that interface{}) bool {
if !this.MonitoringConfig.Equal(that1.MonitoringConfig) {
return false
}
if !this.DiscoveryMetadata.Equal(that1.DiscoveryMetadata) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
@@ -662,6 +850,69 @@ func (this *Mesh_AwsAppMesh) Equal(that interface{}) bool {
}
return true
}
func (this *Mesh_LinkerdMesh) Equal(that interface{}) bool {
if that == nil {
return this == nil
}
that1, ok := that.(*Mesh_LinkerdMesh)
if !ok {
that2, ok := that.(Mesh_LinkerdMesh)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
return this == nil
} else if this == nil {
return false
}
if !this.LinkerdMesh.Equal(that1.LinkerdMesh) {
return false
}
return true
}
func (this *DiscoveryMetadata) Equal(that interface{}) bool {
if that == nil {
return this == nil
}
that1, ok := that.(*DiscoveryMetadata)
if !ok {
that2, ok := that.(DiscoveryMetadata)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
return this == nil
} else if this == nil {
return false
}
if this.InjectedNamespaceLabel != that1.InjectedNamespaceLabel {
return false
}
if this.EnableAutoInject != that1.EnableAutoInject {
return false
}
if this.MeshVersion != that1.MeshVersion {
return false
}
if this.InstallationNamespace != that1.InstallationNamespace {
return false
}
if !this.MtlsConfig.Equal(that1.MtlsConfig) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *IstioMesh) Equal(that interface{}) bool {
if that == nil {
return this == nil
@@ -684,6 +935,9 @@ func (this *IstioMesh) Equal(that interface{}) bool {
if this.InstallationNamespace != that1.InstallationNamespace {
return false
}
if this.IstioVersion != that1.IstioVersion {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
@@ -731,6 +985,36 @@ func (this *AwsAppMesh) Equal(that interface{}) bool {
}
return true
}
func (this *LinkerdMesh) Equal(that interface{}) bool {
if that == nil {
return this == nil
}
that1, ok := that.(*LinkerdMesh)
if !ok {
that2, ok := that.(LinkerdMesh)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
return this == nil
} else if this == nil {
return false
}
if this.InstallationNamespace != that1.InstallationNamespace {
return false
}
if this.LinkerdVersion != that1.LinkerdVersion {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *MtlsConfig) Equal(that interface{}) bool {
if that == nil {
return this == nil
+1
View File
@@ -38,6 +38,7 @@ func (r *Mesh) Hash() uint64 {
metaCopy,
r.MtlsConfig,
r.MonitoringConfig,
r.DiscoveryMetadata,
r.MeshType,
)
}
@@ -5,35 +5,48 @@ package v1
import (
"sort"
"github.com/solo-io/solo-kit/pkg/api/v1/clients/kube/crd"
github_com_solo_io_supergloo_api_custom_kubepod "github.com/solo-io/supergloo/api/custom/kubepod"
"github.com/solo-io/solo-kit/pkg/api/v1/resources"
"github.com/solo-io/solo-kit/pkg/api/v1/resources/core"
"github.com/solo-io/solo-kit/pkg/errors"
"github.com/solo-io/solo-kit/pkg/utils/hashutils"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)
func NewPod(namespace, name string) *Pod {
pod := &Pod{}
pod.SetMetadata(core.Metadata{
pod.Pod.SetMetadata(core.Metadata{
Name: name,
Namespace: namespace,
})
return pod
}
func (r *Pod) SetMetadata(meta core.Metadata) {
r.Metadata = meta
// require custom resource to implement Clone() as well as resources.Resource interface
type CloneablePod interface {
resources.Resource
Clone() *github_com_solo_io_supergloo_api_custom_kubepod.Pod
}
var _ CloneablePod = &github_com_solo_io_supergloo_api_custom_kubepod.Pod{}
type Pod struct {
github_com_solo_io_supergloo_api_custom_kubepod.Pod
}
func (r *Pod) Clone() resources.Resource {
return &Pod{Pod: *r.Pod.Clone()}
}
func (r *Pod) Hash() uint64 {
metaCopy := r.GetMetadata()
metaCopy.ResourceVersion = ""
return hashutils.HashAll(
metaCopy,
r.Spec,
)
clone := r.Pod.Clone()
resources.UpdateMetadata(clone, func(meta *core.Metadata) {
meta.ResourceVersion = ""
})
return hashutils.HashAll(clone)
}
type PodList []*Pod
@@ -129,25 +142,3 @@ func (byNamespace PodsByNamespace) Clone() PodsByNamespace {
}
return cloned
}
var _ resources.Resource = &Pod{}
// Kubernetes Adapter for Pod
func (o *Pod) GetObjectKind() schema.ObjectKind {
t := PodCrd.TypeMeta()
return &t
}
func (o *Pod) DeepCopyObject() runtime.Object {
return resources.Clone(o).(*Pod)
}
var PodCrd = crd.NewCrd("core.kubernetes.io",
"pods",
"core.kubernetes.io",
"v1",
"Pod",
"pod",
false,
&Pod{})
@@ -11,6 +11,7 @@ import (
"github.com/solo-io/go-utils/contextutils"
"github.com/solo-io/solo-kit/pkg/api/v1/clients"
"github.com/solo-io/solo-kit/pkg/api/v1/eventloop"
"github.com/solo-io/solo-kit/pkg/errors"
"github.com/solo-io/solo-kit/pkg/utils/errutils"
)
@@ -31,16 +32,12 @@ func (s RegistrationSyncers) Sync(ctx context.Context, snapshot *RegistrationSna
return multiErr.ErrorOrNil()
}
type RegistrationEventLoop interface {
Run(namespaces []string, opts clients.WatchOpts) (<-chan error, error)
}
type registrationEventLoop struct {
emitter RegistrationEmitter
syncer RegistrationSyncer
}
func NewRegistrationEventLoop(emitter RegistrationEmitter, syncer RegistrationSyncer) RegistrationEventLoop {
func NewRegistrationEventLoop(emitter RegistrationEmitter, syncer RegistrationSyncer) eventloop.EventLoop {
return &registrationEventLoop{
emitter: emitter,
syncer: syncer,
+307 -86
View File
@@ -11,7 +11,8 @@ import (
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
types "github.com/gogo/protobuf/types"
_ "github.com/gogo/protobuf/types"
github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
v1 "github.com/solo-io/gloo/projects/gloo/pkg/api/v1"
core "github.com/solo-io/solo-kit/pkg/api/v1/resources/core"
v1alpha3 "github.com/solo-io/supergloo/pkg/api/external/istio/networking/v1alpha3"
@@ -49,7 +50,7 @@ func (x FaultInjection_Delay_Type) String() string {
}
func (FaultInjection_Delay_Type) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_29316bfaa5f4ba1a, []int{3, 0, 0}
return fileDescriptor_29316bfaa5f4ba1a, []int{5, 0, 0}
}
// a routing rule applies some L7 routing features to an existing mesh
@@ -69,12 +70,17 @@ type RoutingRule struct {
TargetMesh *core.ResourceRef `protobuf:"bytes,1,opt,name=target_mesh,json=targetMesh,proto3" json:"target_mesh,omitempty"`
// requests originating from these pods will have the rule applied
// leave empty to have all pods in the mesh apply these rules
//
// > Note: Source Selectors are ignored when RoutingRules are
// applied to pods in a Linkerd mesh. RoutingRules will apply to
// all selected destinations in Linkerd, regardless of the source.
SourceSelector *PodSelector `protobuf:"bytes,2,opt,name=source_selector,json=sourceSelector,proto3" json:"source_selector,omitempty"`
// requests destined for these pods will have the rule applied
// leave empty to apply to all destination pods in the mesh
DestinationSelector *PodSelector `protobuf:"bytes,3,opt,name=destination_selector,json=destinationSelector,proto3" json:"destination_selector,omitempty"`
// if specified, this rule will only apply to http requests
// in the mesh matching these parameters
// note that Linkerd only supports matching on Request Path and Method
RequestMatchers []*v1.Matcher `protobuf:"bytes,4,rep,name=request_matchers,json=requestMatchers,proto3" json:"request_matchers,omitempty"`
// contains the configuration that will be applied to
// selected pods within the target mesh(es)
@@ -213,10 +219,10 @@ type RoutingRuleSpec_FaultInjection struct {
FaultInjection *FaultInjection `protobuf:"bytes,2,opt,name=fault_injection,json=faultInjection,proto3,oneof"`
}
type RoutingRuleSpec_RequestTimeout struct {
RequestTimeout *types.Duration `protobuf:"bytes,7,opt,name=request_timeout,json=requestTimeout,proto3,oneof"`
RequestTimeout *time.Duration `protobuf:"bytes,7,opt,name=request_timeout,json=requestTimeout,proto3,oneof,stdduration"`
}
type RoutingRuleSpec_Retries struct {
Retries *v1alpha3.HTTPRetry `protobuf:"bytes,8,opt,name=retries,proto3,oneof"`
Retries *RetryPolicy `protobuf:"bytes,8,opt,name=retries,proto3,oneof"`
}
type RoutingRuleSpec_CorsPolicy struct {
CorsPolicy *v1alpha3.CorsPolicy `protobuf:"bytes,10,opt,name=cors_policy,json=corsPolicy,proto3,oneof"`
@@ -257,14 +263,14 @@ func (m *RoutingRuleSpec) GetFaultInjection() *FaultInjection {
return nil
}
func (m *RoutingRuleSpec) GetRequestTimeout() *types.Duration {
func (m *RoutingRuleSpec) GetRequestTimeout() *time.Duration {
if x, ok := m.GetRuleType().(*RoutingRuleSpec_RequestTimeout); ok {
return x.RequestTimeout
}
return nil
}
func (m *RoutingRuleSpec) GetRetries() *v1alpha3.HTTPRetry {
func (m *RoutingRuleSpec) GetRetries() *RetryPolicy {
if x, ok := m.GetRuleType().(*RoutingRuleSpec_Retries); ok {
return x.Retries
}
@@ -321,7 +327,11 @@ func _RoutingRuleSpec_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
}
case *RoutingRuleSpec_RequestTimeout:
_ = b.EncodeVarint(7<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.RequestTimeout); err != nil {
dAtA, err := github_com_gogo_protobuf_types.StdDurationMarshal(*x.RequestTimeout)
if err != nil {
return err
}
if err := b.EncodeRawBytes(dAtA); err != nil {
return err
}
case *RoutingRuleSpec_Retries:
@@ -374,15 +384,21 @@ func _RoutingRuleSpec_OneofUnmarshaler(msg proto.Message, tag, wire int, b *prot
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(types.Duration)
err := b.DecodeMessage(msg)
m.RuleType = &RoutingRuleSpec_RequestTimeout{msg}
x, err := b.DecodeRawBytes(true)
if err != nil {
return true, err
}
c := new(time.Duration)
if err2 := github_com_gogo_protobuf_types.StdDurationUnmarshal(c, x); err2 != nil {
return true, err
}
m.RuleType = &RoutingRuleSpec_RequestTimeout{c}
return true, err
case 8: // rule_type.retries
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(v1alpha3.HTTPRetry)
msg := new(RetryPolicy)
err := b.DecodeMessage(msg)
m.RuleType = &RoutingRuleSpec_Retries{msg}
return true, err
@@ -430,7 +446,7 @@ func _RoutingRuleSpec_OneofSizer(msg proto.Message) (n int) {
n += proto.SizeVarint(uint64(s))
n += s
case *RoutingRuleSpec_RequestTimeout:
s := proto.Size(x.RequestTimeout)
s := github_com_gogo_protobuf_types.SizeOfStdDuration(*x.RequestTimeout)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
@@ -461,6 +477,133 @@ func _RoutingRuleSpec_OneofSizer(msg proto.Message) (n int) {
return n
}
// RetryPolicy contains mesh-specific retry configuration
// Different meshes support different Retry features
// SuperGloo's RetryPolicy exposes config for multiple meshes simultaneously,
// Allowing the same RoutingRule to apply retries to different mesh types
// The configuration applied to the target mesh will use the corresponding
// config for each type, while other config types will be ignored
type RetryPolicy struct {
// retry each failed request until success or max number of retries met
// this retry policy will be applied to any targeted Istio Mesh Instances
MaxRetries *v1alpha3.HTTPRetry `protobuf:"bytes,1,opt,name=max_retries,json=maxRetries,proto3" json:"max_retries,omitempty"`
// allocate a 'retry budget' for each mesh sidecar
// once the proxy reaches its retry budget limit, it will
// stop retrying all requests for the given retry window.
// this can be used to prevent cascading failures when
// outages cause bursts of retries.
// this retry policy will be applied to any targeted Linkerd Mesh Instances
RetryBudget *RetryBudget `protobuf:"bytes,2,opt,name=retry_budget,json=retryBudget,proto3" json:"retry_budget,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *RetryPolicy) Reset() { *m = RetryPolicy{} }
func (m *RetryPolicy) String() string { return proto.CompactTextString(m) }
func (*RetryPolicy) ProtoMessage() {}
func (*RetryPolicy) Descriptor() ([]byte, []int) {
return fileDescriptor_29316bfaa5f4ba1a, []int{2}
}
func (m *RetryPolicy) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_RetryPolicy.Unmarshal(m, b)
}
func (m *RetryPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_RetryPolicy.Marshal(b, m, deterministic)
}
func (m *RetryPolicy) XXX_Merge(src proto.Message) {
xxx_messageInfo_RetryPolicy.Merge(m, src)
}
func (m *RetryPolicy) XXX_Size() int {
return xxx_messageInfo_RetryPolicy.Size(m)
}
func (m *RetryPolicy) XXX_DiscardUnknown() {
xxx_messageInfo_RetryPolicy.DiscardUnknown(m)
}
var xxx_messageInfo_RetryPolicy proto.InternalMessageInfo
func (m *RetryPolicy) GetMaxRetries() *v1alpha3.HTTPRetry {
if m != nil {
return m.MaxRetries
}
return nil
}
func (m *RetryPolicy) GetRetryBudget() *RetryBudget {
if m != nil {
return m.RetryBudget
}
return nil
}
// RetryBudget describes the maximum number of retries that should be issued to
// the destination services. Can only be applied to Linkerd meshes
type RetryBudget struct {
// The ratio of additional traffic that may be added by retries. A
// retry_ratio of 0.1 means that 1 retry may be attempted for every 10 regular
// requests. A retry_ratio of 1.0 means that 1 retry may be attempted for
// every 1 regular request (in other words, total request load may be doubled
// as a result of retries).
RetryRatio float32 `protobuf:"fixed32,1,opt,name=retry_ratio,json=retryRatio,proto3" json:"retry_ratio,omitempty"`
// The proxy may always attempt this number of retries per second, even if it
// would violate the retryRatio. This is to allow retries to happen even
// when the request rate is very low.
MinRetriesPerSecond uint32 `protobuf:"varint,2,opt,name=min_retries_per_second,json=minRetriesPerSecond,proto3" json:"min_retries_per_second,omitempty"`
// This duration indicates for how long requests should be considered for the
// purposes of enforcing the retryRatio. A higher value considers a larger
// window and therefore allows burstier retries.
Ttl time.Duration `protobuf:"bytes,3,opt,name=ttl,proto3,stdduration" json:"ttl"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *RetryBudget) Reset() { *m = RetryBudget{} }
func (m *RetryBudget) String() string { return proto.CompactTextString(m) }
func (*RetryBudget) ProtoMessage() {}
func (*RetryBudget) Descriptor() ([]byte, []int) {
return fileDescriptor_29316bfaa5f4ba1a, []int{3}
}
func (m *RetryBudget) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_RetryBudget.Unmarshal(m, b)
}
func (m *RetryBudget) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_RetryBudget.Marshal(b, m, deterministic)
}
func (m *RetryBudget) XXX_Merge(src proto.Message) {
xxx_messageInfo_RetryBudget.Merge(m, src)
}
func (m *RetryBudget) XXX_Size() int {
return xxx_messageInfo_RetryBudget.Size(m)
}
func (m *RetryBudget) XXX_DiscardUnknown() {
xxx_messageInfo_RetryBudget.DiscardUnknown(m)
}
var xxx_messageInfo_RetryBudget proto.InternalMessageInfo
func (m *RetryBudget) GetRetryRatio() float32 {
if m != nil {
return m.RetryRatio
}
return 0
}
func (m *RetryBudget) GetMinRetriesPerSecond() uint32 {
if m != nil {
return m.MinRetriesPerSecond
}
return 0
}
func (m *RetryBudget) GetTtl() time.Duration {
if m != nil {
return m.Ttl
}
return 0
}
// requests for this rule will be routed to these destinations
type TrafficShifting struct {
// split traffic between these subsets based on their weights
@@ -475,7 +618,7 @@ func (m *TrafficShifting) Reset() { *m = TrafficShifting{} }
func (m *TrafficShifting) String() string { return proto.CompactTextString(m) }
func (*TrafficShifting) ProtoMessage() {}
func (*TrafficShifting) Descriptor() ([]byte, []int) {
return fileDescriptor_29316bfaa5f4ba1a, []int{2}
return fileDescriptor_29316bfaa5f4ba1a, []int{4}
}
func (m *TrafficShifting) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TrafficShifting.Unmarshal(m, b)
@@ -512,6 +655,7 @@ type FaultInjection struct {
// *FaultInjection_Abort_
FaultInjectionType isFaultInjection_FaultInjectionType `protobuf_oneof:"fault_injection_type"`
// Percentage of requests to be faulted with the error code provided.
// Values range between 0 and 100
Percentage float64 `protobuf:"fixed64,5,opt,name=percentage,proto3" json:"percentage,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
@@ -522,7 +666,7 @@ func (m *FaultInjection) Reset() { *m = FaultInjection{} }
func (m *FaultInjection) String() string { return proto.CompactTextString(m) }
func (*FaultInjection) ProtoMessage() {}
func (*FaultInjection) Descriptor() ([]byte, []int) {
return fileDescriptor_29316bfaa5f4ba1a, []int{3}
return fileDescriptor_29316bfaa5f4ba1a, []int{5}
}
func (m *FaultInjection) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_FaultInjection.Unmarshal(m, b)
@@ -676,7 +820,7 @@ func (m *FaultInjection_Delay) Reset() { *m = FaultInjection_Delay{} }
func (m *FaultInjection_Delay) String() string { return proto.CompactTextString(m) }
func (*FaultInjection_Delay) ProtoMessage() {}
func (*FaultInjection_Delay) Descriptor() ([]byte, []int) {
return fileDescriptor_29316bfaa5f4ba1a, []int{3, 0}
return fileDescriptor_29316bfaa5f4ba1a, []int{5, 0}
}
func (m *FaultInjection_Delay) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_FaultInjection_Delay.Unmarshal(m, b)
@@ -727,7 +871,7 @@ func (m *FaultInjection_Abort) Reset() { *m = FaultInjection_Abort{} }
func (m *FaultInjection_Abort) String() string { return proto.CompactTextString(m) }
func (*FaultInjection_Abort) ProtoMessage() {}
func (*FaultInjection_Abort) Descriptor() ([]byte, []int) {
return fileDescriptor_29316bfaa5f4ba1a, []int{3, 1}
return fileDescriptor_29316bfaa5f4ba1a, []int{5, 1}
}
func (m *FaultInjection_Abort) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_FaultInjection_Abort.Unmarshal(m, b)
@@ -844,7 +988,7 @@ func (m *HeaderManipulation) Reset() { *m = HeaderManipulation{} }
func (m *HeaderManipulation) String() string { return proto.CompactTextString(m) }
func (*HeaderManipulation) ProtoMessage() {}
func (*HeaderManipulation) Descriptor() ([]byte, []int) {
return fileDescriptor_29316bfaa5f4ba1a, []int{4}
return fileDescriptor_29316bfaa5f4ba1a, []int{6}
}
func (m *HeaderManipulation) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_HeaderManipulation.Unmarshal(m, b)
@@ -896,6 +1040,8 @@ func init() {
proto.RegisterEnum("supergloo.solo.io.FaultInjection_Delay_Type", FaultInjection_Delay_Type_name, FaultInjection_Delay_Type_value)
proto.RegisterType((*RoutingRule)(nil), "supergloo.solo.io.RoutingRule")
proto.RegisterType((*RoutingRuleSpec)(nil), "supergloo.solo.io.RoutingRuleSpec")
proto.RegisterType((*RetryPolicy)(nil), "supergloo.solo.io.RetryPolicy")
proto.RegisterType((*RetryBudget)(nil), "supergloo.solo.io.RetryBudget")
proto.RegisterType((*TrafficShifting)(nil), "supergloo.solo.io.TrafficShifting")
proto.RegisterType((*FaultInjection)(nil), "supergloo.solo.io.FaultInjection")
proto.RegisterType((*FaultInjection_Delay)(nil), "supergloo.solo.io.FaultInjection.Delay")
@@ -910,74 +1056,80 @@ func init() {
}
var fileDescriptor_29316bfaa5f4ba1a = []byte{
// 1058 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0xc1, 0x72, 0xdb, 0x36,
0x13, 0x96, 0x22, 0xc9, 0xb1, 0x56, 0xfe, 0x25, 0x07, 0x91, 0x1d, 0x46, 0x07, 0xc7, 0xd1, 0xfc,
0x9d, 0xf8, 0x90, 0x90, 0x63, 0xbb, 0x93, 0xf1, 0xf8, 0x12, 0x47, 0x55, 0x12, 0x65, 0x5a, 0x4f,
0x5d, 0xd8, 0x9d, 0xc9, 0xf4, 0xc2, 0xa1, 0xa9, 0x15, 0x85, 0x9a, 0x22, 0x58, 0x00, 0x54, 0xa3,
0x6b, 0x0e, 0x7d, 0x86, 0x9e, 0x7a, 0xce, 0xad, 0xaf, 0xd1, 0xa7, 0x68, 0x67, 0x7a, 0xeb, 0x31,
0x6f, 0xd0, 0x21, 0x08, 0xca, 0x92, 0x2d, 0xa7, 0xf2, 0x49, 0x00, 0xf6, 0xfb, 0x3e, 0x2c, 0x80,
0x6f, 0x57, 0x84, 0xdd, 0x80, 0x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ad, 0xe2, 0x0f, 0x4f, 0x3e, 0xfb, 0x21, 0x16, 0x5f, 0x04, 0xe6, 0xe3, 0xe2, 0x7c,
0x45, 0x17, 0xc4, 0xfe, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x74, 0xa3, 0xfc, 0xfc, 0x36, 0x0a,
0x00, 0x00,
// 1168 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0x41, 0x73, 0x1b, 0x35,
0x14, 0xb6, 0x63, 0x3b, 0x8d, 0x9f, 0xd3, 0x38, 0x55, 0xdd, 0x74, 0xeb, 0x43, 0x9a, 0x7a, 0x60,
0x9a, 0x43, 0xbb, 0x3b, 0x4d, 0xa0, 0x93, 0xc9, 0xa5, 0xad, 0x49, 0x5b, 0x17, 0xc8, 0x10, 0x94,
0x30, 0xd3, 0xe1, 0xb2, 0xb3, 0x59, 0x3f, 0xdb, 0x22, 0xeb, 0xd5, 0x22, 0x69, 0x43, 0x7c, 0xed,
0x81, 0xbf, 0x00, 0xc3, 0x81, 0x73, 0x6f, 0xfc, 0x0d, 0x7e, 0x05, 0xcc, 0x70, 0xe3, 0xd8, 0x7f,
0xc0, 0x48, 0xab, 0x75, 0xec, 0xc4, 0x0d, 0xce, 0xc9, 0x2b, 0xbd, 0xef, 0x7b, 0xfa, 0x24, 0xbd,
0xef, 0xc9, 0xf0, 0xa4, 0xcf, 0xd4, 0x20, 0x3d, 0x76, 0x43, 0x3e, 0xf4, 0x24, 0x8f, 0xf8, 0x63,
0xc6, 0x3d, 0x99, 0x26, 0x28, 0xfa, 0x11, 0xe7, 0x5e, 0x90, 0x30, 0xef, 0xf4, 0x89, 0x27, 0x78,
0xaa, 0x58, 0xdc, 0x77, 0x13, 0xc1, 0x15, 0x27, 0xb7, 0xc6, 0x71, 0x57, 0x33, 0x5c, 0xc6, 0x9b,
0x8d, 0x3e, 0xef, 0x73, 0x13, 0xf5,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x73, 0x56,
0x0a, 0x6b, 0x63, 0xbd, 0xd3, 0xac, 0xba, 0x91, 0xfb, 0xec, 0x7a, 0x72, 0x27, 0x73, 0x67, 0x6a,
0x1b, 0xc1, 0x8c, 0x50, 0xb3, 0x03, 0xcd, 0x8f, 0xef, 0x90, 0xac, 0x42, 0xe9, 0x04, 0x33, 0xc3,
0x54, 0xa9, 0xfe, 0x24, 0x0d, 0xa8, 0x9c, 0x06, 0x51, 0x8a, 0xc6, 0x03, 0x55, 0x9a, 0x0d, 0x76,
0x17, 0x76, 0x8a, 0xcd, 0xd7, 0x70, 0xef, 0xa3, 0x8b, 0x5f, 0x27, 0x51, 0xfb, 0xf1, 0xfb, 0x7f,
0xd6, 0x8b, 0xdf, 0x3f, 0xbc, 0xf2, 0xff, 0x6b, 0x72, 0xd2, 0xb7, 0xff, 0xc9, 0x8e, 0x17, 0x8d,
0x21, 0xb6, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x79, 0xad, 0x40, 0xa4, 0x6d, 0x0b, 0x00, 0x00,
}
func (this *RoutingRule) Equal(that interface{}) bool {
@@ -1130,7 +1282,13 @@ func (this *RoutingRuleSpec_RequestTimeout) Equal(that interface{}) bool {
} else if this == nil {
return false
}
if !this.RequestTimeout.Equal(that1.RequestTimeout) {
if this.RequestTimeout != nil && that1.RequestTimeout != nil {
if *this.RequestTimeout != *that1.RequestTimeout {
return false
}
} else if this.RequestTimeout != nil {
return false
} else if that1.RequestTimeout != nil {
return false
}
return true
@@ -1231,6 +1389,69 @@ func (this *RoutingRuleSpec_HeaderManipulation) Equal(that interface{}) bool {
}
return true
}
func (this *RetryPolicy) Equal(that interface{}) bool {
if that == nil {
return this == nil
}
that1, ok := that.(*RetryPolicy)
if !ok {
that2, ok := that.(RetryPolicy)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
return this == nil
} else if this == nil {
return false
}
if !this.MaxRetries.Equal(that1.MaxRetries) {
return false
}
if !this.RetryBudget.Equal(that1.RetryBudget) {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *RetryBudget) Equal(that interface{}) bool {
if that == nil {
return this == nil
}
that1, ok := that.(*RetryBudget)
if !ok {
that2, ok := that.(RetryBudget)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
return this == nil
} else if this == nil {
return false
}
if this.RetryRatio != that1.RetryRatio {
return false
}
if this.MinRetriesPerSecond != that1.MinRetriesPerSecond {
return false
}
if this.Ttl != that1.Ttl {
return false
}
if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
return false
}
return true
}
func (this *TrafficShifting) Equal(that interface{}) bool {
if that == nil {
return this == nil
+144
View File
@@ -0,0 +1,144 @@
// Code generated by solo-kit. DO NOT EDIT.
package v1
import (
"sort"
github_com_solo_io_supergloo_api_custom_linkerd "github.com/solo-io/supergloo/api/custom/linkerd"
"github.com/solo-io/solo-kit/pkg/api/v1/resources"
"github.com/solo-io/solo-kit/pkg/api/v1/resources/core"
"github.com/solo-io/solo-kit/pkg/errors"
"github.com/solo-io/solo-kit/pkg/utils/hashutils"
)
func NewServiceProfile(namespace, name string) *ServiceProfile {
serviceprofile := &ServiceProfile{}
serviceprofile.ServiceProfile.SetMetadata(core.Metadata{
Name: name,
Namespace: namespace,
})
return serviceprofile
}
// require custom resource to implement Clone() as well as resources.Resource interface
type CloneableServiceProfile interface {
resources.Resource
Clone() *github_com_solo_io_supergloo_api_custom_linkerd.ServiceProfile
}
var _ CloneableServiceProfile = &github_com_solo_io_supergloo_api_custom_linkerd.ServiceProfile{}
type ServiceProfile struct {
github_com_solo_io_supergloo_api_custom_linkerd.ServiceProfile
}
func (r *ServiceProfile) Clone() resources.Resource {
return &ServiceProfile{ServiceProfile: *r.ServiceProfile.Clone()}
}
func (r *ServiceProfile) Hash() uint64 {
clone := r.ServiceProfile.Clone()
resources.UpdateMetadata(clone, func(meta *core.Metadata) {
meta.ResourceVersion = ""
})
return hashutils.HashAll(clone)
}
type ServiceProfileList []*ServiceProfile
type ServiceprofilesByNamespace map[string]ServiceProfileList
// namespace is optional, if left empty, names can collide if the list contains more than one with the same name
func (list ServiceProfileList) Find(namespace, name string) (*ServiceProfile, error) {
for _, serviceProfile := range list {
if serviceProfile.GetMetadata().Name == name {
if namespace == "" || serviceProfile.GetMetadata().Namespace == namespace {
return serviceProfile, nil
}
}
}
return nil, errors.Errorf("list did not find serviceProfile %v.%v", namespace, name)
}
func (list ServiceProfileList) AsResources() resources.ResourceList {
var ress resources.ResourceList
for _, serviceProfile := range list {
ress = append(ress, serviceProfile)
}
return ress
}
func (list ServiceProfileList) Names() []string {
var names []string
for _, serviceProfile := range list {
names = append(names, serviceProfile.GetMetadata().Name)
}
return names
}
func (list ServiceProfileList) NamespacesDotNames() []string {
var names []string
for _, serviceProfile := range list {
names = append(names, serviceProfile.GetMetadata().Namespace+"."+serviceProfile.GetMetadata().Name)
}
return names
}
func (list ServiceProfileList) Sort() ServiceProfileList {
sort.SliceStable(list, func(i, j int) bool {
return list[i].GetMetadata().Less(list[j].GetMetadata())
})
return list
}
func (list ServiceProfileList) Clone() ServiceProfileList {
var serviceProfileList ServiceProfileList
for _, serviceProfile := range list {
serviceProfileList = append(serviceProfileList, resources.Clone(serviceProfile).(*ServiceProfile))
}
return serviceProfileList
}
func (list ServiceProfileList) Each(f func(element *ServiceProfile)) {
for _, serviceProfile := range list {
f(serviceProfile)
}
}
func (list ServiceProfileList) AsInterfaces() []interface{} {
var asInterfaces []interface{}
list.Each(func(element *ServiceProfile) {
asInterfaces = append(asInterfaces, element)
})
return asInterfaces
}
func (byNamespace ServiceprofilesByNamespace) Add(serviceProfile ...*ServiceProfile) {
for _, item := range serviceProfile {
byNamespace[item.GetMetadata().Namespace] = append(byNamespace[item.GetMetadata().Namespace], item)
}
}
func (byNamespace ServiceprofilesByNamespace) Clear(namespace string) {
delete(byNamespace, namespace)
}
func (byNamespace ServiceprofilesByNamespace) List() ServiceProfileList {
var list ServiceProfileList
for _, serviceProfileList := range byNamespace {
list = append(list, serviceProfileList...)
}
return list.Sort()
}
func (byNamespace ServiceprofilesByNamespace) Clone() ServiceprofilesByNamespace {
cloned := make(ServiceprofilesByNamespace)
for ns, list := range byNamespace {
cloned[ns] = list.Clone()
}
return cloned
}
@@ -0,0 +1,118 @@
// Code generated by solo-kit. DO NOT EDIT.
package v1
import (
"github.com/solo-io/solo-kit/pkg/api/v1/clients"
"github.com/solo-io/solo-kit/pkg/api/v1/clients/factory"
"github.com/solo-io/solo-kit/pkg/api/v1/resources"
"github.com/solo-io/solo-kit/pkg/errors"
)
type ServiceProfileClient interface {
BaseClient() clients.ResourceClient
Register() error
Read(namespace, name string, opts clients.ReadOpts) (*ServiceProfile, error)
Write(resource *ServiceProfile, opts clients.WriteOpts) (*ServiceProfile, error)
Delete(namespace, name string, opts clients.DeleteOpts) error
List(namespace string, opts clients.ListOpts) (ServiceProfileList, error)
Watch(namespace string, opts clients.WatchOpts) (<-chan ServiceProfileList, <-chan error, error)
}
type serviceProfileClient struct {
rc clients.ResourceClient
}
func NewServiceProfileClient(rcFactory factory.ResourceClientFactory) (ServiceProfileClient, error) {
return NewServiceProfileClientWithToken(rcFactory, "")
}
func NewServiceProfileClientWithToken(rcFactory factory.ResourceClientFactory, token string) (ServiceProfileClient, error) {
rc, err := rcFactory.NewResourceClient(factory.NewResourceClientParams{
ResourceType: &ServiceProfile{},
Token: token,
})
if err != nil {
return nil, errors.Wrapf(err, "creating base ServiceProfile resource client")
}
return NewServiceProfileClientWithBase(rc), nil
}
func NewServiceProfileClientWithBase(rc clients.ResourceClient) ServiceProfileClient {
return &serviceProfileClient{
rc: rc,
}
}
func (client *serviceProfileClient) BaseClient() clients.ResourceClient {
return client.rc
}
func (client *serviceProfileClient) Register() error {
return client.rc.Register()
}
func (client *serviceProfileClient) Read(namespace, name string, opts clients.ReadOpts) (*ServiceProfile, error) {
opts = opts.WithDefaults()
resource, err := client.rc.Read(namespace, name, opts)
if err != nil {
return nil, err
}
return resource.(*ServiceProfile), nil
}
func (client *serviceProfileClient) Write(serviceProfile *ServiceProfile, opts clients.WriteOpts) (*ServiceProfile, error) {
opts = opts.WithDefaults()
resource, err := client.rc.Write(serviceProfile, opts)
if err != nil {
return nil, err
}
return resource.(*ServiceProfile), nil
}
func (client *serviceProfileClient) Delete(namespace, name string, opts clients.DeleteOpts) error {
opts = opts.WithDefaults()
return client.rc.Delete(namespace, name, opts)
}
func (client *serviceProfileClient) List(namespace string, opts clients.ListOpts) (ServiceProfileList, error) {
opts = opts.WithDefaults()
resourceList, err := client.rc.List(namespace, opts)
if err != nil {
return nil, err
}
return convertToServiceProfile(resourceList), nil
}
func (client *serviceProfileClient) Watch(namespace string, opts clients.WatchOpts) (<-chan ServiceProfileList, <-chan error, error) {
opts = opts.WithDefaults()
resourcesChan, errs, initErr := client.rc.Watch(namespace, opts)
if initErr != nil {
return nil, nil, initErr
}
serviceprofilesChan := make(chan ServiceProfileList)
go func() {
for {
select {
case resourceList := <-resourcesChan:
serviceprofilesChan <- convertToServiceProfile(resourceList)
case <-opts.Ctx.Done():
close(serviceprofilesChan)
return
}
}
}()
return serviceprofilesChan, errs, nil
}
func convertToServiceProfile(resources resources.ResourceList) ServiceProfileList {
var serviceProfileList ServiceProfileList
for _, resource := range resources {
serviceProfileList = append(serviceProfileList, resource.(*ServiceProfile))
}
return serviceProfileList
}
@@ -0,0 +1,47 @@
// Code generated by solo-kit. DO NOT EDIT.
package v1
import (
"github.com/solo-io/go-utils/contextutils"
"github.com/solo-io/solo-kit/pkg/api/v1/clients"
"github.com/solo-io/solo-kit/pkg/api/v1/reconcile"
"github.com/solo-io/solo-kit/pkg/api/v1/resources"
)
// Option to copy anything from the original to the desired before writing. Return value of false means don't update
type TransitionServiceProfileFunc func(original, desired *ServiceProfile) (bool, error)
type ServiceProfileReconciler interface {
Reconcile(namespace string, desiredResources ServiceProfileList, transition TransitionServiceProfileFunc, opts clients.ListOpts) error
}
func serviceProfilesToResources(list ServiceProfileList) resources.ResourceList {
var resourceList resources.ResourceList
for _, serviceProfile := range list {
resourceList = append(resourceList, serviceProfile)
}
return resourceList
}
func NewServiceProfileReconciler(client ServiceProfileClient) ServiceProfileReconciler {
return &serviceProfileReconciler{
base: reconcile.NewReconciler(client.BaseClient()),
}
}
type serviceProfileReconciler struct {
base reconcile.Reconciler
}
func (r *serviceProfileReconciler) Reconcile(namespace string, desiredResources ServiceProfileList, transition TransitionServiceProfileFunc, opts clients.ListOpts) error {
opts = opts.WithDefaults()
opts.Ctx = contextutils.WithLogger(opts.Ctx, "serviceProfile_reconciler")
var transitionResources reconcile.TransitionResourcesFunc
if transition != nil {
transitionResources = func(original, desired resources.Resource) (bool, error) {
return transition(original.(*ServiceProfile), desired.(*ServiceProfile))
}
}
return r.base.Reconcile(namespace, serviceProfilesToResources(desiredResources), transitionResources, opts)
}
@@ -0,0 +1,20 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
// Package fake has the automatically generated clients.
package fake
@@ -0,0 +1,20 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
// Package fake has the automatically generated clients.
package fake
-14
View File
@@ -1,14 +0,0 @@
// This file contains changes that are only compatible with go 1.10 and onwards.
// +build go1.10
package yaml
import "encoding/json"
// DisallowUnknownFields configures the JSON decoder to error out if unknown
// fields come along, instead of dropping them by default.
func DisallowUnknownFields(d *json.Decoder) *json.Decoder {
d.DisallowUnknownFields()
return d
}