diff --git a/glide.lock b/glide.lock index 919d29d850..adf947b4fc 100644 --- a/glide.lock +++ b/glide.lock @@ -1,8 +1,10 @@ -hash: fb62b9eca001b26304dfab51214d2e5c4d03518d33cad73824decc68eb4100b5 -updated: 2018-02-20T16:06:09.767694251-05:00 +hash: 3899c064e389ad0ffa1d51355ceaa25d2cc00d4ea0c3695bcb8771f2018a9456 +updated: 2018-02-27T10:07:24.82181-05:00 imports: - name: bitbucket.org/ww/goautoneg version: 75cd24fc2f2c2a2088577d12123ddee5f54e0675 +- name: github.com/automationbroker/broker-client-go + version: 417a1c5029bb8be34758b0e41a6a785f78890c7f - name: github.com/beorn7/perks version: 3ac7bf7a47d159a033b107610db8a1b6575507a4 subpackages: @@ -150,7 +152,7 @@ imports: - name: github.com/pkg/errors version: 645ef00459ed84a119197bfb8d8205042c6df63d - name: github.com/pmezard/go-difflib - version: d8ed2627bdf02c080bf22230dbb337003b7aba2d + version: 792786c7400a136282c1664665ae0a8db921c6c2 subpackages: - difflib - name: github.com/prometheus/client_golang diff --git a/glide.yaml b/glide.yaml index 3f7ffa06ec..cafe03b6a6 100644 --- a/glide.yaml +++ b/glide.yaml @@ -40,3 +40,5 @@ import: version: master - package: github.com/stretchr/testify version: ^1.2.1 +- package: github.com/automationbroker/broker-client-go + version: 1.0.0 diff --git a/vendor/github.com/automationbroker/broker-client-go/.gitignore b/vendor/github.com/automationbroker/broker-client-go/.gitignore new file mode 100644 index 0000000000..140fada73f --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/.gitignore @@ -0,0 +1 @@ +vendor/* diff --git a/vendor/github.com/automationbroker/broker-client-go/Gopkg.lock b/vendor/github.com/automationbroker/broker-client-go/Gopkg.lock new file mode 100644 index 0000000000..bd284d57e7 --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/Gopkg.lock @@ -0,0 +1,405 @@ +# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. + + +[[projects]] + name = "github.com/PuerkitoBio/purell" + packages = ["."] + revision = "0bcb03f4b4d0a9428594752bd2a3b9aa0a9d4bd4" + version = "v1.1.0" + +[[projects]] + branch = "master" + name = "github.com/PuerkitoBio/urlesc" + packages = ["."] + revision = "de5bf2ad457846296e2031421a34e2568e304e35" + +[[projects]] + name = "github.com/davecgh/go-spew" + packages = ["spew"] + revision = "346938d642f2ec3594ed81d874461961cd0faa76" + version = "v1.1.0" + +[[projects]] + name = "github.com/emicklei/go-restful" + packages = [ + ".", + "log" + ] + revision = "26b41036311f2da8242db402557a0dbd09dc83da" + version = "v2.6.0" + +[[projects]] + name = "github.com/ghodss/yaml" + packages = ["."] + revision = "0ca9ea5df5451ffdf184b4428c902747c2c11cd7" + version = "v1.0.0" + +[[projects]] + branch = "master" + name = "github.com/go-openapi/jsonpointer" + packages = ["."] + revision = "779f45308c19820f1a69e9a4cd965f496e0da10f" + +[[projects]] + branch = "master" + name = "github.com/go-openapi/jsonreference" + packages = ["."] + revision = "36d33bfe519efae5632669801b180bf1a245da3b" + +[[projects]] + branch = "master" + name = "github.com/go-openapi/spec" + packages = ["."] + revision = "1de3e0542de65ad8d75452a595886fdd0befb363" + +[[projects]] + branch = "master" + name = "github.com/go-openapi/swag" + packages = ["."] + revision = "84f4bee7c0a6db40e3166044c7983c1c32125429" + +[[projects]] + name = "github.com/gogo/protobuf" + packages = [ + "proto", + "sortkeys" + ] + revision = "1adfc126b41513cc696b209667c8656ea7aac67c" + version = "v1.0.0" + +[[projects]] + branch = "master" + name = "github.com/golang/glog" + packages = ["."] + revision = "23def4e6c14b4da8ac2ed8007337bc5eb5007998" + +[[projects]] + name = "github.com/golang/protobuf" + packages = [ + "proto", + "ptypes", + "ptypes/any", + "ptypes/duration", + "ptypes/timestamp" + ] + revision = "925541529c1fa6821df4e44ce2723319eb2be768" + version = "v1.0.0" + +[[projects]] + branch = "master" + name = "github.com/google/btree" + packages = ["."] + revision = "e89373fe6b4a7413d7acd6da1725b83ef713e6e4" + +[[projects]] + branch = "master" + name = "github.com/google/gofuzz" + packages = ["."] + revision = "24818f796faf91cd76ec7bddd72458fbced7a6c1" + +[[projects]] + name = "github.com/googleapis/gnostic" + packages = [ + "OpenAPIv2", + "compiler", + "extensions" + ] + revision = "ee43cbb60db7bd22502942cccbc39059117352ab" + version = "v0.1.0" + +[[projects]] + branch = "master" + name = "github.com/gregjones/httpcache" + packages = [ + ".", + "diskcache" + ] + revision = "2bcd89a1743fd4b373f7370ce8ddc14dfbd18229" + +[[projects]] + branch = "master" + name = "github.com/hashicorp/golang-lru" + packages = [ + ".", + "simplelru" + ] + revision = "0fb14efe8c47ae851c0034ed7a448854d3d34cf3" + +[[projects]] + branch = "master" + name = "github.com/howeyc/gopass" + packages = ["."] + revision = "bf9dde6d0d2c004a008c27aaee91170c786f6db8" + +[[projects]] + name = "github.com/imdario/mergo" + packages = ["."] + revision = "163f41321a19dd09362d4c63cc2489db2015f1f4" + version = "0.3.2" + +[[projects]] + name = "github.com/json-iterator/go" + packages = ["."] + revision = "be70f29b04dea7efb4d82a8989c33aee989b74d1" + version = "1.1.0" + +[[projects]] + name = "github.com/juju/ratelimit" + packages = ["."] + revision = "59fac5042749a5afb9af70e813da1dd5474f0167" + version = "1.0.1" + +[[projects]] + branch = "master" + name = "github.com/mailru/easyjson" + packages = [ + "buffer", + "jlexer", + "jwriter" + ] + revision = "32fa128f234d041f196a9f3e0fea5ac9772c08e1" + +[[projects]] + branch = "master" + name = "github.com/petar/GoLLRB" + packages = ["llrb"] + revision = "53be0d36a84c2a886ca057d34b6aa4468df9ccb4" + +[[projects]] + name = "github.com/peterbourgon/diskv" + packages = ["."] + revision = "5f041e8faa004a95c88a202771f4cc3e991971e6" + version = "v2.0.1" + +[[projects]] + name = "github.com/spf13/pflag" + packages = ["."] + revision = "e57e3eeb33f795204c1ca35f56c44f83227c6e66" + version = "v1.0.0" + +[[projects]] + name = "github.com/v2pro/plz" + packages = [ + "concurrent", + "reflect2" + ] + revision = "571356917fca907b069b7b47a14cd32ba0b340d4" + version = "0.9.0" + +[[projects]] + branch = "master" + name = "golang.org/x/crypto" + packages = ["ssh/terminal"] + revision = "49796115aa4b964c318aad4f3084fdb41e9aa067" + +[[projects]] + branch = "master" + name = "golang.org/x/net" + packages = [ + "context", + "http2", + "http2/hpack", + "idna", + "lex/httplex" + ] + revision = "cbe0f9307d0156177f9dd5dc85da1a31abc5f2fb" + +[[projects]] + branch = "master" + name = "golang.org/x/sys" + packages = [ + "unix", + "windows" + ] + revision = "37707fdb30a5b38865cfb95e5aab41707daec7fd" + +[[projects]] + name = "golang.org/x/text" + packages = [ + "collate", + "collate/build", + "internal/colltab", + "internal/gen", + "internal/tag", + "internal/triegen", + "internal/ucd", + "language", + "secure/bidirule", + "transform", + "unicode/bidi", + "unicode/cldr", + "unicode/norm", + "unicode/rangetable", + "width" + ] + revision = "f21a4dfb5e38f5895301dc265a8def02365cc3d0" + version = "v0.3.0" + +[[projects]] + branch = "master" + name = "golang.org/x/tools" + packages = [ + "go/ast/astutil", + "imports" + ] + revision = "f8f2f88271bf2c23f28a09d288d26507a9503c97" + +[[projects]] + name = "gopkg.in/inf.v0" + packages = ["."] + revision = "3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4" + version = "v0.9.0" + +[[projects]] + branch = "v2" + name = "gopkg.in/yaml.v2" + packages = ["."] + revision = "d670f9405373e636a5a2765eea47fac0c9bc91a4" + +[[projects]] + branch = "master" + name = "k8s.io/api" + packages = [ + "admissionregistration/v1alpha1", + "admissionregistration/v1beta1", + "apps/v1", + "apps/v1beta1", + "apps/v1beta2", + "authentication/v1", + "authentication/v1beta1", + "authorization/v1", + "authorization/v1beta1", + "autoscaling/v1", + "autoscaling/v2beta1", + "batch/v1", + "batch/v1beta1", + "batch/v2alpha1", + "certificates/v1beta1", + "core/v1", + "events/v1beta1", + "extensions/v1beta1", + "networking/v1", + "policy/v1beta1", + "rbac/v1", + "rbac/v1alpha1", + "rbac/v1beta1", + "scheduling/v1alpha1", + "settings/v1alpha1", + "storage/v1", + "storage/v1alpha1", + "storage/v1beta1" + ] + revision = "b378c47b2dcba7f5c3ef97d8a5a0b3821ec6a001" + +[[projects]] + branch = "release-1.9" + name = "k8s.io/apimachinery" + packages = [ + "pkg/api/errors", + "pkg/api/meta", + "pkg/api/resource", + "pkg/apis/meta/internalversion", + "pkg/apis/meta/v1", + "pkg/apis/meta/v1/unstructured", + "pkg/apis/meta/v1alpha1", + "pkg/conversion", + "pkg/conversion/queryparams", + "pkg/fields", + "pkg/labels", + "pkg/runtime", + "pkg/runtime/schema", + "pkg/runtime/serializer", + "pkg/runtime/serializer/json", + "pkg/runtime/serializer/protobuf", + "pkg/runtime/serializer/recognizer", + "pkg/runtime/serializer/streaming", + "pkg/runtime/serializer/versioning", + "pkg/selection", + "pkg/types", + "pkg/util/cache", + "pkg/util/clock", + "pkg/util/diff", + "pkg/util/errors", + "pkg/util/framer", + "pkg/util/intstr", + "pkg/util/json", + "pkg/util/net", + "pkg/util/runtime", + "pkg/util/sets", + "pkg/util/validation", + "pkg/util/validation/field", + "pkg/util/wait", + "pkg/util/yaml", + "pkg/version", + "pkg/watch", + "third_party/forked/golang/reflect" + ] + revision = "19e3f5aa3adca672c153d324e6b7d82ff8935f03" + +[[projects]] + branch = "release-6.0" + name = "k8s.io/client-go" + packages = [ + "discovery", + "discovery/fake", + "kubernetes/scheme", + "pkg/version", + "rest", + "rest/watch", + "testing", + "tools/auth", + "tools/cache", + "tools/clientcmd", + "tools/clientcmd/api", + "tools/clientcmd/api/latest", + "tools/clientcmd/api/v1", + "tools/metrics", + "tools/pager", + "transport", + "util/buffer", + "util/cert", + "util/flowcontrol", + "util/homedir", + "util/integer" + ] + revision = "9389c055a838d4f208b699b3c7c51b70f2368861" + +[[projects]] + branch = "release-1.9" + name = "k8s.io/code-generator" + packages = [ + "cmd/client-gen", + "cmd/client-gen/args", + "cmd/client-gen/generators", + "cmd/client-gen/generators/fake", + "cmd/client-gen/generators/scheme", + "cmd/client-gen/generators/util", + "cmd/client-gen/path", + "cmd/client-gen/types" + ] + revision = "91d3f6a57905178524105a085085901bb73bd3dc" + +[[projects]] + branch = "master" + name = "k8s.io/gengo" + packages = [ + "args", + "generator", + "namer", + "parser", + "types" + ] + revision = "8394c995ab8fbe52216f38d0e1a37de36d820528" + +[[projects]] + branch = "master" + name = "k8s.io/kube-openapi" + packages = ["pkg/common"] + revision = "50ae88d24ede7b8bad68e23c805b5d3da5c8abaf" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "bde96cb054be3a52ef122ec02d708a0bf988109d156d29c6ecaae10940f6185d" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/vendor/github.com/automationbroker/broker-client-go/Gopkg.toml b/vendor/github.com/automationbroker/broker-client-go/Gopkg.toml new file mode 100644 index 0000000000..a9734d4abb --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/Gopkg.toml @@ -0,0 +1,19 @@ +# Gopkg.toml example +# +# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md +# for detailed Gopkg.toml documentation. +# +required = ["k8s.io/code-generator/cmd/client-gen"] + +[[constraint]] + branch = "release-1.9" + name = "k8s.io/code-generator" + +[[constraint]] + branch = "release-1.9" + name = "k8s.io/apimachinery" + +[[constraint]] + name = "k8s.io/client-go" + branch = "release-6.0" + diff --git a/vendor/github.com/automationbroker/broker-client-go/README.md b/vendor/github.com/automationbroker/broker-client-go/README.md new file mode 100644 index 0000000000..a4f400df92 --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/README.md @@ -0,0 +1,3 @@ +## Go Client for the Broker + +The go client for the broker is a [generated](https://github.com/kubernetes/code-generator) client for the [automation broker](https://github.com/openshift/ansible-service-broker). These are the types that the broker will use internally to store data. This client should function and behave similar to other k8s generated clients. \ No newline at end of file diff --git a/vendor/github.com/automationbroker/broker-client-go/artifacts/bundle.yml b/vendor/github.com/automationbroker/broker-client-go/artifacts/bundle.yml new file mode 100644 index 0000000000..8a62b5a5d2 --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/artifacts/bundle.yml @@ -0,0 +1,152 @@ +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: bundles.automationbroker.io +spec: + group: automationbroker.io + version: v1 + scope: Namespaced + names: + plural: bundles + singular: bundle + kind: Bundle + validation: + # openAPIV3Schema is the schema for validating custom objects. + openAPIV3Schema: + properties: + spec: + properties: + runtime: + type: integer + minimum: 1 + maximum: 2 + version: + type: string + pattern: '^[\d]+.[\d*]+$' + fqName: + type: string + image: + type: string + tags: + type: array + items: + type: string + bindable: + type: boolean + description: + type: string + metadata: + type: string + async: + type: string + pattern: '^(optional|required|unsupported)$' + plans: + type: array + minItems: 1 + items: + type: object + properties: + id: + type: string + name: + type: string + description: + type: string + metadata: + type: string + free: + type: boolean + bindable: + type: boolean + updatesTo: + type: array + items: + type: string + parameters: + type: array + items: + type: object + properties: + name: + type: string + title: + type: string + type: + type: string + description: + type: string + default: + type: string + deprecateMaxLength: + type: integer + maxLength: + type: integer + minLength: + type: integer + pattern: + type: string + multipleOf: + type: float + maximum: + type: float + exclusiveMaximum: + type: float + minimum: + type: float + exclusiveMinimum: + type: float + enum: + type: array + items: + type: string + required: + type: boolean + updatable: + type: boolean + displayType: + type: string + displayGroup: + type: string + bindParameters: + type: array + properties: + name: + type: string + title: + type: string + type: + type: string + description: + type: string + default: + type: object + deprecateMaxLength: + type: integer + maxLength: + type: integer + minLength: + type: integer + pattern: + type: string + multipleOf: + type: float + maximum: + type: float + exclusiveMaximum: + type: float + minimum: + type: float + exclusiveMinimum: + type: float + enum: + type: array + items: + type: string + required: + type: boolean + updatable: + type: boolean + displayType: + type: string + displayGroup: + type: string diff --git a/vendor/github.com/automationbroker/broker-client-go/artifacts/example/bundle-example.yml b/vendor/github.com/automationbroker/broker-client-go/artifacts/example/bundle-example.yml new file mode 100644 index 0000000000..5d9653dbaf --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/artifacts/example/bundle-example.yml @@ -0,0 +1,40 @@ +apiVersion: "automationbroker.io/v1" +kind: Bundle +metadata: + name: newuidhere + namespace: ansible-service-broker +spec: + version: "1.0" + runtime: 1 + name: postgresql-apb + description: SCL PostgreSQL apb implementation + bindable: true + async: optional + tags: + - database + - postgresql + metadata: + documentationUrl: https://www.postgresql.org/docs/ + longDescription: An apb that deploys postgresql 9.4, 9.5, or 9.6. + dependencies: + - 'registry.access.redhat.com/rhscl/postgresql-94-rhel7' + - 'registry.access.redhat.com/rhscl/postgresql-95-rhel7' + - 'registry.access.redhat.com/rhscl/postgresql-96-rhel7' + displayName: PostgreSQL (APB) + console.openshift.io/iconClass: icon-postgresql + providerDisplayName: "Red Hat, Inc." + plans: + - name: dev + description: A single DB server with no storage + free: true + metadata: + displayName: Development + longDescription: This plan provides a single non-HA PostgreSQL server without persistent storage + cost: $0.00 + - name: prod + description: A single DB server with persistent storage + free: true + metadata: + displayName: Production + longDescription: This plan provides a single non-HA PostgreSQL server with persistent storage + cost: $0.00 diff --git a/vendor/github.com/automationbroker/broker-client-go/artifacts/example/jobstate-example.yml b/vendor/github.com/automationbroker/broker-client-go/artifacts/example/jobstate-example.yml new file mode 100644 index 0000000000..a5ad511fa6 --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/artifacts/example/jobstate-example.yml @@ -0,0 +1,9 @@ +apiVersion: "automationbroker.io/v1" +kind: JobState +metadata: + name: newuidhere + namespace: ansible-service-broker +spec: + state: succeeded + podName: new-pod-name + method: provision diff --git a/vendor/github.com/automationbroker/broker-client-go/artifacts/example/servicebinding-example.yml b/vendor/github.com/automationbroker/broker-client-go/artifacts/example/servicebinding-example.yml new file mode 100644 index 0000000000..6321a27915 --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/artifacts/example/servicebinding-example.yml @@ -0,0 +1,14 @@ +apiVersion: "automationbroker.io/v1" +kind: ServiceBinding +metadata: + name: newuidhere + namespace: ansible-service-broker +spec: + serviceInstanceId: "serviceIdnewuidhere" + jobToken: "12345678-xxx-xxx-rfg343243" + parameters: + mediawiki_admin_pass: "shawnhurley" + mediawiki_admin_user: "admin" + mediawiki_db_schema: "mediawiki" + mediawiki_site_lang: "en" + mediawiki_site_name: "MediaWiki" diff --git a/vendor/github.com/automationbroker/broker-client-go/artifacts/example/serviceinstance-example.yml b/vendor/github.com/automationbroker/broker-client-go/artifacts/example/serviceinstance-example.yml new file mode 100644 index 0000000000..00c2d64c0c --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/artifacts/example/serviceinstance-example.yml @@ -0,0 +1,19 @@ +apiVersion: "automationbroker.io/v1" +kind: ServiceInstance +metadata: + name: newuidhere + namespace: ansible-service-broker +spec: + specId: "specnewuidhere" + context: + plateform: "kubernetes" + namespace: "target-namespace" + parameters: + mediawiki_admin_pass: "shawnhurley" + mediawiki_admin_user: "admin" + mediawiki_db_schema: "mediawiki" + mediawiki_site_lang: "en" + mediawiki_site_name: "MediaWiki" + bindingIds: + - "bindingIDhere" + diff --git a/vendor/github.com/automationbroker/broker-client-go/artifacts/jobstate.yml b/vendor/github.com/automationbroker/broker-client-go/artifacts/jobstate.yml new file mode 100644 index 0000000000..3a4abf19dd --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/artifacts/jobstate.yml @@ -0,0 +1,28 @@ +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: jobstates.automationbroker.io +spec: + group: automationbroker.io + version: v1 + scope: Namespaced + names: + plural: jobstates + singular: jobstate + kind: JobState + validation: + # openAPIV3Schema is the schema for validating custom objects. + # Token is the name of the resource + openAPIV3Schema: + properties: + state: + type: string + podName: + type: string + method: + type: string + error: + type: string + description: + type: string + diff --git a/vendor/github.com/automationbroker/broker-client-go/artifacts/servicebinding.yml b/vendor/github.com/automationbroker/broker-client-go/artifacts/servicebinding.yml new file mode 100644 index 0000000000..1a821573de --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/artifacts/servicebinding.yml @@ -0,0 +1,22 @@ +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: servicebindings.automationbroker.io +spec: + group: automationbroker.io + version: v1 + scope: Namespaced + names: + plural: servicebindings + singular: servicebinding + kind: ServiceBinding + validation: + # openAPIV3Schema is the schema for validating custom objects. + openAPIV3Schema: + serviceInstanceId: + type: string + parameters: + type: string + JobToken: + type: string + diff --git a/vendor/github.com/automationbroker/broker-client-go/artifacts/serviceinstance.yml b/vendor/github.com/automationbroker/broker-client-go/artifacts/serviceinstance.yml new file mode 100644 index 0000000000..95f76ee131 --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/artifacts/serviceinstance.yml @@ -0,0 +1,33 @@ +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: serviceinstances.automationbroker.io +spec: + group: automationbroker.io + version: v1 + scope: Namespaced + names: + plural: serviceinstances + singular: serviceinstance + kind: ServiceInstance + validation: + # openAPIV3Schema is the schema for validating custom objects. + openAPIV3Schema: + properties: + spec: + properties: + specId: + type: string + context: + type: object + properties: + plateform: + type: string + namespace: + type: string + parameters: + type: string + bindingIds: + type: array + items: + type: string diff --git a/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/clientset.go b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/clientset.go new file mode 100644 index 0000000000..5ed86d5b2e --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/clientset.go @@ -0,0 +1,97 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package versioned + +import ( + automationbrokerv1 "github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1" + glog "github.com/golang/glog" + discovery "k8s.io/client-go/discovery" + rest "k8s.io/client-go/rest" + flowcontrol "k8s.io/client-go/util/flowcontrol" +) + +type Interface interface { + Discovery() discovery.DiscoveryInterface + AutomationbrokerV1() automationbrokerv1.AutomationbrokerV1Interface + // Deprecated: please explicitly pick a version if possible. + Automationbroker() automationbrokerv1.AutomationbrokerV1Interface +} + +// Clientset contains the clients for groups. Each group has exactly one +// version included in a Clientset. +type Clientset struct { + *discovery.DiscoveryClient + automationbrokerV1 *automationbrokerv1.AutomationbrokerV1Client +} + +// AutomationbrokerV1 retrieves the AutomationbrokerV1Client +func (c *Clientset) AutomationbrokerV1() automationbrokerv1.AutomationbrokerV1Interface { + return c.automationbrokerV1 +} + +// Deprecated: Automationbroker retrieves the default version of AutomationbrokerClient. +// Please explicitly pick a version. +func (c *Clientset) Automationbroker() automationbrokerv1.AutomationbrokerV1Interface { + return c.automationbrokerV1 +} + +// Discovery retrieves the DiscoveryClient +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + if c == nil { + return nil + } + return c.DiscoveryClient +} + +// NewForConfig creates a new Clientset for the given config. +func NewForConfig(c *rest.Config) (*Clientset, error) { + configShallowCopy := *c + if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { + configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) + } + var cs Clientset + var err error + cs.automationbrokerV1, err = automationbrokerv1.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err + } + + cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) + if err != nil { + glog.Errorf("failed to create the DiscoveryClient: %v", err) + return nil, err + } + return &cs, nil +} + +// NewForConfigOrDie creates a new Clientset for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *Clientset { + var cs Clientset + cs.automationbrokerV1 = automationbrokerv1.NewForConfigOrDie(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) + return &cs +} + +// New creates a new Clientset for the given RESTClient. +func New(c rest.Interface) *Clientset { + var cs Clientset + cs.automationbrokerV1 = automationbrokerv1.New(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClient(c) + return &cs +} diff --git a/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/doc.go b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/doc.go new file mode 100644 index 0000000000..eaa8357a87 --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/doc.go @@ -0,0 +1,17 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +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. +*/ +// This package has the automatically generated clientset. +package versioned diff --git a/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/fake/clientset_generated.go b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/fake/clientset_generated.go new file mode 100644 index 0000000000..e3ffb0eb2f --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/fake/clientset_generated.go @@ -0,0 +1,70 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package fake + +import ( + clientset "github.com/automationbroker/broker-client-go/client/clientset/versioned" + automationbrokerv1 "github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1" + fakeautomationbrokerv1 "github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/fake" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/discovery" + fakediscovery "k8s.io/client-go/discovery/fake" + "k8s.io/client-go/testing" +) + +// NewSimpleClientset returns a clientset that will respond with the provided objects. +// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, +// without applying any validations and/or defaults. It shouldn't be considered a replacement +// for a real clientset and is mostly useful in simple unit tests. +func NewSimpleClientset(objects ...runtime.Object) *Clientset { + o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) + for _, obj := range objects { + if err := o.Add(obj); err != nil { + panic(err) + } + } + + fakePtr := testing.Fake{} + fakePtr.AddReactor("*", "*", testing.ObjectReaction(o)) + fakePtr.AddWatchReactor("*", testing.DefaultWatchReactor(watch.NewFake(), nil)) + + return &Clientset{fakePtr, &fakediscovery.FakeDiscovery{Fake: &fakePtr}} +} + +// Clientset implements clientset.Interface. Meant to be embedded into a +// struct to get a default implementation. This makes faking out just the method +// you want to test easier. +type Clientset struct { + testing.Fake + discovery *fakediscovery.FakeDiscovery +} + +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + return c.discovery +} + +var _ clientset.Interface = &Clientset{} + +// AutomationbrokerV1 retrieves the AutomationbrokerV1Client +func (c *Clientset) AutomationbrokerV1() automationbrokerv1.AutomationbrokerV1Interface { + return &fakeautomationbrokerv1.FakeAutomationbrokerV1{Fake: &c.Fake} +} + +// Automationbroker retrieves the AutomationbrokerV1Client +func (c *Clientset) Automationbroker() automationbrokerv1.AutomationbrokerV1Interface { + return &fakeautomationbrokerv1.FakeAutomationbrokerV1{Fake: &c.Fake} +} diff --git a/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/fake/doc.go b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/fake/doc.go new file mode 100644 index 0000000000..a79afb01ee --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/fake/doc.go @@ -0,0 +1,17 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +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. +*/ +// This package has the automatically generated fake clientset. +package fake diff --git a/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/fake/register.go b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/fake/register.go new file mode 100644 index 0000000000..5ae8e4bd60 --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/fake/register.go @@ -0,0 +1,52 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package fake + +import ( + automationbrokerv1 "github.com/automationbroker/broker-client-go/pkg/apis/automationbroker.io/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" +) + +var scheme = runtime.NewScheme() +var codecs = serializer.NewCodecFactory(scheme) +var parameterCodec = runtime.NewParameterCodec(scheme) + +func init() { + v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) + AddToScheme(scheme) +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kuberentes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +func AddToScheme(scheme *runtime.Scheme) { + automationbrokerv1.AddToScheme(scheme) + +} diff --git a/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/scheme/doc.go b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/scheme/doc.go new file mode 100644 index 0000000000..7ba0729179 --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/scheme/doc.go @@ -0,0 +1,17 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +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. +*/ +// This package contains the scheme of the automatically generated clientset. +package scheme diff --git a/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/scheme/register.go b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/scheme/register.go new file mode 100644 index 0000000000..77a67f3580 --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/scheme/register.go @@ -0,0 +1,52 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package scheme + +import ( + automationbrokerv1 "github.com/automationbroker/broker-client-go/pkg/apis/automationbroker.io/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" +) + +var Scheme = runtime.NewScheme() +var Codecs = serializer.NewCodecFactory(Scheme) +var ParameterCodec = runtime.NewParameterCodec(Scheme) + +func init() { + v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) + AddToScheme(Scheme) +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kuberentes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +func AddToScheme(scheme *runtime.Scheme) { + automationbrokerv1.AddToScheme(scheme) + +} diff --git a/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/automationbroker.io_client.go b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/automationbroker.io_client.go new file mode 100644 index 0000000000..669c68324f --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/automationbroker.io_client.go @@ -0,0 +1,102 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package v1 + +import ( + "github.com/automationbroker/broker-client-go/client/clientset/versioned/scheme" + v1 "github.com/automationbroker/broker-client-go/pkg/apis/automationbroker.io/v1" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + rest "k8s.io/client-go/rest" +) + +type AutomationbrokerV1Interface interface { + RESTClient() rest.Interface + BundlesGetter + JobStatesGetter + ServiceBindingsGetter + ServiceInstancesGetter +} + +// AutomationbrokerV1Client is used to interact with features provided by the automationbroker.io group. +type AutomationbrokerV1Client struct { + restClient rest.Interface +} + +func (c *AutomationbrokerV1Client) Bundles(namespace string) BundleInterface { + return newBundles(c, namespace) +} + +func (c *AutomationbrokerV1Client) JobStates(namespace string) JobStateInterface { + return newJobStates(c, namespace) +} + +func (c *AutomationbrokerV1Client) ServiceBindings(namespace string) ServiceBindingInterface { + return newServiceBindings(c, namespace) +} + +func (c *AutomationbrokerV1Client) ServiceInstances(namespace string) ServiceInstanceInterface { + return newServiceInstances(c, namespace) +} + +// NewForConfig creates a new AutomationbrokerV1Client for the given config. +func NewForConfig(c *rest.Config) (*AutomationbrokerV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &AutomationbrokerV1Client{client}, nil +} + +// NewForConfigOrDie creates a new AutomationbrokerV1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *AutomationbrokerV1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new AutomationbrokerV1Client for the given RESTClient. +func New(c rest.Interface) *AutomationbrokerV1Client { + return &AutomationbrokerV1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs} + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *AutomationbrokerV1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/bundle.go b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/bundle.go new file mode 100644 index 0000000000..93e3abe400 --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/bundle.go @@ -0,0 +1,154 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package v1 + +import ( + scheme "github.com/automationbroker/broker-client-go/client/clientset/versioned/scheme" + v1 "github.com/automationbroker/broker-client-go/pkg/apis/automationbroker.io/v1" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// BundlesGetter has a method to return a BundleInterface. +// A group's client should implement this interface. +type BundlesGetter interface { + Bundles(namespace string) BundleInterface +} + +// BundleInterface has methods to work with Bundle resources. +type BundleInterface interface { + Create(*v1.Bundle) (*v1.Bundle, error) + Update(*v1.Bundle) (*v1.Bundle, error) + Delete(name string, options *meta_v1.DeleteOptions) error + DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error + Get(name string, options meta_v1.GetOptions) (*v1.Bundle, error) + List(opts meta_v1.ListOptions) (*v1.BundleList, error) + Watch(opts meta_v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Bundle, err error) + BundleExpansion +} + +// bundles implements BundleInterface +type bundles struct { + client rest.Interface + ns string +} + +// newBundles returns a Bundles +func newBundles(c *AutomationbrokerV1Client, namespace string) *bundles { + return &bundles{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the bundle, and returns the corresponding bundle object, and an error if there is any. +func (c *bundles) Get(name string, options meta_v1.GetOptions) (result *v1.Bundle, err error) { + result = &v1.Bundle{} + err = c.client.Get(). + Namespace(c.ns). + Resource("bundles"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Bundles that match those selectors. +func (c *bundles) List(opts meta_v1.ListOptions) (result *v1.BundleList, err error) { + result = &v1.BundleList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("bundles"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested bundles. +func (c *bundles) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("bundles"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a bundle and creates it. Returns the server's representation of the bundle, and an error, if there is any. +func (c *bundles) Create(bundle *v1.Bundle) (result *v1.Bundle, err error) { + result = &v1.Bundle{} + err = c.client.Post(). + Namespace(c.ns). + Resource("bundles"). + Body(bundle). + Do(). + Into(result) + return +} + +// Update takes the representation of a bundle and updates it. Returns the server's representation of the bundle, and an error, if there is any. +func (c *bundles) Update(bundle *v1.Bundle) (result *v1.Bundle, err error) { + result = &v1.Bundle{} + err = c.client.Put(). + Namespace(c.ns). + Resource("bundles"). + Name(bundle.Name). + Body(bundle). + Do(). + Into(result) + return +} + +// Delete takes name of the bundle and deletes it. Returns an error if one occurs. +func (c *bundles) Delete(name string, options *meta_v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("bundles"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *bundles) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("bundles"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched bundle. +func (c *bundles) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Bundle, err error) { + result = &v1.Bundle{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("bundles"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/doc.go b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/doc.go new file mode 100644 index 0000000000..8d185a6a88 --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/doc.go @@ -0,0 +1,17 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +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. +*/ +// This package has the automatically generated typed clients. +package v1 diff --git a/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/fake/doc.go b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/fake/doc.go new file mode 100644 index 0000000000..a66370f58e --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/fake/doc.go @@ -0,0 +1,17 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Package fake has the automatically generated clients. +package fake diff --git a/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/fake/fake_automationbroker.io_client.go b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/fake/fake_automationbroker.io_client.go new file mode 100644 index 0000000000..2ccd79e5f7 --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/fake/fake_automationbroker.io_client.go @@ -0,0 +1,49 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package fake + +import ( + v1 "github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeAutomationbrokerV1 struct { + *testing.Fake +} + +func (c *FakeAutomationbrokerV1) Bundles(namespace string) v1.BundleInterface { + return &FakeBundles{c, namespace} +} + +func (c *FakeAutomationbrokerV1) JobStates(namespace string) v1.JobStateInterface { + return &FakeJobStates{c, namespace} +} + +func (c *FakeAutomationbrokerV1) ServiceBindings(namespace string) v1.ServiceBindingInterface { + return &FakeServiceBindings{c, namespace} +} + +func (c *FakeAutomationbrokerV1) ServiceInstances(namespace string) v1.ServiceInstanceInterface { + return &FakeServiceInstances{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeAutomationbrokerV1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/fake/fake_bundle.go b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/fake/fake_bundle.go new file mode 100644 index 0000000000..c8a6a3c705 --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/fake/fake_bundle.go @@ -0,0 +1,125 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package fake + +import ( + automationbroker_io_v1 "github.com/automationbroker/broker-client-go/pkg/apis/automationbroker.io/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeBundles implements BundleInterface +type FakeBundles struct { + Fake *FakeAutomationbrokerV1 + ns string +} + +var bundlesResource = schema.GroupVersionResource{Group: "automationbroker.io", Version: "v1", Resource: "bundles"} + +var bundlesKind = schema.GroupVersionKind{Group: "automationbroker.io", Version: "v1", Kind: "Bundle"} + +// Get takes name of the bundle, and returns the corresponding bundle object, and an error if there is any. +func (c *FakeBundles) Get(name string, options v1.GetOptions) (result *automationbroker_io_v1.Bundle, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(bundlesResource, c.ns, name), &automationbroker_io_v1.Bundle{}) + + if obj == nil { + return nil, err + } + return obj.(*automationbroker_io_v1.Bundle), err +} + +// List takes label and field selectors, and returns the list of Bundles that match those selectors. +func (c *FakeBundles) List(opts v1.ListOptions) (result *automationbroker_io_v1.BundleList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(bundlesResource, bundlesKind, c.ns, opts), &automationbroker_io_v1.BundleList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &automationbroker_io_v1.BundleList{} + for _, item := range obj.(*automationbroker_io_v1.BundleList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested bundles. +func (c *FakeBundles) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(bundlesResource, c.ns, opts)) + +} + +// Create takes the representation of a bundle and creates it. Returns the server's representation of the bundle, and an error, if there is any. +func (c *FakeBundles) Create(bundle *automationbroker_io_v1.Bundle) (result *automationbroker_io_v1.Bundle, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(bundlesResource, c.ns, bundle), &automationbroker_io_v1.Bundle{}) + + if obj == nil { + return nil, err + } + return obj.(*automationbroker_io_v1.Bundle), err +} + +// Update takes the representation of a bundle and updates it. Returns the server's representation of the bundle, and an error, if there is any. +func (c *FakeBundles) Update(bundle *automationbroker_io_v1.Bundle) (result *automationbroker_io_v1.Bundle, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(bundlesResource, c.ns, bundle), &automationbroker_io_v1.Bundle{}) + + if obj == nil { + return nil, err + } + return obj.(*automationbroker_io_v1.Bundle), err +} + +// Delete takes name of the bundle and deletes it. Returns an error if one occurs. +func (c *FakeBundles) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(bundlesResource, c.ns, name), &automationbroker_io_v1.Bundle{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeBundles) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(bundlesResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &automationbroker_io_v1.BundleList{}) + return err +} + +// Patch applies the patch and returns the patched bundle. +func (c *FakeBundles) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *automationbroker_io_v1.Bundle, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(bundlesResource, c.ns, name, data, subresources...), &automationbroker_io_v1.Bundle{}) + + if obj == nil { + return nil, err + } + return obj.(*automationbroker_io_v1.Bundle), err +} diff --git a/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/fake/fake_jobstate.go b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/fake/fake_jobstate.go new file mode 100644 index 0000000000..c334b87059 --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/fake/fake_jobstate.go @@ -0,0 +1,125 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package fake + +import ( + automationbroker_io_v1 "github.com/automationbroker/broker-client-go/pkg/apis/automationbroker.io/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeJobStates implements JobStateInterface +type FakeJobStates struct { + Fake *FakeAutomationbrokerV1 + ns string +} + +var jobstatesResource = schema.GroupVersionResource{Group: "automationbroker.io", Version: "v1", Resource: "jobstates"} + +var jobstatesKind = schema.GroupVersionKind{Group: "automationbroker.io", Version: "v1", Kind: "JobState"} + +// Get takes name of the jobState, and returns the corresponding jobState object, and an error if there is any. +func (c *FakeJobStates) Get(name string, options v1.GetOptions) (result *automationbroker_io_v1.JobState, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(jobstatesResource, c.ns, name), &automationbroker_io_v1.JobState{}) + + if obj == nil { + return nil, err + } + return obj.(*automationbroker_io_v1.JobState), err +} + +// List takes label and field selectors, and returns the list of JobStates that match those selectors. +func (c *FakeJobStates) List(opts v1.ListOptions) (result *automationbroker_io_v1.JobStateList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(jobstatesResource, jobstatesKind, c.ns, opts), &automationbroker_io_v1.JobStateList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &automationbroker_io_v1.JobStateList{} + for _, item := range obj.(*automationbroker_io_v1.JobStateList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested jobStates. +func (c *FakeJobStates) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(jobstatesResource, c.ns, opts)) + +} + +// Create takes the representation of a jobState and creates it. Returns the server's representation of the jobState, and an error, if there is any. +func (c *FakeJobStates) Create(jobState *automationbroker_io_v1.JobState) (result *automationbroker_io_v1.JobState, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(jobstatesResource, c.ns, jobState), &automationbroker_io_v1.JobState{}) + + if obj == nil { + return nil, err + } + return obj.(*automationbroker_io_v1.JobState), err +} + +// Update takes the representation of a jobState and updates it. Returns the server's representation of the jobState, and an error, if there is any. +func (c *FakeJobStates) Update(jobState *automationbroker_io_v1.JobState) (result *automationbroker_io_v1.JobState, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(jobstatesResource, c.ns, jobState), &automationbroker_io_v1.JobState{}) + + if obj == nil { + return nil, err + } + return obj.(*automationbroker_io_v1.JobState), err +} + +// Delete takes name of the jobState and deletes it. Returns an error if one occurs. +func (c *FakeJobStates) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(jobstatesResource, c.ns, name), &automationbroker_io_v1.JobState{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeJobStates) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(jobstatesResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &automationbroker_io_v1.JobStateList{}) + return err +} + +// Patch applies the patch and returns the patched jobState. +func (c *FakeJobStates) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *automationbroker_io_v1.JobState, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(jobstatesResource, c.ns, name, data, subresources...), &automationbroker_io_v1.JobState{}) + + if obj == nil { + return nil, err + } + return obj.(*automationbroker_io_v1.JobState), err +} diff --git a/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/fake/fake_servicebinding.go b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/fake/fake_servicebinding.go new file mode 100644 index 0000000000..e1e89b38ff --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/fake/fake_servicebinding.go @@ -0,0 +1,125 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package fake + +import ( + automationbroker_io_v1 "github.com/automationbroker/broker-client-go/pkg/apis/automationbroker.io/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeServiceBindings implements ServiceBindingInterface +type FakeServiceBindings struct { + Fake *FakeAutomationbrokerV1 + ns string +} + +var servicebindingsResource = schema.GroupVersionResource{Group: "automationbroker.io", Version: "v1", Resource: "servicebindings"} + +var servicebindingsKind = schema.GroupVersionKind{Group: "automationbroker.io", Version: "v1", Kind: "ServiceBinding"} + +// Get takes name of the serviceBinding, and returns the corresponding serviceBinding object, and an error if there is any. +func (c *FakeServiceBindings) Get(name string, options v1.GetOptions) (result *automationbroker_io_v1.ServiceBinding, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(servicebindingsResource, c.ns, name), &automationbroker_io_v1.ServiceBinding{}) + + if obj == nil { + return nil, err + } + return obj.(*automationbroker_io_v1.ServiceBinding), err +} + +// List takes label and field selectors, and returns the list of ServiceBindings that match those selectors. +func (c *FakeServiceBindings) List(opts v1.ListOptions) (result *automationbroker_io_v1.ServiceBindingList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(servicebindingsResource, servicebindingsKind, c.ns, opts), &automationbroker_io_v1.ServiceBindingList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &automationbroker_io_v1.ServiceBindingList{} + for _, item := range obj.(*automationbroker_io_v1.ServiceBindingList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested serviceBindings. +func (c *FakeServiceBindings) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(servicebindingsResource, c.ns, opts)) + +} + +// Create takes the representation of a serviceBinding and creates it. Returns the server's representation of the serviceBinding, and an error, if there is any. +func (c *FakeServiceBindings) Create(serviceBinding *automationbroker_io_v1.ServiceBinding) (result *automationbroker_io_v1.ServiceBinding, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(servicebindingsResource, c.ns, serviceBinding), &automationbroker_io_v1.ServiceBinding{}) + + if obj == nil { + return nil, err + } + return obj.(*automationbroker_io_v1.ServiceBinding), err +} + +// Update takes the representation of a serviceBinding and updates it. Returns the server's representation of the serviceBinding, and an error, if there is any. +func (c *FakeServiceBindings) Update(serviceBinding *automationbroker_io_v1.ServiceBinding) (result *automationbroker_io_v1.ServiceBinding, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(servicebindingsResource, c.ns, serviceBinding), &automationbroker_io_v1.ServiceBinding{}) + + if obj == nil { + return nil, err + } + return obj.(*automationbroker_io_v1.ServiceBinding), err +} + +// Delete takes name of the serviceBinding and deletes it. Returns an error if one occurs. +func (c *FakeServiceBindings) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(servicebindingsResource, c.ns, name), &automationbroker_io_v1.ServiceBinding{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeServiceBindings) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(servicebindingsResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &automationbroker_io_v1.ServiceBindingList{}) + return err +} + +// Patch applies the patch and returns the patched serviceBinding. +func (c *FakeServiceBindings) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *automationbroker_io_v1.ServiceBinding, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(servicebindingsResource, c.ns, name, data, subresources...), &automationbroker_io_v1.ServiceBinding{}) + + if obj == nil { + return nil, err + } + return obj.(*automationbroker_io_v1.ServiceBinding), err +} diff --git a/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/fake/fake_serviceinstance.go b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/fake/fake_serviceinstance.go new file mode 100644 index 0000000000..4f10c8f89c --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/fake/fake_serviceinstance.go @@ -0,0 +1,125 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package fake + +import ( + automationbroker_io_v1 "github.com/automationbroker/broker-client-go/pkg/apis/automationbroker.io/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeServiceInstances implements ServiceInstanceInterface +type FakeServiceInstances struct { + Fake *FakeAutomationbrokerV1 + ns string +} + +var serviceinstancesResource = schema.GroupVersionResource{Group: "automationbroker.io", Version: "v1", Resource: "serviceinstances"} + +var serviceinstancesKind = schema.GroupVersionKind{Group: "automationbroker.io", Version: "v1", Kind: "ServiceInstance"} + +// Get takes name of the serviceInstance, and returns the corresponding serviceInstance object, and an error if there is any. +func (c *FakeServiceInstances) Get(name string, options v1.GetOptions) (result *automationbroker_io_v1.ServiceInstance, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(serviceinstancesResource, c.ns, name), &automationbroker_io_v1.ServiceInstance{}) + + if obj == nil { + return nil, err + } + return obj.(*automationbroker_io_v1.ServiceInstance), err +} + +// List takes label and field selectors, and returns the list of ServiceInstances that match those selectors. +func (c *FakeServiceInstances) List(opts v1.ListOptions) (result *automationbroker_io_v1.ServiceInstanceList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(serviceinstancesResource, serviceinstancesKind, c.ns, opts), &automationbroker_io_v1.ServiceInstanceList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &automationbroker_io_v1.ServiceInstanceList{} + for _, item := range obj.(*automationbroker_io_v1.ServiceInstanceList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested serviceInstances. +func (c *FakeServiceInstances) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(serviceinstancesResource, c.ns, opts)) + +} + +// Create takes the representation of a serviceInstance and creates it. Returns the server's representation of the serviceInstance, and an error, if there is any. +func (c *FakeServiceInstances) Create(serviceInstance *automationbroker_io_v1.ServiceInstance) (result *automationbroker_io_v1.ServiceInstance, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(serviceinstancesResource, c.ns, serviceInstance), &automationbroker_io_v1.ServiceInstance{}) + + if obj == nil { + return nil, err + } + return obj.(*automationbroker_io_v1.ServiceInstance), err +} + +// Update takes the representation of a serviceInstance and updates it. Returns the server's representation of the serviceInstance, and an error, if there is any. +func (c *FakeServiceInstances) Update(serviceInstance *automationbroker_io_v1.ServiceInstance) (result *automationbroker_io_v1.ServiceInstance, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(serviceinstancesResource, c.ns, serviceInstance), &automationbroker_io_v1.ServiceInstance{}) + + if obj == nil { + return nil, err + } + return obj.(*automationbroker_io_v1.ServiceInstance), err +} + +// Delete takes name of the serviceInstance and deletes it. Returns an error if one occurs. +func (c *FakeServiceInstances) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(serviceinstancesResource, c.ns, name), &automationbroker_io_v1.ServiceInstance{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeServiceInstances) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(serviceinstancesResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &automationbroker_io_v1.ServiceInstanceList{}) + return err +} + +// Patch applies the patch and returns the patched serviceInstance. +func (c *FakeServiceInstances) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *automationbroker_io_v1.ServiceInstance, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(serviceinstancesResource, c.ns, name, data, subresources...), &automationbroker_io_v1.ServiceInstance{}) + + if obj == nil { + return nil, err + } + return obj.(*automationbroker_io_v1.ServiceInstance), err +} diff --git a/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/generated_expansion.go b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/generated_expansion.go new file mode 100644 index 0000000000..9408c7b9f2 --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/generated_expansion.go @@ -0,0 +1,24 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package v1 + +type BundleExpansion interface{} + +type JobStateExpansion interface{} + +type ServiceBindingExpansion interface{} + +type ServiceInstanceExpansion interface{} diff --git a/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/jobstate.go b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/jobstate.go new file mode 100644 index 0000000000..6f569c5256 --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/jobstate.go @@ -0,0 +1,154 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package v1 + +import ( + scheme "github.com/automationbroker/broker-client-go/client/clientset/versioned/scheme" + v1 "github.com/automationbroker/broker-client-go/pkg/apis/automationbroker.io/v1" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// JobStatesGetter has a method to return a JobStateInterface. +// A group's client should implement this interface. +type JobStatesGetter interface { + JobStates(namespace string) JobStateInterface +} + +// JobStateInterface has methods to work with JobState resources. +type JobStateInterface interface { + Create(*v1.JobState) (*v1.JobState, error) + Update(*v1.JobState) (*v1.JobState, error) + Delete(name string, options *meta_v1.DeleteOptions) error + DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error + Get(name string, options meta_v1.GetOptions) (*v1.JobState, error) + List(opts meta_v1.ListOptions) (*v1.JobStateList, error) + Watch(opts meta_v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.JobState, err error) + JobStateExpansion +} + +// jobStates implements JobStateInterface +type jobStates struct { + client rest.Interface + ns string +} + +// newJobStates returns a JobStates +func newJobStates(c *AutomationbrokerV1Client, namespace string) *jobStates { + return &jobStates{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the jobState, and returns the corresponding jobState object, and an error if there is any. +func (c *jobStates) Get(name string, options meta_v1.GetOptions) (result *v1.JobState, err error) { + result = &v1.JobState{} + err = c.client.Get(). + Namespace(c.ns). + Resource("jobstates"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of JobStates that match those selectors. +func (c *jobStates) List(opts meta_v1.ListOptions) (result *v1.JobStateList, err error) { + result = &v1.JobStateList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("jobstates"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested jobStates. +func (c *jobStates) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("jobstates"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a jobState and creates it. Returns the server's representation of the jobState, and an error, if there is any. +func (c *jobStates) Create(jobState *v1.JobState) (result *v1.JobState, err error) { + result = &v1.JobState{} + err = c.client.Post(). + Namespace(c.ns). + Resource("jobstates"). + Body(jobState). + Do(). + Into(result) + return +} + +// Update takes the representation of a jobState and updates it. Returns the server's representation of the jobState, and an error, if there is any. +func (c *jobStates) Update(jobState *v1.JobState) (result *v1.JobState, err error) { + result = &v1.JobState{} + err = c.client.Put(). + Namespace(c.ns). + Resource("jobstates"). + Name(jobState.Name). + Body(jobState). + Do(). + Into(result) + return +} + +// Delete takes name of the jobState and deletes it. Returns an error if one occurs. +func (c *jobStates) Delete(name string, options *meta_v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("jobstates"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *jobStates) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("jobstates"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched jobState. +func (c *jobStates) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.JobState, err error) { + result = &v1.JobState{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("jobstates"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/servicebinding.go b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/servicebinding.go new file mode 100644 index 0000000000..b9fb55e8db --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/servicebinding.go @@ -0,0 +1,154 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package v1 + +import ( + scheme "github.com/automationbroker/broker-client-go/client/clientset/versioned/scheme" + v1 "github.com/automationbroker/broker-client-go/pkg/apis/automationbroker.io/v1" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// ServiceBindingsGetter has a method to return a ServiceBindingInterface. +// A group's client should implement this interface. +type ServiceBindingsGetter interface { + ServiceBindings(namespace string) ServiceBindingInterface +} + +// ServiceBindingInterface has methods to work with ServiceBinding resources. +type ServiceBindingInterface interface { + Create(*v1.ServiceBinding) (*v1.ServiceBinding, error) + Update(*v1.ServiceBinding) (*v1.ServiceBinding, error) + Delete(name string, options *meta_v1.DeleteOptions) error + DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error + Get(name string, options meta_v1.GetOptions) (*v1.ServiceBinding, error) + List(opts meta_v1.ListOptions) (*v1.ServiceBindingList, error) + Watch(opts meta_v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ServiceBinding, err error) + ServiceBindingExpansion +} + +// serviceBindings implements ServiceBindingInterface +type serviceBindings struct { + client rest.Interface + ns string +} + +// newServiceBindings returns a ServiceBindings +func newServiceBindings(c *AutomationbrokerV1Client, namespace string) *serviceBindings { + return &serviceBindings{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the serviceBinding, and returns the corresponding serviceBinding object, and an error if there is any. +func (c *serviceBindings) Get(name string, options meta_v1.GetOptions) (result *v1.ServiceBinding, err error) { + result = &v1.ServiceBinding{} + err = c.client.Get(). + Namespace(c.ns). + Resource("servicebindings"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ServiceBindings that match those selectors. +func (c *serviceBindings) List(opts meta_v1.ListOptions) (result *v1.ServiceBindingList, err error) { + result = &v1.ServiceBindingList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("servicebindings"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested serviceBindings. +func (c *serviceBindings) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("servicebindings"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a serviceBinding and creates it. Returns the server's representation of the serviceBinding, and an error, if there is any. +func (c *serviceBindings) Create(serviceBinding *v1.ServiceBinding) (result *v1.ServiceBinding, err error) { + result = &v1.ServiceBinding{} + err = c.client.Post(). + Namespace(c.ns). + Resource("servicebindings"). + Body(serviceBinding). + Do(). + Into(result) + return +} + +// Update takes the representation of a serviceBinding and updates it. Returns the server's representation of the serviceBinding, and an error, if there is any. +func (c *serviceBindings) Update(serviceBinding *v1.ServiceBinding) (result *v1.ServiceBinding, err error) { + result = &v1.ServiceBinding{} + err = c.client.Put(). + Namespace(c.ns). + Resource("servicebindings"). + Name(serviceBinding.Name). + Body(serviceBinding). + Do(). + Into(result) + return +} + +// Delete takes name of the serviceBinding and deletes it. Returns an error if one occurs. +func (c *serviceBindings) Delete(name string, options *meta_v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("servicebindings"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *serviceBindings) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("servicebindings"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched serviceBinding. +func (c *serviceBindings) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ServiceBinding, err error) { + result = &v1.ServiceBinding{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("servicebindings"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/serviceinstance.go b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/serviceinstance.go new file mode 100644 index 0000000000..6ebc803842 --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/client/clientset/versioned/typed/automationbroker.io/v1/serviceinstance.go @@ -0,0 +1,154 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package v1 + +import ( + scheme "github.com/automationbroker/broker-client-go/client/clientset/versioned/scheme" + v1 "github.com/automationbroker/broker-client-go/pkg/apis/automationbroker.io/v1" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// ServiceInstancesGetter has a method to return a ServiceInstanceInterface. +// A group's client should implement this interface. +type ServiceInstancesGetter interface { + ServiceInstances(namespace string) ServiceInstanceInterface +} + +// ServiceInstanceInterface has methods to work with ServiceInstance resources. +type ServiceInstanceInterface interface { + Create(*v1.ServiceInstance) (*v1.ServiceInstance, error) + Update(*v1.ServiceInstance) (*v1.ServiceInstance, error) + Delete(name string, options *meta_v1.DeleteOptions) error + DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error + Get(name string, options meta_v1.GetOptions) (*v1.ServiceInstance, error) + List(opts meta_v1.ListOptions) (*v1.ServiceInstanceList, error) + Watch(opts meta_v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ServiceInstance, err error) + ServiceInstanceExpansion +} + +// serviceInstances implements ServiceInstanceInterface +type serviceInstances struct { + client rest.Interface + ns string +} + +// newServiceInstances returns a ServiceInstances +func newServiceInstances(c *AutomationbrokerV1Client, namespace string) *serviceInstances { + return &serviceInstances{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the serviceInstance, and returns the corresponding serviceInstance object, and an error if there is any. +func (c *serviceInstances) Get(name string, options meta_v1.GetOptions) (result *v1.ServiceInstance, err error) { + result = &v1.ServiceInstance{} + err = c.client.Get(). + Namespace(c.ns). + Resource("serviceinstances"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ServiceInstances that match those selectors. +func (c *serviceInstances) List(opts meta_v1.ListOptions) (result *v1.ServiceInstanceList, err error) { + result = &v1.ServiceInstanceList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("serviceinstances"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested serviceInstances. +func (c *serviceInstances) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("serviceinstances"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a serviceInstance and creates it. Returns the server's representation of the serviceInstance, and an error, if there is any. +func (c *serviceInstances) Create(serviceInstance *v1.ServiceInstance) (result *v1.ServiceInstance, err error) { + result = &v1.ServiceInstance{} + err = c.client.Post(). + Namespace(c.ns). + Resource("serviceinstances"). + Body(serviceInstance). + Do(). + Into(result) + return +} + +// Update takes the representation of a serviceInstance and updates it. Returns the server's representation of the serviceInstance, and an error, if there is any. +func (c *serviceInstances) Update(serviceInstance *v1.ServiceInstance) (result *v1.ServiceInstance, err error) { + result = &v1.ServiceInstance{} + err = c.client.Put(). + Namespace(c.ns). + Resource("serviceinstances"). + Name(serviceInstance.Name). + Body(serviceInstance). + Do(). + Into(result) + return +} + +// Delete takes name of the serviceInstance and deletes it. Returns an error if one occurs. +func (c *serviceInstances) Delete(name string, options *meta_v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("serviceinstances"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *serviceInstances) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("serviceinstances"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched serviceInstance. +func (c *serviceInstances) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ServiceInstance, err error) { + result = &v1.ServiceInstance{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("serviceinstances"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/github.com/automationbroker/broker-client-go/client/informers/externalversions/automationbroker.io/interface.go b/vendor/github.com/automationbroker/broker-client-go/client/informers/externalversions/automationbroker.io/interface.go new file mode 100644 index 0000000000..c465f00e4d --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/client/informers/externalversions/automationbroker.io/interface.go @@ -0,0 +1,46 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +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. +*/ + +// This file was automatically generated by informer-gen + +package automationbroker + +import ( + v1 "github.com/automationbroker/broker-client-go/client/informers/externalversions/automationbroker.io/v1" + internalinterfaces "github.com/automationbroker/broker-client-go/client/informers/externalversions/internalinterfaces" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // V1 provides access to shared informers for resources in V1. + V1() v1.Interface +} + +type group struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// V1 returns a new v1.Interface. +func (g *group) V1() v1.Interface { + return v1.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/vendor/github.com/automationbroker/broker-client-go/client/informers/externalversions/automationbroker.io/v1/bundle.go b/vendor/github.com/automationbroker/broker-client-go/client/informers/externalversions/automationbroker.io/v1/bundle.go new file mode 100644 index 0000000000..1565a26fa4 --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/client/informers/externalversions/automationbroker.io/v1/bundle.go @@ -0,0 +1,89 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +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. +*/ + +// This file was automatically generated by informer-gen + +package v1 + +import ( + time "time" + + versioned "github.com/automationbroker/broker-client-go/client/clientset/versioned" + internalinterfaces "github.com/automationbroker/broker-client-go/client/informers/externalversions/internalinterfaces" + v1 "github.com/automationbroker/broker-client-go/client/listers/automationbroker.io/v1" + automationbroker_io_v1 "github.com/automationbroker/broker-client-go/pkg/apis/automationbroker.io/v1" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// BundleInformer provides access to a shared informer and lister for +// Bundles. +type BundleInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.BundleLister +} + +type bundleInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewBundleInformer constructs a new informer for Bundle type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewBundleInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredBundleInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredBundleInformer constructs a new informer for Bundle type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredBundleInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AutomationbrokerV1().Bundles(namespace).List(options) + }, + WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AutomationbrokerV1().Bundles(namespace).Watch(options) + }, + }, + &automationbroker_io_v1.Bundle{}, + resyncPeriod, + indexers, + ) +} + +func (f *bundleInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredBundleInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *bundleInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&automationbroker_io_v1.Bundle{}, f.defaultInformer) +} + +func (f *bundleInformer) Lister() v1.BundleLister { + return v1.NewBundleLister(f.Informer().GetIndexer()) +} diff --git a/vendor/github.com/automationbroker/broker-client-go/client/informers/externalversions/automationbroker.io/v1/interface.go b/vendor/github.com/automationbroker/broker-client-go/client/informers/externalversions/automationbroker.io/v1/interface.go new file mode 100644 index 0000000000..01b92c32f0 --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/client/informers/externalversions/automationbroker.io/v1/interface.go @@ -0,0 +1,66 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +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. +*/ + +// This file was automatically generated by informer-gen + +package v1 + +import ( + internalinterfaces "github.com/automationbroker/broker-client-go/client/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // Bundles returns a BundleInformer. + Bundles() BundleInformer + // JobStates returns a JobStateInformer. + JobStates() JobStateInformer + // ServiceBindings returns a ServiceBindingInformer. + ServiceBindings() ServiceBindingInformer + // ServiceInstances returns a ServiceInstanceInformer. + ServiceInstances() ServiceInstanceInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// Bundles returns a BundleInformer. +func (v *version) Bundles() BundleInformer { + return &bundleInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// JobStates returns a JobStateInformer. +func (v *version) JobStates() JobStateInformer { + return &jobStateInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// ServiceBindings returns a ServiceBindingInformer. +func (v *version) ServiceBindings() ServiceBindingInformer { + return &serviceBindingInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// ServiceInstances returns a ServiceInstanceInformer. +func (v *version) ServiceInstances() ServiceInstanceInformer { + return &serviceInstanceInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/vendor/github.com/automationbroker/broker-client-go/client/informers/externalversions/automationbroker.io/v1/jobstate.go b/vendor/github.com/automationbroker/broker-client-go/client/informers/externalversions/automationbroker.io/v1/jobstate.go new file mode 100644 index 0000000000..1405bea596 --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/client/informers/externalversions/automationbroker.io/v1/jobstate.go @@ -0,0 +1,89 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +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. +*/ + +// This file was automatically generated by informer-gen + +package v1 + +import ( + time "time" + + versioned "github.com/automationbroker/broker-client-go/client/clientset/versioned" + internalinterfaces "github.com/automationbroker/broker-client-go/client/informers/externalversions/internalinterfaces" + v1 "github.com/automationbroker/broker-client-go/client/listers/automationbroker.io/v1" + automationbroker_io_v1 "github.com/automationbroker/broker-client-go/pkg/apis/automationbroker.io/v1" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// JobStateInformer provides access to a shared informer and lister for +// JobStates. +type JobStateInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.JobStateLister +} + +type jobStateInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewJobStateInformer constructs a new informer for JobState type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewJobStateInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredJobStateInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredJobStateInformer constructs a new informer for JobState type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredJobStateInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AutomationbrokerV1().JobStates(namespace).List(options) + }, + WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AutomationbrokerV1().JobStates(namespace).Watch(options) + }, + }, + &automationbroker_io_v1.JobState{}, + resyncPeriod, + indexers, + ) +} + +func (f *jobStateInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredJobStateInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *jobStateInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&automationbroker_io_v1.JobState{}, f.defaultInformer) +} + +func (f *jobStateInformer) Lister() v1.JobStateLister { + return v1.NewJobStateLister(f.Informer().GetIndexer()) +} diff --git a/vendor/github.com/automationbroker/broker-client-go/client/informers/externalversions/automationbroker.io/v1/servicebinding.go b/vendor/github.com/automationbroker/broker-client-go/client/informers/externalversions/automationbroker.io/v1/servicebinding.go new file mode 100644 index 0000000000..b3fc4f1bf5 --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/client/informers/externalversions/automationbroker.io/v1/servicebinding.go @@ -0,0 +1,89 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +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. +*/ + +// This file was automatically generated by informer-gen + +package v1 + +import ( + time "time" + + versioned "github.com/automationbroker/broker-client-go/client/clientset/versioned" + internalinterfaces "github.com/automationbroker/broker-client-go/client/informers/externalversions/internalinterfaces" + v1 "github.com/automationbroker/broker-client-go/client/listers/automationbroker.io/v1" + automationbroker_io_v1 "github.com/automationbroker/broker-client-go/pkg/apis/automationbroker.io/v1" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ServiceBindingInformer provides access to a shared informer and lister for +// ServiceBindings. +type ServiceBindingInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ServiceBindingLister +} + +type serviceBindingInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewServiceBindingInformer constructs a new informer for ServiceBinding type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewServiceBindingInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredServiceBindingInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredServiceBindingInformer constructs a new informer for ServiceBinding type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredServiceBindingInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AutomationbrokerV1().ServiceBindings(namespace).List(options) + }, + WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AutomationbrokerV1().ServiceBindings(namespace).Watch(options) + }, + }, + &automationbroker_io_v1.ServiceBinding{}, + resyncPeriod, + indexers, + ) +} + +func (f *serviceBindingInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredServiceBindingInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *serviceBindingInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&automationbroker_io_v1.ServiceBinding{}, f.defaultInformer) +} + +func (f *serviceBindingInformer) Lister() v1.ServiceBindingLister { + return v1.NewServiceBindingLister(f.Informer().GetIndexer()) +} diff --git a/vendor/github.com/automationbroker/broker-client-go/client/informers/externalversions/automationbroker.io/v1/serviceinstance.go b/vendor/github.com/automationbroker/broker-client-go/client/informers/externalversions/automationbroker.io/v1/serviceinstance.go new file mode 100644 index 0000000000..937df7274f --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/client/informers/externalversions/automationbroker.io/v1/serviceinstance.go @@ -0,0 +1,89 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +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. +*/ + +// This file was automatically generated by informer-gen + +package v1 + +import ( + time "time" + + versioned "github.com/automationbroker/broker-client-go/client/clientset/versioned" + internalinterfaces "github.com/automationbroker/broker-client-go/client/informers/externalversions/internalinterfaces" + v1 "github.com/automationbroker/broker-client-go/client/listers/automationbroker.io/v1" + automationbroker_io_v1 "github.com/automationbroker/broker-client-go/pkg/apis/automationbroker.io/v1" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ServiceInstanceInformer provides access to a shared informer and lister for +// ServiceInstances. +type ServiceInstanceInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ServiceInstanceLister +} + +type serviceInstanceInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewServiceInstanceInformer constructs a new informer for ServiceInstance type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewServiceInstanceInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredServiceInstanceInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredServiceInstanceInformer constructs a new informer for ServiceInstance type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredServiceInstanceInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AutomationbrokerV1().ServiceInstances(namespace).List(options) + }, + WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AutomationbrokerV1().ServiceInstances(namespace).Watch(options) + }, + }, + &automationbroker_io_v1.ServiceInstance{}, + resyncPeriod, + indexers, + ) +} + +func (f *serviceInstanceInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredServiceInstanceInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *serviceInstanceInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&automationbroker_io_v1.ServiceInstance{}, f.defaultInformer) +} + +func (f *serviceInstanceInformer) Lister() v1.ServiceInstanceLister { + return v1.NewServiceInstanceLister(f.Informer().GetIndexer()) +} diff --git a/vendor/github.com/automationbroker/broker-client-go/client/informers/externalversions/factory.go b/vendor/github.com/automationbroker/broker-client-go/client/informers/externalversions/factory.go new file mode 100644 index 0000000000..be82ad2e2a --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/client/informers/externalversions/factory.go @@ -0,0 +1,131 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +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. +*/ + +// This file was automatically generated by informer-gen + +package externalversions + +import ( + reflect "reflect" + sync "sync" + time "time" + + versioned "github.com/automationbroker/broker-client-go/client/clientset/versioned" + automationbroker_io "github.com/automationbroker/broker-client-go/client/informers/externalversions/automationbroker.io" + internalinterfaces "github.com/automationbroker/broker-client-go/client/informers/externalversions/internalinterfaces" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + cache "k8s.io/client-go/tools/cache" +) + +type sharedInformerFactory struct { + client versioned.Interface + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc + lock sync.Mutex + defaultResync time.Duration + + informers map[reflect.Type]cache.SharedIndexInformer + // startedInformers is used for tracking which informers have been started. + // This allows Start() to be called multiple times safely. + startedInformers map[reflect.Type]bool +} + +// NewSharedInformerFactory constructs a new instance of sharedInformerFactory +func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory { + return NewFilteredSharedInformerFactory(client, defaultResync, v1.NamespaceAll, nil) +} + +// NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory. +// Listers obtained via this SharedInformerFactory will be subject to the same filters +// as specified here. +func NewFilteredSharedInformerFactory(client versioned.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory { + return &sharedInformerFactory{ + client: client, + namespace: namespace, + tweakListOptions: tweakListOptions, + defaultResync: defaultResync, + informers: make(map[reflect.Type]cache.SharedIndexInformer), + startedInformers: make(map[reflect.Type]bool), + } +} + +// Start initializes all requested informers. +func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { + f.lock.Lock() + defer f.lock.Unlock() + + for informerType, informer := range f.informers { + if !f.startedInformers[informerType] { + go informer.Run(stopCh) + f.startedInformers[informerType] = true + } + } +} + +// WaitForCacheSync waits for all started informers' cache were synced. +func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { + informers := func() map[reflect.Type]cache.SharedIndexInformer { + f.lock.Lock() + defer f.lock.Unlock() + + informers := map[reflect.Type]cache.SharedIndexInformer{} + for informerType, informer := range f.informers { + if f.startedInformers[informerType] { + informers[informerType] = informer + } + } + return informers + }() + + res := map[reflect.Type]bool{} + for informType, informer := range informers { + res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced) + } + return res +} + +// InternalInformerFor returns the SharedIndexInformer for obj using an internal +// client. +func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { + f.lock.Lock() + defer f.lock.Unlock() + + informerType := reflect.TypeOf(obj) + informer, exists := f.informers[informerType] + if exists { + return informer + } + informer = newFunc(f.client, f.defaultResync) + f.informers[informerType] = informer + + return informer +} + +// SharedInformerFactory provides shared informers for resources in all known +// API group versions. +type SharedInformerFactory interface { + internalinterfaces.SharedInformerFactory + ForResource(resource schema.GroupVersionResource) (GenericInformer, error) + WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool + + Automationbroker() automationbroker_io.Interface +} + +func (f *sharedInformerFactory) Automationbroker() automationbroker_io.Interface { + return automationbroker_io.New(f, f.namespace, f.tweakListOptions) +} diff --git a/vendor/github.com/automationbroker/broker-client-go/client/informers/externalversions/generic.go b/vendor/github.com/automationbroker/broker-client-go/client/informers/externalversions/generic.go new file mode 100644 index 0000000000..07910c4556 --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/client/informers/externalversions/generic.go @@ -0,0 +1,68 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +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. +*/ + +// This file was automatically generated by informer-gen + +package externalversions + +import ( + "fmt" + + v1 "github.com/automationbroker/broker-client-go/pkg/apis/automationbroker.io/v1" + schema "k8s.io/apimachinery/pkg/runtime/schema" + cache "k8s.io/client-go/tools/cache" +) + +// GenericInformer is type of SharedIndexInformer which will locate and delegate to other +// sharedInformers based on type +type GenericInformer interface { + Informer() cache.SharedIndexInformer + Lister() cache.GenericLister +} + +type genericInformer struct { + informer cache.SharedIndexInformer + resource schema.GroupResource +} + +// Informer returns the SharedIndexInformer. +func (f *genericInformer) Informer() cache.SharedIndexInformer { + return f.informer +} + +// Lister returns the GenericLister. +func (f *genericInformer) Lister() cache.GenericLister { + return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource) +} + +// ForResource gives generic access to a shared informer of the matching type +// TODO extend this to unknown resources with a client pool +func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { + switch resource { + // Group=automationbroker.io, Version=v1 + case v1.SchemeGroupVersion.WithResource("bundles"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Automationbroker().V1().Bundles().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("jobstates"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Automationbroker().V1().JobStates().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("servicebindings"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Automationbroker().V1().ServiceBindings().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("serviceinstances"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Automationbroker().V1().ServiceInstances().Informer()}, nil + + } + + return nil, fmt.Errorf("no informer found for %v", resource) +} diff --git a/vendor/github.com/automationbroker/broker-client-go/client/informers/externalversions/internalinterfaces/factory_interfaces.go b/vendor/github.com/automationbroker/broker-client-go/client/informers/externalversions/internalinterfaces/factory_interfaces.go new file mode 100644 index 0000000000..149e21a251 --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/client/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -0,0 +1,38 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +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. +*/ + +// This file was automatically generated by informer-gen + +package internalinterfaces + +import ( + time "time" + + versioned "github.com/automationbroker/broker-client-go/client/clientset/versioned" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + cache "k8s.io/client-go/tools/cache" +) + +type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer + +// SharedInformerFactory a small interface to allow for adding an informer without an import cycle +type SharedInformerFactory interface { + Start(stopCh <-chan struct{}) + InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer +} + +type TweakListOptionsFunc func(*v1.ListOptions) diff --git a/vendor/github.com/automationbroker/broker-client-go/client/listers/automationbroker.io/v1/bundle.go b/vendor/github.com/automationbroker/broker-client-go/client/listers/automationbroker.io/v1/bundle.go new file mode 100644 index 0000000000..ea8bbe76c2 --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/client/listers/automationbroker.io/v1/bundle.go @@ -0,0 +1,94 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +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. +*/ + +// This file was automatically generated by lister-gen + +package v1 + +import ( + v1 "github.com/automationbroker/broker-client-go/pkg/apis/automationbroker.io/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// BundleLister helps list Bundles. +type BundleLister interface { + // List lists all Bundles in the indexer. + List(selector labels.Selector) (ret []*v1.Bundle, err error) + // Bundles returns an object that can list and get Bundles. + Bundles(namespace string) BundleNamespaceLister + BundleListerExpansion +} + +// bundleLister implements the BundleLister interface. +type bundleLister struct { + indexer cache.Indexer +} + +// NewBundleLister returns a new BundleLister. +func NewBundleLister(indexer cache.Indexer) BundleLister { + return &bundleLister{indexer: indexer} +} + +// List lists all Bundles in the indexer. +func (s *bundleLister) List(selector labels.Selector) (ret []*v1.Bundle, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Bundle)) + }) + return ret, err +} + +// Bundles returns an object that can list and get Bundles. +func (s *bundleLister) Bundles(namespace string) BundleNamespaceLister { + return bundleNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// BundleNamespaceLister helps list and get Bundles. +type BundleNamespaceLister interface { + // List lists all Bundles in the indexer for a given namespace. + List(selector labels.Selector) (ret []*v1.Bundle, err error) + // Get retrieves the Bundle from the indexer for a given namespace and name. + Get(name string) (*v1.Bundle, error) + BundleNamespaceListerExpansion +} + +// bundleNamespaceLister implements the BundleNamespaceLister +// interface. +type bundleNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all Bundles in the indexer for a given namespace. +func (s bundleNamespaceLister) List(selector labels.Selector) (ret []*v1.Bundle, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1.Bundle)) + }) + return ret, err +} + +// Get retrieves the Bundle from the indexer for a given namespace and name. +func (s bundleNamespaceLister) Get(name string) (*v1.Bundle, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("bundle"), name) + } + return obj.(*v1.Bundle), nil +} diff --git a/vendor/github.com/automationbroker/broker-client-go/client/listers/automationbroker.io/v1/expansion_generated.go b/vendor/github.com/automationbroker/broker-client-go/client/listers/automationbroker.io/v1/expansion_generated.go new file mode 100644 index 0000000000..a57cd770e7 --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/client/listers/automationbroker.io/v1/expansion_generated.go @@ -0,0 +1,51 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +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. +*/ + +// This file was automatically generated by lister-gen + +package v1 + +// BundleListerExpansion allows custom methods to be added to +// BundleLister. +type BundleListerExpansion interface{} + +// BundleNamespaceListerExpansion allows custom methods to be added to +// BundleNamespaceLister. +type BundleNamespaceListerExpansion interface{} + +// JobStateListerExpansion allows custom methods to be added to +// JobStateLister. +type JobStateListerExpansion interface{} + +// JobStateNamespaceListerExpansion allows custom methods to be added to +// JobStateNamespaceLister. +type JobStateNamespaceListerExpansion interface{} + +// ServiceBindingListerExpansion allows custom methods to be added to +// ServiceBindingLister. +type ServiceBindingListerExpansion interface{} + +// ServiceBindingNamespaceListerExpansion allows custom methods to be added to +// ServiceBindingNamespaceLister. +type ServiceBindingNamespaceListerExpansion interface{} + +// ServiceInstanceListerExpansion allows custom methods to be added to +// ServiceInstanceLister. +type ServiceInstanceListerExpansion interface{} + +// ServiceInstanceNamespaceListerExpansion allows custom methods to be added to +// ServiceInstanceNamespaceLister. +type ServiceInstanceNamespaceListerExpansion interface{} diff --git a/vendor/github.com/automationbroker/broker-client-go/client/listers/automationbroker.io/v1/jobstate.go b/vendor/github.com/automationbroker/broker-client-go/client/listers/automationbroker.io/v1/jobstate.go new file mode 100644 index 0000000000..bc1ce6c4aa --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/client/listers/automationbroker.io/v1/jobstate.go @@ -0,0 +1,94 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +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. +*/ + +// This file was automatically generated by lister-gen + +package v1 + +import ( + v1 "github.com/automationbroker/broker-client-go/pkg/apis/automationbroker.io/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// JobStateLister helps list JobStates. +type JobStateLister interface { + // List lists all JobStates in the indexer. + List(selector labels.Selector) (ret []*v1.JobState, err error) + // JobStates returns an object that can list and get JobStates. + JobStates(namespace string) JobStateNamespaceLister + JobStateListerExpansion +} + +// jobStateLister implements the JobStateLister interface. +type jobStateLister struct { + indexer cache.Indexer +} + +// NewJobStateLister returns a new JobStateLister. +func NewJobStateLister(indexer cache.Indexer) JobStateLister { + return &jobStateLister{indexer: indexer} +} + +// List lists all JobStates in the indexer. +func (s *jobStateLister) List(selector labels.Selector) (ret []*v1.JobState, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.JobState)) + }) + return ret, err +} + +// JobStates returns an object that can list and get JobStates. +func (s *jobStateLister) JobStates(namespace string) JobStateNamespaceLister { + return jobStateNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// JobStateNamespaceLister helps list and get JobStates. +type JobStateNamespaceLister interface { + // List lists all JobStates in the indexer for a given namespace. + List(selector labels.Selector) (ret []*v1.JobState, err error) + // Get retrieves the JobState from the indexer for a given namespace and name. + Get(name string) (*v1.JobState, error) + JobStateNamespaceListerExpansion +} + +// jobStateNamespaceLister implements the JobStateNamespaceLister +// interface. +type jobStateNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all JobStates in the indexer for a given namespace. +func (s jobStateNamespaceLister) List(selector labels.Selector) (ret []*v1.JobState, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1.JobState)) + }) + return ret, err +} + +// Get retrieves the JobState from the indexer for a given namespace and name. +func (s jobStateNamespaceLister) Get(name string) (*v1.JobState, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("jobstate"), name) + } + return obj.(*v1.JobState), nil +} diff --git a/vendor/github.com/automationbroker/broker-client-go/client/listers/automationbroker.io/v1/servicebinding.go b/vendor/github.com/automationbroker/broker-client-go/client/listers/automationbroker.io/v1/servicebinding.go new file mode 100644 index 0000000000..8c0f8e9776 --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/client/listers/automationbroker.io/v1/servicebinding.go @@ -0,0 +1,94 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +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. +*/ + +// This file was automatically generated by lister-gen + +package v1 + +import ( + v1 "github.com/automationbroker/broker-client-go/pkg/apis/automationbroker.io/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ServiceBindingLister helps list ServiceBindings. +type ServiceBindingLister interface { + // List lists all ServiceBindings in the indexer. + List(selector labels.Selector) (ret []*v1.ServiceBinding, err error) + // ServiceBindings returns an object that can list and get ServiceBindings. + ServiceBindings(namespace string) ServiceBindingNamespaceLister + ServiceBindingListerExpansion +} + +// serviceBindingLister implements the ServiceBindingLister interface. +type serviceBindingLister struct { + indexer cache.Indexer +} + +// NewServiceBindingLister returns a new ServiceBindingLister. +func NewServiceBindingLister(indexer cache.Indexer) ServiceBindingLister { + return &serviceBindingLister{indexer: indexer} +} + +// List lists all ServiceBindings in the indexer. +func (s *serviceBindingLister) List(selector labels.Selector) (ret []*v1.ServiceBinding, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ServiceBinding)) + }) + return ret, err +} + +// ServiceBindings returns an object that can list and get ServiceBindings. +func (s *serviceBindingLister) ServiceBindings(namespace string) ServiceBindingNamespaceLister { + return serviceBindingNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// ServiceBindingNamespaceLister helps list and get ServiceBindings. +type ServiceBindingNamespaceLister interface { + // List lists all ServiceBindings in the indexer for a given namespace. + List(selector labels.Selector) (ret []*v1.ServiceBinding, err error) + // Get retrieves the ServiceBinding from the indexer for a given namespace and name. + Get(name string) (*v1.ServiceBinding, error) + ServiceBindingNamespaceListerExpansion +} + +// serviceBindingNamespaceLister implements the ServiceBindingNamespaceLister +// interface. +type serviceBindingNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all ServiceBindings in the indexer for a given namespace. +func (s serviceBindingNamespaceLister) List(selector labels.Selector) (ret []*v1.ServiceBinding, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ServiceBinding)) + }) + return ret, err +} + +// Get retrieves the ServiceBinding from the indexer for a given namespace and name. +func (s serviceBindingNamespaceLister) Get(name string) (*v1.ServiceBinding, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("servicebinding"), name) + } + return obj.(*v1.ServiceBinding), nil +} diff --git a/vendor/github.com/automationbroker/broker-client-go/client/listers/automationbroker.io/v1/serviceinstance.go b/vendor/github.com/automationbroker/broker-client-go/client/listers/automationbroker.io/v1/serviceinstance.go new file mode 100644 index 0000000000..bc2d862d0d --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/client/listers/automationbroker.io/v1/serviceinstance.go @@ -0,0 +1,94 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +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. +*/ + +// This file was automatically generated by lister-gen + +package v1 + +import ( + v1 "github.com/automationbroker/broker-client-go/pkg/apis/automationbroker.io/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ServiceInstanceLister helps list ServiceInstances. +type ServiceInstanceLister interface { + // List lists all ServiceInstances in the indexer. + List(selector labels.Selector) (ret []*v1.ServiceInstance, err error) + // ServiceInstances returns an object that can list and get ServiceInstances. + ServiceInstances(namespace string) ServiceInstanceNamespaceLister + ServiceInstanceListerExpansion +} + +// serviceInstanceLister implements the ServiceInstanceLister interface. +type serviceInstanceLister struct { + indexer cache.Indexer +} + +// NewServiceInstanceLister returns a new ServiceInstanceLister. +func NewServiceInstanceLister(indexer cache.Indexer) ServiceInstanceLister { + return &serviceInstanceLister{indexer: indexer} +} + +// List lists all ServiceInstances in the indexer. +func (s *serviceInstanceLister) List(selector labels.Selector) (ret []*v1.ServiceInstance, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ServiceInstance)) + }) + return ret, err +} + +// ServiceInstances returns an object that can list and get ServiceInstances. +func (s *serviceInstanceLister) ServiceInstances(namespace string) ServiceInstanceNamespaceLister { + return serviceInstanceNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// ServiceInstanceNamespaceLister helps list and get ServiceInstances. +type ServiceInstanceNamespaceLister interface { + // List lists all ServiceInstances in the indexer for a given namespace. + List(selector labels.Selector) (ret []*v1.ServiceInstance, err error) + // Get retrieves the ServiceInstance from the indexer for a given namespace and name. + Get(name string) (*v1.ServiceInstance, error) + ServiceInstanceNamespaceListerExpansion +} + +// serviceInstanceNamespaceLister implements the ServiceInstanceNamespaceLister +// interface. +type serviceInstanceNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all ServiceInstances in the indexer for a given namespace. +func (s serviceInstanceNamespaceLister) List(selector labels.Selector) (ret []*v1.ServiceInstance, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ServiceInstance)) + }) + return ret, err +} + +// Get retrieves the ServiceInstance from the indexer for a given namespace and name. +func (s serviceInstanceNamespaceLister) Get(name string) (*v1.ServiceInstance, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("serviceinstance"), name) + } + return obj.(*v1.ServiceInstance), nil +} diff --git a/vendor/github.com/automationbroker/broker-client-go/cmd/example/main.go b/vendor/github.com/automationbroker/broker-client-go/cmd/example/main.go new file mode 100644 index 0000000000..26e0ddf90b --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/cmd/example/main.go @@ -0,0 +1,73 @@ +package main + +import ( + "flag" + "fmt" + + "github.com/golang/glog" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/tools/clientcmd" + + examplecomclientset "github.com/automationbroker/broker-client-go/client/clientset/versioned" +) + +var ( + kuberconfig = flag.String("kubeconfig", "", "Path to a kubeconfig. Only required if out-of-cluster.") + master = flag.String("master", "", "The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster.") +) + +func main() { + flag.Parse() + + cfg, err := clientcmd.BuildConfigFromFlags(*master, *kuberconfig) + if err != nil { + glog.Fatalf("Error building kubeconfig: %v", err) + } + + exampleClient, err := examplecomclientset.NewForConfig(cfg) + if err != nil { + glog.Fatalf("Error building example clientset: %v", err) + } + + list, err := exampleClient.Automationbroker().Bundles("ansible-service-broker").List(metav1.ListOptions{}) + if err != nil { + glog.Fatalf("Error listing all databases: %v", err) + } + + fmt.Printf("Got Bundles: \n") + for _, bundle := range list.Items { + fmt.Printf("bundle: %#v\n", bundle) + } + fmt.Printf("\n") + + jobList, err := exampleClient.AutomationbrokerV1().JobStates("ansible-service-broker").List(metav1.ListOptions{}) + if err != nil { + glog.Fatalf("Error listing all jobstates: %v", err) + } + fmt.Printf("Got JobLists: \n") + for _, jobstate := range jobList.Items { + fmt.Printf("job state: %#v\n", jobstate) + } + fmt.Printf("\n") + + bindList, err := exampleClient.AutomationbrokerV1().ServiceBindings("ansible-service-broker").List(metav1.ListOptions{}) + if err != nil { + glog.Fatalf("Error listing all jobstates: %v", err) + } + fmt.Printf("Got service bindings: \n") + for _, servicebinding := range bindList.Items { + fmt.Printf("job state: %#v\n", servicebinding) + } + fmt.Printf("\n") + + instList, err := exampleClient.AutomationbrokerV1().ServiceInstances("ansible-service-broker").List(metav1.ListOptions{}) + if err != nil { + glog.Fatalf("Error listing all jobstates: %v", err) + } + fmt.Printf("Got service instances: \n") + for _, serviceinstance := range instList.Items { + fmt.Printf("job state: %#v\n", serviceinstance) + } + fmt.Printf("\n") +} diff --git a/vendor/github.com/automationbroker/broker-client-go/hack/custom-boilerplate.go.txt b/vendor/github.com/automationbroker/broker-client-go/hack/custom-boilerplate.go.txt new file mode 100644 index 0000000000..5d4e55d7c1 --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/hack/custom-boilerplate.go.txt @@ -0,0 +1,15 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +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. +*/ diff --git a/vendor/github.com/automationbroker/broker-client-go/hack/update-codegen.sh b/vendor/github.com/automationbroker/broker-client-go/hack/update-codegen.sh new file mode 100755 index 0000000000..75e2efe67c --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/hack/update-codegen.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -o errexit +set -o nounset +set -o pipefail + +SCRIPT_ROOT=$(dirname ${BASH_SOURCE})/.. +CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${SCRIPT_ROOT}; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ${GOPATH}/src/k8s.io/code-generator)} + +vendor/k8s.io/code-generator/generate-groups.sh all \ + github.com/automationbroker/broker-client-go/client github.com/automationbroker/broker-client-go/pkg/apis \ + automationbroker.io:v1 \ + --go-header-file ${SCRIPT_ROOT}/hack/custom-boilerplate.go.txt diff --git a/vendor/github.com/automationbroker/broker-client-go/hack/verify-codegen.sh b/vendor/github.com/automationbroker/broker-client-go/hack/verify-codegen.sh new file mode 100755 index 0000000000..904586d05a --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/hack/verify-codegen.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +set -o errexit +set -o nounset +set -o pipefail + +SCRIPT_ROOT=$(dirname "${BASH_SOURCE}")/.. +DIFFROOT="${SCRIPT_ROOT}/pkg" +TMP_DIFFROOT="${SCRIPT_ROOT}/_tmp/pkg" +_tmp="${SCRIPT_ROOT}/_tmp" + +cleanup() { + rm -rf "${_tmp}" +} +trap "cleanup" EXIT SIGINT + +cleanup + +mkdir -p "${TMP_DIFFROOT}" +cp -a "${DIFFROOT}"/* "${TMP_DIFFROOT}" + +"${SCRIPT_ROOT}/hack/update-codegen.sh" +echo "diffing ${DIFFROOT} against freshly generated codegen" +ret=0 +diff -Naupr "${DIFFROOT}" "${TMP_DIFFROOT}" || ret=$? +cp -a "${TMP_DIFFROOT}"/* "${DIFFROOT}" +if [[ $ret -eq 0 ]] +then + echo "${DIFFROOT} up to date." +else + echo "${DIFFROOT} is out of date. Please run hack/update-codegen.sh" + exit 1 +fi diff --git a/vendor/github.com/automationbroker/broker-client-go/pkg/apis/automationbroker.io/register.go b/vendor/github.com/automationbroker/broker-client-go/pkg/apis/automationbroker.io/register.go new file mode 100644 index 0000000000..bc61049e56 --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/pkg/apis/automationbroker.io/register.go @@ -0,0 +1,22 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package brokerautomationbrokerio + +const ( + // GroupName - for the broker crds + GroupName = "automationbroker.io" +) diff --git a/vendor/github.com/automationbroker/broker-client-go/pkg/apis/automationbroker.io/v1/doc.go b/vendor/github.com/automationbroker/broker-client-go/pkg/apis/automationbroker.io/v1/doc.go new file mode 100644 index 0000000000..e68aaf6394 --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/pkg/apis/automationbroker.io/v1/doc.go @@ -0,0 +1,21 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +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. +*/ + +// +k8s:deepcopy-gen=package,register + +//Package v1 is the first verson the of API. +// +groupdName=automationbroker.io +package v1 diff --git a/vendor/github.com/automationbroker/broker-client-go/pkg/apis/automationbroker.io/v1/register.go b/vendor/github.com/automationbroker/broker-client-go/pkg/apis/automationbroker.io/v1/register.go new file mode 100644 index 0000000000..fc08c8cf04 --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/pkg/apis/automationbroker.io/v1/register.go @@ -0,0 +1,63 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +import ( + automationbroker "github.com/automationbroker/broker-client-go/pkg/apis/automationbroker.io" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// SchemeGroupVersion is group version used to register these objects +var SchemeGroupVersion = schema.GroupVersion{Group: automationbroker.GroupName, Version: "v1"} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + //SchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. + SchemeBuilder runtime.SchemeBuilder + localSchemeBuilder = &SchemeBuilder + //AddToScheme - add to scheme method + AddToScheme = localSchemeBuilder.AddToScheme +) + +func init() { + // We only register manually written functions here. The registration of the + // generated functions takes place in the generated files. The separation + // makes the code compile even when the generated files are missing. + localSchemeBuilder.Register(addKnownTypes) +} + +// Adds the list of known types to api.Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &Bundle{}, + &BundleList{}, + &JobState{}, + &JobStateList{}, + &ServiceBinding{}, + &ServiceBindingList{}, + &ServiceInstance{}, + &ServiceBindingList{}, + ) + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/vendor/github.com/automationbroker/broker-client-go/pkg/apis/automationbroker.io/v1/types.go b/vendor/github.com/automationbroker/broker-client-go/pkg/apis/automationbroker.io/v1/types.go new file mode 100644 index 0000000000..9ed5ef1e5d --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/pkg/apis/automationbroker.io/v1/types.go @@ -0,0 +1,236 @@ +/* +Copyright (c) 2018 Red Hat, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +genclient:noStatus +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// Bundle describes a apb spec. +type Bundle struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec BundleSpec `json:"spec"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// BundleList is a list of Database resources +type BundleList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + + Items []Bundle `json:"items"` +} + +// AsyncType - the type of async value allowed +type AsyncType string + +const ( + // OptionalAsync - async is optional for the bundle. + OptionalAsync AsyncType = "optional" + // RequiredAsync - async is required for the bundle. + RequiredAsync AsyncType = "required" + // Unsupported - async is unsuported for the bundle. + Unsupported AsyncType = "unsupported" +) + +// BundleSpec is the spec for an APB resource +type BundleSpec struct { + Runtime int `json:"runtime"` + Version string `json:"version"` + FQName string `json:"fq_name"` + Image string `json:"image"` + Description string `json:"description"` + Tags []string `json:"tags,omitempty"` + Bindable bool `json:"bindable"` + Async AsyncType `json:"async"` + // Store the metadata as a json encoded string to preserve the genericness + Metadata string `json:"metadata"` + Plans []Plan `json:"plans"` +} + +// Plan - a plan for a bundle spec +type Plan struct { + ID string `json:"id"` + Name string `json:"name"` + Description string `json:"description"` + // Store the metadata as a json encoded string to preserve the genericness + Metadata string `json:"metadata"` + Free bool `json:"free"` + Bindable bool `json:"bindable"` + UpdatesTo []string `json:"updates_to,omitempty"` + Parameters []Parameters `json:"parameters,omitempty"` + BindParameters []Parameters `json:"bindParameters,omitempty"` +} + +// NilableNumber - Number that could be nil (e.g. when omitted from json/yaml) +type NilableNumber float64 + +// Parameters - describe the parameters for a plan +type Parameters struct { + Name string `json:"name"` + Title string `json:"title"` + Type string `json:"type"` + Description string `json:"description"` + // Store the default value as a json encoded string + Default string `json:"default"` + DeprecatedMaxLength int `json:"deprecatedMaxLength"` + MaxLength int `json:"maxLength"` + MinLength int `json:"minLength,omitempty" yaml:"min_length,omitempty"` + Pattern string `json:"pattern,omitempty"` + MultipleOf float64 `json:"multipleOf,omitempty" yaml:"multiple_of,omitempty"` + Maximum *NilableNumber `json:"maximum,omitempty"` + ExclusiveMaximum *NilableNumber `json:"exclusiveMaximum,omitempty" yaml:"exclusive_maximum,omitempty"` + Minimum *NilableNumber `json:"minimum,omitempty"` + ExclusiveMinimum *NilableNumber `json:"exclusiveMinimum,omitempty" yaml:"exclusive_minimum,omitempty"` + Enum []string `json:"enum,omitempty"` + Required bool `json:"required"` + Updatable bool `json:"updatable"` + DisplayType string `json:"displayType,omitempty" yaml:"display_type,omitempty"` + DisplayGroup string `json:"displayGroup,omitempty" yaml:"display_group,omitempty"` +} + +// +genclient +// +genclient:noStatus +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// JobState describes a apb spec. +type JobState struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec JobStateSpec `json:"spec"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// JobStateList is a list of Database resources +type JobStateList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + + Items []JobState `json:"items"` +} + +// State - State the job is in. +type State string + +// JobMethod - Method that the job is running. +type JobMethod string + +const ( + //StateNotYetStarted - has not yet started state + StateNotYetStarted State = "not-started" + // StateInProgress - APB is in progress state + StateInProgress State = "in-progress" + // StateSucceeded - Succeeded state + StateSucceeded State = "succeeded" + // StateFailed - Failed state + StateFailed State = "failed" + // JobMethodProvision - Provision MethodType const. + JobMethodProvision JobMethod = "provision" + // JobMethodDeprovision - Deprovision MethodType const. + JobMethodDeprovision JobMethod = "deprovision" + // JobMethodBind - Bind MethodType const. + JobMethodBind JobMethod = "bind" + // JobMethodUnbind - Unbind MethodType const. + JobMethodUnbind JobMethod = "unbind" + // JobMethodUpdate - Update MethodType const. + JobMethodUpdate JobMethod = "update" +) + +// JobStateSpec describes the job state for an async job +type JobStateSpec struct { + State State `json:"state"` + PodName string `json:"podName"` + Method JobMethod `json:"method"` + Error string `json:"error"` + Description string `json:"description"` +} + +// +genclient +// +genclient:noStatus +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ServiceBinding describes a service binding. +type ServiceBinding struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec ServiceBindingSpec `json:"spec"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ServiceBindingList is a list of ServiceBinding resources +type ServiceBindingList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + + Items []ServiceBinding `json:"items"` +} + +// ServiceBindingSpec is a service binding. +type ServiceBindingSpec struct { + ServiceInstanceID string `json:"serviceInstanceID"` + // Store the parameters as a json encoded string. + Parameters string `json:"parameters"` + JobToken string `json:"jobToken"` +} + +// +genclient +// +genclient:noStatus +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ServiceInstance describes a service binding. +type ServiceInstance struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec ServiceInstanceSpec `json:"spec"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ServiceInstanceList is a list of ServiceInstance resources +type ServiceInstanceList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + + Items []ServiceInstance `json:"items"` +} + +// ServiceInstanceSpec is a service instance. +type ServiceInstanceSpec struct { + BundleID string `json:"bundleID"` + Context Context `json:"context"` + // Store the parameters as json encoded strings. + Parameters string `json:"parameters"` + BindingIDs []string `json:"bindingIDs"` +} + +// Context is the context for the ServiceInstance. +type Context struct { + Plateform string `json:"plateform"` + Namespace string `json:"namespace"` +} diff --git a/vendor/github.com/automationbroker/broker-client-go/pkg/apis/automationbroker.io/v1/zz_generated.deepcopy.go b/vendor/github.com/automationbroker/broker-client-go/pkg/apis/automationbroker.io/v1/zz_generated.deepcopy.go new file mode 100644 index 0000000000..ab12952e72 --- /dev/null +++ b/vendor/github.com/automationbroker/broker-client-go/pkg/apis/automationbroker.io/v1/zz_generated.deepcopy.go @@ -0,0 +1,455 @@ +// +build !ignore_autogenerated + +/* +Copyright (c) 2018 Red Hat, Inc. + +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. +*/ + +// This file was autogenerated by deepcopy-gen. Do not edit it manually! + +package v1 + +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 *Bundle) DeepCopyInto(out *Bundle) { + *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 Bundle. +func (in *Bundle) DeepCopy() *Bundle { + if in == nil { + return nil + } + out := new(Bundle) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Bundle) 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 *BundleList) DeepCopyInto(out *BundleList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Bundle, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BundleList. +func (in *BundleList) DeepCopy() *BundleList { + if in == nil { + return nil + } + out := new(BundleList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *BundleList) 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 *BundleSpec) DeepCopyInto(out *BundleSpec) { + *out = *in + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Plans != nil { + in, out := &in.Plans, &out.Plans + *out = make([]Plan, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BundleSpec. +func (in *BundleSpec) DeepCopy() *BundleSpec { + if in == nil { + return nil + } + out := new(BundleSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Context) DeepCopyInto(out *Context) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Context. +func (in *Context) DeepCopy() *Context { + if in == nil { + return nil + } + out := new(Context) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobState) DeepCopyInto(out *JobState) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobState. +func (in *JobState) DeepCopy() *JobState { + if in == nil { + return nil + } + out := new(JobState) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *JobState) 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 *JobStateList) DeepCopyInto(out *JobStateList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]JobState, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobStateList. +func (in *JobStateList) DeepCopy() *JobStateList { + if in == nil { + return nil + } + out := new(JobStateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *JobStateList) 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 *JobStateSpec) DeepCopyInto(out *JobStateSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobStateSpec. +func (in *JobStateSpec) DeepCopy() *JobStateSpec { + if in == nil { + return nil + } + out := new(JobStateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Parameters) DeepCopyInto(out *Parameters) { + *out = *in + if in.Maximum != nil { + in, out := &in.Maximum, &out.Maximum + if *in == nil { + *out = nil + } else { + *out = new(NilableNumber) + **out = **in + } + } + if in.ExclusiveMaximum != nil { + in, out := &in.ExclusiveMaximum, &out.ExclusiveMaximum + if *in == nil { + *out = nil + } else { + *out = new(NilableNumber) + **out = **in + } + } + if in.Minimum != nil { + in, out := &in.Minimum, &out.Minimum + if *in == nil { + *out = nil + } else { + *out = new(NilableNumber) + **out = **in + } + } + if in.ExclusiveMinimum != nil { + in, out := &in.ExclusiveMinimum, &out.ExclusiveMinimum + if *in == nil { + *out = nil + } else { + *out = new(NilableNumber) + **out = **in + } + } + if in.Enum != nil { + in, out := &in.Enum, &out.Enum + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Parameters. +func (in *Parameters) DeepCopy() *Parameters { + if in == nil { + return nil + } + out := new(Parameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Plan) DeepCopyInto(out *Plan) { + *out = *in + if in.UpdatesTo != nil { + in, out := &in.UpdatesTo, &out.UpdatesTo + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Parameters != nil { + in, out := &in.Parameters, &out.Parameters + *out = make([]Parameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.BindParameters != nil { + in, out := &in.BindParameters, &out.BindParameters + *out = make([]Parameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Plan. +func (in *Plan) DeepCopy() *Plan { + if in == nil { + return nil + } + out := new(Plan) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceBinding) DeepCopyInto(out *ServiceBinding) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceBinding. +func (in *ServiceBinding) DeepCopy() *ServiceBinding { + if in == nil { + return nil + } + out := new(ServiceBinding) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceBinding) 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 *ServiceBindingList) DeepCopyInto(out *ServiceBindingList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServiceBinding, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceBindingList. +func (in *ServiceBindingList) DeepCopy() *ServiceBindingList { + if in == nil { + return nil + } + out := new(ServiceBindingList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceBindingList) 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 *ServiceBindingSpec) DeepCopyInto(out *ServiceBindingSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceBindingSpec. +func (in *ServiceBindingSpec) DeepCopy() *ServiceBindingSpec { + if in == nil { + return nil + } + out := new(ServiceBindingSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceInstance) DeepCopyInto(out *ServiceInstance) { + *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 ServiceInstance. +func (in *ServiceInstance) DeepCopy() *ServiceInstance { + if in == nil { + return nil + } + out := new(ServiceInstance) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceInstance) 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 *ServiceInstanceList) DeepCopyInto(out *ServiceInstanceList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ServiceInstance, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceInstanceList. +func (in *ServiceInstanceList) DeepCopy() *ServiceInstanceList { + if in == nil { + return nil + } + out := new(ServiceInstanceList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ServiceInstanceList) 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 *ServiceInstanceSpec) DeepCopyInto(out *ServiceInstanceSpec) { + *out = *in + out.Context = in.Context + if in.BindingIDs != nil { + in, out := &in.BindingIDs, &out.BindingIDs + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceInstanceSpec. +func (in *ServiceInstanceSpec) DeepCopy() *ServiceInstanceSpec { + if in == nil { + return nil + } + out := new(ServiceInstanceSpec) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/github.com/pmezard/go-difflib/difflib/difflib.go b/vendor/github.com/pmezard/go-difflib/difflib/difflib.go index 64cc40fe1d..003e99fadb 100644 --- a/vendor/github.com/pmezard/go-difflib/difflib/difflib.go +++ b/vendor/github.com/pmezard/go-difflib/difflib/difflib.go @@ -559,10 +559,14 @@ type UnifiedDiff struct { func WriteUnifiedDiff(writer io.Writer, diff UnifiedDiff) error { buf := bufio.NewWriter(writer) defer buf.Flush() - w := func(format string, args ...interface{}) error { + wf := func(format string, args ...interface{}) error { _, err := buf.WriteString(fmt.Sprintf(format, args...)) return err } + ws := func(s string) error { + _, err := buf.WriteString(s) + return err + } if len(diff.Eol) == 0 { diff.Eol = "\n" @@ -581,26 +585,28 @@ func WriteUnifiedDiff(writer io.Writer, diff UnifiedDiff) error { if len(diff.ToDate) > 0 { toDate = "\t" + diff.ToDate } - err := w("--- %s%s%s", diff.FromFile, fromDate, diff.Eol) - if err != nil { - return err - } - err = w("+++ %s%s%s", diff.ToFile, toDate, diff.Eol) - if err != nil { - return err + if diff.FromFile != "" || diff.ToFile != "" { + err := wf("--- %s%s%s", diff.FromFile, fromDate, diff.Eol) + if err != nil { + return err + } + err = wf("+++ %s%s%s", diff.ToFile, toDate, diff.Eol) + if err != nil { + return err + } } } first, last := g[0], g[len(g)-1] range1 := formatRangeUnified(first.I1, last.I2) range2 := formatRangeUnified(first.J1, last.J2) - if err := w("@@ -%s +%s @@%s", range1, range2, diff.Eol); err != nil { + if err := wf("@@ -%s +%s @@%s", range1, range2, diff.Eol); err != nil { return err } for _, c := range g { i1, i2, j1, j2 := c.I1, c.I2, c.J1, c.J2 if c.Tag == 'e' { for _, line := range diff.A[i1:i2] { - if err := w(" " + line); err != nil { + if err := ws(" " + line); err != nil { return err } } @@ -608,14 +614,14 @@ func WriteUnifiedDiff(writer io.Writer, diff UnifiedDiff) error { } if c.Tag == 'r' || c.Tag == 'd' { for _, line := range diff.A[i1:i2] { - if err := w("-" + line); err != nil { + if err := ws("-" + line); err != nil { return err } } } if c.Tag == 'r' || c.Tag == 'i' { for _, line := range diff.B[j1:j2] { - if err := w("+" + line); err != nil { + if err := ws("+" + line); err != nil { return err } } @@ -669,12 +675,18 @@ func WriteContextDiff(writer io.Writer, diff ContextDiff) error { buf := bufio.NewWriter(writer) defer buf.Flush() var diffErr error - w := func(format string, args ...interface{}) { + wf := func(format string, args ...interface{}) { _, err := buf.WriteString(fmt.Sprintf(format, args...)) if diffErr == nil && err != nil { diffErr = err } } + ws := func(s string) { + _, err := buf.WriteString(s) + if diffErr == nil && err != nil { + diffErr = err + } + } if len(diff.Eol) == 0 { diff.Eol = "\n" @@ -700,15 +712,17 @@ func WriteContextDiff(writer io.Writer, diff ContextDiff) error { if len(diff.ToDate) > 0 { toDate = "\t" + diff.ToDate } - w("*** %s%s%s", diff.FromFile, fromDate, diff.Eol) - w("--- %s%s%s", diff.ToFile, toDate, diff.Eol) + if diff.FromFile != "" || diff.ToFile != "" { + wf("*** %s%s%s", diff.FromFile, fromDate, diff.Eol) + wf("--- %s%s%s", diff.ToFile, toDate, diff.Eol) + } } first, last := g[0], g[len(g)-1] - w("***************" + diff.Eol) + ws("***************" + diff.Eol) range1 := formatRangeContext(first.I1, last.I2) - w("*** %s ****%s", range1, diff.Eol) + wf("*** %s ****%s", range1, diff.Eol) for _, c := range g { if c.Tag == 'r' || c.Tag == 'd' { for _, cc := range g { @@ -716,7 +730,7 @@ func WriteContextDiff(writer io.Writer, diff ContextDiff) error { continue } for _, line := range diff.A[cc.I1:cc.I2] { - w(prefix[cc.Tag] + line) + ws(prefix[cc.Tag] + line) } } break @@ -724,7 +738,7 @@ func WriteContextDiff(writer io.Writer, diff ContextDiff) error { } range2 := formatRangeContext(first.J1, last.J2) - w("--- %s ----%s", range2, diff.Eol) + wf("--- %s ----%s", range2, diff.Eol) for _, c := range g { if c.Tag == 'r' || c.Tag == 'i' { for _, cc := range g { @@ -732,7 +746,7 @@ func WriteContextDiff(writer io.Writer, diff ContextDiff) error { continue } for _, line := range diff.B[cc.J1:cc.J2] { - w(prefix[cc.Tag] + line) + ws(prefix[cc.Tag] + line) } } break diff --git a/vendor/github.com/pmezard/go-difflib/difflib/difflib_test.go b/vendor/github.com/pmezard/go-difflib/difflib/difflib_test.go index 94670bea35..d725119620 100644 --- a/vendor/github.com/pmezard/go-difflib/difflib/difflib_test.go +++ b/vendor/github.com/pmezard/go-difflib/difflib/difflib_test.go @@ -102,11 +102,12 @@ group } } -func ExampleGetUnifiedDiffString() { +func ExampleGetUnifiedDiffCode() { a := `one two three -four` +four +fmt.Printf("%s,%T",a,b)` b := `zero one three @@ -121,16 +122,54 @@ four` Context: 3, } result, _ := GetUnifiedDiffString(diff) - fmt.Printf(strings.Replace(result, "\t", " ", -1)) + fmt.Println(strings.Replace(result, "\t", " ", -1)) // Output: // --- Original 2005-01-26 23:30:50 // +++ Current 2010-04-02 10:20:52 - // @@ -1,4 +1,4 @@ + // @@ -1,5 +1,4 @@ // +zero // one // -two // three // four + // -fmt.Printf("%s,%T",a,b) +} + +func ExampleGetContextDiffCode() { + a := `one +two +three +four +fmt.Printf("%s,%T",a,b)` + b := `zero +one +tree +four` + diff := ContextDiff{ + A: SplitLines(a), + B: SplitLines(b), + FromFile: "Original", + ToFile: "Current", + Context: 3, + Eol: "\n", + } + result, _ := GetContextDiffString(diff) + fmt.Print(strings.Replace(result, "\t", " ", -1)) + // Output: + // *** Original + // --- Current + // *************** + // *** 1,5 **** + // one + // ! two + // ! three + // four + // - fmt.Printf("%s,%T",a,b) + // --- 1,4 ---- + // + zero + // one + // ! tree + // four } func ExampleGetContextDiffString() { @@ -318,6 +357,41 @@ func TestOutputFormatNoTrailingTabOnEmptyFiledate(t *testing.T) { assertEqual(t, SplitLines(cd)[:2], []string{"*** Original\n", "--- Current\n"}) } +func TestOmitFilenames(t *testing.T) { + diff := UnifiedDiff{ + A: SplitLines("o\nn\ne\n"), + B: SplitLines("t\nw\no\n"), + Eol: "\n", + } + ud, err := GetUnifiedDiffString(diff) + assertEqual(t, err, nil) + assertEqual(t, SplitLines(ud), []string{ + "@@ -0,0 +1,2 @@\n", + "+t\n", + "+w\n", + "@@ -2,2 +3,0 @@\n", + "-n\n", + "-e\n", + "\n", + }) + + cd, err := GetContextDiffString(ContextDiff(diff)) + assertEqual(t, err, nil) + assertEqual(t, SplitLines(cd), []string{ + "***************\n", + "*** 0 ****\n", + "--- 1,2 ----\n", + "+ t\n", + "+ w\n", + "***************\n", + "*** 2,3 ****\n", + "- n\n", + "- e\n", + "--- 3 ----\n", + "\n", + }) +} + func TestSplitLines(t *testing.T) { allTests := []struct { input string