├── example ├── traffic-split.yml ├── consul │ ├── sync-catalog-deployment.yaml │ ├── server-clusterrole.yaml │ ├── client-serviceaccount.yaml │ ├── server-serviceaccount.yaml │ ├── server-acl-init-serviceaccount.yaml │ ├── connect-inject-serviceaccount.yaml │ ├── connect-inject-authmethod-serviceaccount.yaml │ ├── client-clusterrole.yaml │ ├── connect-inject-authmethod-clusterrole.yaml │ ├── ui-service.yaml │ ├── connect-inject-service.yaml │ ├── client-clusterrolebinding.yaml │ ├── server-clusterrolebinding.yaml │ ├── client-config-configmap.yaml │ ├── server-acl-init-clusterrolebinding.yaml │ ├── server-disruptionbudget.yaml │ ├── dns-service.yaml │ ├── connect-inject-clusterrole.yaml │ ├── connect-inject-clusterrolebinding.yaml │ ├── server-acl-init-clusterrole.yaml │ ├── server-config-configmap.yaml │ ├── connect-inject-mutatingwebhook.yaml │ ├── connect-inject-authmethod-clusterrolebinding.yaml │ ├── server-acl-init-job.yaml │ ├── server-service.yaml │ ├── connect-inject-deployment.yaml │ ├── server-statefulset.yaml │ └── client-daemonset.yaml ├── smi.yml ├── example-app.yml └── README.md ├── .gitignore ├── Dockerfile ├── clients ├── consul_mock.go ├── consul.go └── consul_test.go ├── Makefile ├── crd.yml ├── scripts └── helper.sh ├── consul-smi-controller.yml ├── go.mod ├── main.go ├── access ├── traffictarget_test.go └── traffictarget.go ├── README.md ├── LICENSE └── go.sum /example/traffic-split.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | bin/** 2 | .pid_consul-consul-server 3 | .vs_code 4 | -------------------------------------------------------------------------------- /example/consul/sync-catalog-deployment.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: consul/templates/sync-catalog-deployment.yaml 3 | # The deployment for running the sync-catalog pod 4 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:latest 2 | 3 | RUN addgroup -g 1000 -S app && \ 4 | adduser -u 1000 -S app -G app 5 | 6 | RUN mkdir /app 7 | COPY bin/smi-controller /app/smi-controller 8 | 9 | CMD /app/smi-controller 10 | -------------------------------------------------------------------------------- /example/consul/server-clusterrole.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: consul/templates/server-clusterrole.yaml 3 | 4 | apiVersion: rbac.authorization.k8s.io/v1 5 | kind: ClusterRole 6 | metadata: 7 | name: consul-consul-server 8 | labels: 9 | app: consul 10 | chart: consul-helm 11 | heritage: Tiller 12 | release: consul 13 | -------------------------------------------------------------------------------- /example/consul/client-serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: consul/templates/client-serviceaccount.yaml 3 | 4 | apiVersion: v1 5 | kind: ServiceAccount 6 | metadata: 7 | name: consul-consul-client 8 | namespace: default 9 | labels: 10 | app: consul 11 | chart: consul-helm 12 | heritage: Tiller 13 | release: consul 14 | -------------------------------------------------------------------------------- /example/consul/server-serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: consul/templates/server-serviceaccount.yaml 3 | 4 | apiVersion: v1 5 | kind: ServiceAccount 6 | metadata: 7 | name: consul-consul-server 8 | namespace: default 9 | labels: 10 | app: consul 11 | chart: consul-helm 12 | heritage: Tiller 13 | release: consul 14 | -------------------------------------------------------------------------------- /example/consul/server-acl-init-serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: consul/templates/server-acl-init-serviceaccount.yaml 3 | 4 | apiVersion: v1 5 | kind: ServiceAccount 6 | metadata: 7 | name: consul-consul-server-acl-init 8 | namespace: default 9 | labels: 10 | app: consul 11 | chart: consul-helm 12 | heritage: Tiller 13 | release: consul -------------------------------------------------------------------------------- /example/consul/connect-inject-serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: consul/templates/connect-inject-serviceaccount.yaml 3 | 4 | apiVersion: v1 5 | kind: ServiceAccount 6 | metadata: 7 | name: consul-consul-connect-injector-webhook-svc-account 8 | namespace: default 9 | labels: 10 | app: consul 11 | chart: consul-helm 12 | heritage: Tiller 13 | release: consul 14 | -------------------------------------------------------------------------------- /example/consul/connect-inject-authmethod-serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: consul/templates/connect-inject-authmethod-serviceaccount.yaml 3 | 4 | apiVersion: v1 5 | kind: ServiceAccount 6 | metadata: 7 | name: consul-consul-connect-injector-authmethod-svc-account 8 | namespace: default 9 | labels: 10 | app: consul 11 | chart: consul-helm 12 | heritage: Tiller 13 | release: consul 14 | -------------------------------------------------------------------------------- /clients/consul_mock.go: -------------------------------------------------------------------------------- 1 | package clients 2 | 3 | import "github.com/stretchr/testify/mock" 4 | 5 | // ConsulMock is a mock implementation of the Consul client 6 | type ConsulMock struct { 7 | Mock mock.Mock 8 | } 9 | 10 | // SyncIntentions syncs the intentions in Consul 11 | func (c *ConsulMock) SyncIntentions(source []string, destination string) error { 12 | args := c.Mock.Called(source, destination) 13 | return args.Error(0) 14 | } 15 | -------------------------------------------------------------------------------- /example/consul/client-clusterrole.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: consul/templates/client-clusterrole.yaml 3 | 4 | apiVersion: rbac.authorization.k8s.io/v1 5 | kind: ClusterRole 6 | metadata: 7 | name: consul-consul-client 8 | labels: 9 | app: consul 10 | chart: consul-helm 11 | heritage: Tiller 12 | release: consul 13 | rules: 14 | - apiGroups: [""] 15 | resources: 16 | - secrets 17 | resourceNames: 18 | - consul-consul-client-acl-token 19 | verbs: 20 | - get 21 | -------------------------------------------------------------------------------- /example/consul/connect-inject-authmethod-clusterrole.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: consul/templates/connect-inject-authmethod-clusterrole.yaml 3 | 4 | apiVersion: rbac.authorization.k8s.io/v1 5 | kind: ClusterRole 6 | metadata: 7 | name: consul-consul-connect-injector-authmethod-role 8 | labels: 9 | app: consul 10 | chart: consul-helm 11 | heritage: Tiller 12 | release: consul 13 | rules: 14 | - apiGroups: [""] 15 | resources: 16 | - serviceaccounts 17 | verbs: 18 | - get 19 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | VERSION := v0.0.0-alpha.2 2 | DOCKER_TAG := hashicorp/consul-smi-controller 3 | 4 | 5 | build: 6 | CGO_ENABLED=0 go build -o bin/smi-controller ./ 7 | 8 | run-consul: 9 | scripts/helper.sh consul 10 | 11 | run-controller: build 12 | bin/smi-controller --consul-http-addr=${CONSUL_HTTP_ADDR} --consul-http-token=${CONSUL_HTTP_TOKEN} --kubeconfig=${KUBECONFIG} 13 | 14 | build-docker: build 15 | docker build -f ./Dockerfile -t ${DOCKER_TAG}:${VERSION} . 16 | 17 | push-docker: 18 | docker push ${DOCKER_TAG}:${VERSION} 19 | -------------------------------------------------------------------------------- /example/consul/ui-service.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: consul/templates/ui-service.yaml 3 | # UI Service for Consul Server 4 | apiVersion: v1 5 | kind: Service 6 | metadata: 7 | name: consul-consul-ui 8 | namespace: default 9 | labels: 10 | app: consul 11 | chart: consul-helm 12 | heritage: Tiller 13 | release: consul 14 | spec: 15 | selector: 16 | app: consul 17 | release: "consul" 18 | component: server 19 | ports: 20 | - name: http 21 | port: 80 22 | targetPort: 8500 23 | type: LoadBalancer 24 | -------------------------------------------------------------------------------- /example/consul/connect-inject-service.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: consul/templates/connect-inject-service.yaml 3 | # The service for the Connect sidecar injector 4 | apiVersion: v1 5 | kind: Service 6 | metadata: 7 | name: consul-consul-connect-injector-svc 8 | namespace: default 9 | labels: 10 | app: consul 11 | chart: consul-helm 12 | heritage: Tiller 13 | release: consul 14 | spec: 15 | ports: 16 | - port: 443 17 | targetPort: 8080 18 | selector: 19 | app: consul 20 | release: "consul" 21 | component: connect-injector 22 | 23 | -------------------------------------------------------------------------------- /example/consul/client-clusterrolebinding.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: consul/templates/client-clusterrolebinding.yaml 3 | 4 | apiVersion: rbac.authorization.k8s.io/v1 5 | kind: ClusterRoleBinding 6 | metadata: 7 | name: consul-consul-client 8 | labels: 9 | app: consul 10 | chart: consul-helm 11 | heritage: Tiller 12 | release: consul 13 | roleRef: 14 | apiGroup: rbac.authorization.k8s.io 15 | kind: ClusterRole 16 | name: consul-consul-client 17 | subjects: 18 | - kind: ServiceAccount 19 | name: consul-consul-client 20 | namespace: default 21 | -------------------------------------------------------------------------------- /example/consul/server-clusterrolebinding.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: consul/templates/server-clusterrolebinding.yaml 3 | 4 | apiVersion: rbac.authorization.k8s.io/v1 5 | kind: ClusterRoleBinding 6 | metadata: 7 | name: consul-consul-server 8 | labels: 9 | app: consul 10 | chart: consul-helm 11 | heritage: Tiller 12 | release: consul 13 | roleRef: 14 | apiGroup: rbac.authorization.k8s.io 15 | kind: ClusterRole 16 | name: consul-consul-server 17 | subjects: 18 | - kind: ServiceAccount 19 | name: consul-consul-server 20 | namespace: default 21 | -------------------------------------------------------------------------------- /example/consul/client-config-configmap.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: consul/templates/client-config-configmap.yaml 3 | # ConfigMap with extra configuration specified directly to the chart 4 | # for client agents only. 5 | apiVersion: v1 6 | kind: ConfigMap 7 | metadata: 8 | name: consul-consul-client-config 9 | namespace: default 10 | labels: 11 | app: consul 12 | chart: consul-helm 13 | heritage: Tiller 14 | release: consul 15 | data: 16 | extra-from-values.json: |- 17 | {} 18 | 19 | central-config.json: |- 20 | { 21 | "enable_central_service_config": true 22 | } 23 | -------------------------------------------------------------------------------- /example/consul/server-acl-init-clusterrolebinding.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: consul/templates/server-acl-init-clusterrolebinding.yaml 3 | 4 | apiVersion: rbac.authorization.k8s.io/v1 5 | kind: ClusterRoleBinding 6 | metadata: 7 | name: consul-consul-server-acl-init 8 | labels: 9 | app: consul 10 | chart: consul-helm 11 | heritage: Tiller 12 | release: consul 13 | roleRef: 14 | apiGroup: rbac.authorization.k8s.io 15 | kind: ClusterRole 16 | name: consul-consul-server-acl-init 17 | subjects: 18 | - kind: ServiceAccount 19 | name: consul-consul-server-acl-init 20 | namespace: default -------------------------------------------------------------------------------- /example/consul/server-disruptionbudget.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: consul/templates/server-disruptionbudget.yaml 3 | # PodDisruptionBudget to prevent degrading the server cluster through 4 | # voluntary cluster changes. 5 | apiVersion: policy/v1beta1 6 | kind: PodDisruptionBudget 7 | metadata: 8 | name: consul-consul-server 9 | namespace: default 10 | labels: 11 | app: consul 12 | chart: consul-helm 13 | heritage: Tiller 14 | release: consul 15 | spec: 16 | maxUnavailable: 0 17 | selector: 18 | matchLabels: 19 | app: consul 20 | release: "consul" 21 | component: server 22 | -------------------------------------------------------------------------------- /example/consul/dns-service.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: consul/templates/dns-service.yaml 3 | # Service for Consul DNS. 4 | apiVersion: v1 5 | kind: Service 6 | metadata: 7 | name: consul-consul-dns 8 | namespace: default 9 | labels: 10 | app: consul 11 | chart: consul-helm 12 | heritage: Tiller 13 | release: consul 14 | spec: 15 | ports: 16 | - name: dns-tcp 17 | port: 53 18 | protocol: "TCP" 19 | targetPort: dns-tcp 20 | - name: dns-udp 21 | port: 53 22 | protocol: "UDP" 23 | targetPort: dns-udp 24 | selector: 25 | app: consul 26 | release: "consul" 27 | hasDNS: "true" 28 | -------------------------------------------------------------------------------- /example/consul/connect-inject-clusterrole.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: consul/templates/connect-inject-clusterrole.yaml 3 | # The ClusterRole to enable the Connect injector to get, list, watch and patch MutatingWebhookConfiguration. 4 | apiVersion: rbac.authorization.k8s.io/v1 5 | kind: ClusterRole 6 | metadata: 7 | name: consul-consul-connect-injector-webhook 8 | labels: 9 | app: consul 10 | chart: consul-helm 11 | heritage: Tiller 12 | release: consul 13 | rules: 14 | - apiGroups: ["admissionregistration.k8s.io"] 15 | resources: ["mutatingwebhookconfigurations"] 16 | verbs: 17 | - "get" 18 | - "list" 19 | - "watch" 20 | - "patch" 21 | -------------------------------------------------------------------------------- /example/consul/connect-inject-clusterrolebinding.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: consul/templates/connect-inject-clusterrolebinding.yaml 3 | 4 | apiVersion: rbac.authorization.k8s.io/v1 5 | kind: ClusterRoleBinding 6 | metadata: 7 | name: consul-consul-connect-injector-webhook-admin-role-binding 8 | labels: 9 | app: consul 10 | chart: consul-helm 11 | heritage: Tiller 12 | release: consul 13 | roleRef: 14 | apiGroup: rbac.authorization.k8s.io 15 | kind: ClusterRole 16 | name: consul-consul-connect-injector-webhook 17 | subjects: 18 | - kind: ServiceAccount 19 | name: consul-consul-connect-injector-webhook-svc-account 20 | namespace: default 21 | -------------------------------------------------------------------------------- /example/smi.yml: -------------------------------------------------------------------------------- 1 | # TCPRoute for Counting Service 2 | --- 3 | apiVersion: specs.smi-spec.io/v1alpha1 4 | kind: TCPRoute 5 | metadata: 6 | name: service-counting-tcp-route 7 | 8 | # TrafficTarget defines allowed routes for service-a 9 | # In this example service-b is allow to connect using 10 | # TCP 11 | --- 12 | kind: TrafficTarget 13 | apiVersion: access.smi-spec.io/v1alpha1 14 | metadata: 15 | name: service-counting-targets 16 | namespace: default 17 | destination: 18 | kind: ServiceAccount 19 | name: counting 20 | namespace: default 21 | sources: 22 | - kind: ServiceAccount 23 | name: dashboard 24 | namespace: default 25 | specs: 26 | - kind: TCPRoute 27 | name: service-counting-tcp-route 28 | -------------------------------------------------------------------------------- /example/consul/server-acl-init-clusterrole.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: consul/templates/server-acl-init-clusterrole.yaml 3 | 4 | apiVersion: rbac.authorization.k8s.io/v1 5 | kind: ClusterRole 6 | metadata: 7 | name: consul-consul-server-acl-init 8 | labels: 9 | app: consul 10 | chart: consul-helm 11 | heritage: Tiller 12 | release: consul 13 | rules: 14 | - apiGroups: [""] 15 | resources: 16 | - pods 17 | verbs: 18 | - list 19 | - apiGroups: [""] 20 | resources: 21 | - secrets 22 | verbs: 23 | - create 24 | - get 25 | - apiGroups: [""] 26 | resources: 27 | - serviceaccounts 28 | verbs: 29 | - get 30 | - apiGroups: [""] 31 | resources: 32 | - services 33 | verbs: 34 | - get -------------------------------------------------------------------------------- /example/consul/server-config-configmap.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: consul/templates/server-config-configmap.yaml 3 | # StatefulSet to run the actual Consul server cluster. 4 | apiVersion: v1 5 | kind: ConfigMap 6 | metadata: 7 | name: consul-consul-server-config 8 | namespace: default 9 | labels: 10 | app: consul 11 | chart: consul-helm 12 | heritage: Tiller 13 | release: consul 14 | data: 15 | extra-from-values.json: |- 16 | {} 17 | 18 | acl-config.json: |- 19 | { 20 | "acl": { 21 | "enabled": true, 22 | "default_policy": "deny", 23 | "down_policy": "extend-cache", 24 | "enable_token_persistence": true 25 | } 26 | } 27 | central-config.json: |- 28 | { 29 | "enable_central_service_config": true 30 | } 31 | -------------------------------------------------------------------------------- /example/consul/connect-inject-mutatingwebhook.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: consul/templates/connect-inject-mutatingwebhook.yaml 3 | # The MutatingWebhookConfiguration to enable the Connect injector. 4 | apiVersion: admissionregistration.k8s.io/v1beta1 5 | kind: MutatingWebhookConfiguration 6 | metadata: 7 | name: consul-consul-connect-injector-cfg 8 | namespace: default 9 | labels: 10 | app: consul 11 | chart: consul-helm 12 | heritage: Tiller 13 | release: consul 14 | webhooks: 15 | - name: consul-consul-connect-injector.consul.hashicorp.com 16 | clientConfig: 17 | service: 18 | name: consul-consul-connect-injector-svc 19 | namespace: default 20 | path: "/mutate" 21 | caBundle: 22 | rules: 23 | - operations: [ "CREATE" ] 24 | apiGroups: [""] 25 | apiVersions: ["v1"] 26 | resources: ["pods"] 27 | -------------------------------------------------------------------------------- /crd.yml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: apiextensions.k8s.io/v1beta1 3 | kind: CustomResourceDefinition 4 | metadata: 5 | name: traffictargets.access.smi-spec.io 6 | spec: 7 | group: access.smi-spec.io 8 | version: v1alpha1 9 | scope: Namespaced 10 | names: 11 | kind: TrafficTarget 12 | shortNames: 13 | - tt 14 | plural: traffictargets 15 | singular: traffictarget 16 | 17 | --- 18 | apiVersion: apiextensions.k8s.io/v1beta1 19 | kind: CustomResourceDefinition 20 | metadata: 21 | name: httproutegroups.specs.smi-spec.io 22 | spec: 23 | group: specs.smi-spec.io 24 | version: v1alpha1 25 | scope: Namespaced 26 | names: 27 | kind: HTTPRouteGroup 28 | shortNames: 29 | - htr 30 | plural: httproutegroups 31 | singular: httproutegroup 32 | 33 | --- 34 | apiVersion: apiextensions.k8s.io/v1beta1 35 | kind: CustomResourceDefinition 36 | metadata: 37 | name: tcproutes.specs.smi-spec.io 38 | spec: 39 | group: specs.smi-spec.io 40 | version: v1alpha1 41 | scope: Namespaced 42 | names: 43 | kind: TCPRoute 44 | shortNames: 45 | - tr 46 | plural: tcproutes 47 | singular: tcproute 48 | -------------------------------------------------------------------------------- /example/consul/connect-inject-authmethod-clusterrolebinding.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: consul/templates/connect-inject-authmethod-clusterrolebinding.yaml 3 | 4 | apiVersion: rbac.authorization.k8s.io/v1 5 | kind: ClusterRoleBinding 6 | metadata: 7 | name: consul-consul-connect-injector-authmethod-authdelegator-role-binding 8 | labels: 9 | app: consul 10 | chart: consul-helm 11 | heritage: Tiller 12 | release: consul 13 | roleRef: 14 | apiGroup: rbac.authorization.k8s.io 15 | kind: ClusterRole 16 | name: "system:auth-delegator" 17 | subjects: 18 | - kind: ServiceAccount 19 | name: consul-consul-connect-injector-authmethod-svc-account 20 | namespace: default 21 | --- 22 | apiVersion: rbac.authorization.k8s.io/v1 23 | kind: ClusterRoleBinding 24 | metadata: 25 | name: consul-consul-connect-injector-authmethod-serviceaccount-role-binding 26 | labels: 27 | app: consul 28 | chart: consul-helm 29 | heritage: Tiller 30 | release: consul 31 | roleRef: 32 | apiGroup: rbac.authorization.k8s.io 33 | kind: ClusterRole 34 | name: consul-consul-connect-injector-authmethod-role 35 | subjects: 36 | - kind: ServiceAccount 37 | name: consul-consul-connect-injector-authmethod-svc-account 38 | namespace: default 39 | -------------------------------------------------------------------------------- /scripts/helper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function cleanup() { 4 | echo "" 5 | echo "Exiting ..." 6 | 7 | # Stop the process and cleanup the pid 8 | pkill -F .pid_$1 9 | rm .pid_$1 10 | 11 | exit 0 12 | } 13 | 14 | function open_service() { 15 | kubectl port-forward --namespace=$5 --address 0.0.0.0 svc/$3 $1:$2 & echo $! > .pid_$3 16 | 17 | echo " " 18 | echo "Opening $3, To quit, press Ctrl-C" 19 | sleep 5 20 | trap "cleanup $3" SIGINT 21 | 22 | # block until we exit cleanly 23 | for number in $(seq 1000000); do 24 | sleep 2 25 | done 26 | } 27 | 28 | case "$1" in 29 | consul) 30 | CONSUL_ACL_TOKEN=$(kubectl get secret consul-consul-bootstrap-acl-token -o json | jq -r '.data.token' | base64 -d) 31 | echo "Consul ACL Token: ${CONSUL_ACL_TOKEN}" 32 | echo "Consul HTTP Address: http://localhost:18500" 33 | echo "" 34 | echo "To interact with Consul using the CLI or curl set the following environment variables" 35 | echo "export CONSUL_HTTP_ADDR=http://localhost:18500" 36 | echo "export CONSUL_HTTP_TOKEN=${CONSUL_ACL_TOKEN}" 37 | echo "" 38 | open_service 18500 8500 consul-consul-server http default 39 | ;; 40 | consul-ui) 41 | xdg-open http://$(kubectl get svc consul-consul-ui -o jsonpath="{.status.loadBalancer.ingress[0].ip}") 42 | ;; 43 | *) 44 | echo "Usage:" 45 | echo "consul - Start a proxy to the Consul server API" 46 | exit 1 47 | esac 48 | -------------------------------------------------------------------------------- /example/consul/server-acl-init-job.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: consul/templates/server-acl-init-job.yaml 3 | 4 | apiVersion: batch/v1 5 | kind: Job 6 | metadata: 7 | name: consul-consul-server-acl-init 8 | namespace: default 9 | labels: 10 | app: consul 11 | chart: consul-helm 12 | heritage: Tiller 13 | release: consul 14 | annotations: 15 | "helm.sh/hook": post-install 16 | "helm.sh/hook-weight": "0" 17 | "helm.sh/hook-delete-policy": hook-succeeded 18 | spec: 19 | template: 20 | metadata: 21 | name: consul-consul-server-acl-init 22 | labels: 23 | app: consul 24 | chart: consul-helm 25 | release: consul 26 | component: server-acl-init 27 | annotations: 28 | "consul.hashicorp.com/connect-inject": "false" 29 | spec: 30 | restartPolicy: Never 31 | serviceAccountName: consul-consul-server-acl-init 32 | containers: 33 | - name: post-install-job 34 | image: hashicorp/consul-k8s:0.8.0 35 | env: 36 | - name: NAMESPACE 37 | valueFrom: 38 | fieldRef: 39 | fieldPath: metadata.namespace 40 | command: 41 | - "/bin/sh" 42 | - "-ec" 43 | - | 44 | consul-k8s server-acl-init \ 45 | -release-name=consul \ 46 | -k8s-namespace=default \ 47 | -allow-dns=true \ 48 | -create-inject-token=true \ 49 | -acl-binding-rule-selector=serviceaccount.name!=default \ 50 | -expected-replicas=1 51 | -------------------------------------------------------------------------------- /example/consul/server-service.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: consul/templates/server-service.yaml 3 | # Headless service for Consul server DNS entries. This service should only 4 | # point to Consul servers. For access to an agent, one should assume that 5 | # the agent is installed locally on the node and the NODE_IP should be used. 6 | # If the node can't run a Consul agent, then this service can be used to 7 | # communicate directly to a server agent. 8 | apiVersion: v1 9 | kind: Service 10 | metadata: 11 | name: consul-consul-server 12 | namespace: default 13 | labels: 14 | app: consul 15 | chart: consul-helm 16 | heritage: Tiller 17 | release: consul 18 | annotations: 19 | # This must be set in addition to publishNotReadyAddresses due 20 | # to an open issue where it may not work: 21 | # https://github.com/kubernetes/kubernetes/issues/58662 22 | service.alpha.kubernetes.io/tolerate-unready-endpoints: "true" 23 | spec: 24 | clusterIP: None 25 | # We want the servers to become available even if they're not ready 26 | # since this DNS is also used for join operations. 27 | publishNotReadyAddresses: true 28 | ports: 29 | - name: http 30 | port: 8500 31 | targetPort: 8500 32 | - name: serflan-tcp 33 | protocol: "TCP" 34 | port: 8301 35 | targetPort: 8301 36 | - name: serflan-udp 37 | protocol: "UDP" 38 | port: 8301 39 | targetPort: 8301 40 | - name: serfwan-tcp 41 | protocol: "TCP" 42 | port: 8302 43 | targetPort: 8302 44 | - name: serfwan-udp 45 | protocol: "UDP" 46 | port: 8302 47 | targetPort: 8302 48 | - name: server 49 | port: 8300 50 | targetPort: 8300 51 | - name: dns-tcp 52 | protocol: "TCP" 53 | port: 8600 54 | targetPort: dns-tcp 55 | - name: dns-udp 56 | protocol: "UDP" 57 | port: 8600 58 | targetPort: dns-udp 59 | selector: 60 | app: consul 61 | release: "consul" 62 | component: server 63 | -------------------------------------------------------------------------------- /consul-smi-controller.yml: -------------------------------------------------------------------------------- 1 | --- 2 | kind: ClusterRole 3 | apiVersion: rbac.authorization.k8s.io/v1 4 | metadata: 5 | name: smi-controller 6 | labels: 7 | # Add these permissions to the "view" default role. 8 | rbac.authorization.k8s.io/aggregate-to-view: "true" 9 | rbac.authorization.k8s.io/aggregate-to-cluster-reader: "true" 10 | rules: 11 | - apiGroups: ["specs.smi-spec.io", "access.smi-spec.io",""] 12 | resources: ["tcproutes","htttproutegroups","traffictargets","events"] 13 | verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] 14 | 15 | --- 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRoleBinding 18 | metadata: 19 | name: smi-controller 20 | roleRef: 21 | apiGroup: rbac.authorization.k8s.io 22 | kind: ClusterRole 23 | name: smi-controller 24 | subjects: 25 | - kind: ServiceAccount 26 | name: smi-controller 27 | namespace: default 28 | 29 | --- 30 | apiVersion: v1 31 | kind: ServiceAccount 32 | metadata: 33 | name: smi-controller 34 | namespace: default 35 | 36 | --- 37 | apiVersion: apps/v1 38 | kind: Deployment 39 | metadata: 40 | name: consul-smi-controller-deployment 41 | labels: 42 | app: consul-smi-controller 43 | spec: 44 | replicas: 1 45 | selector: 46 | matchLabels: 47 | app: consul-smi-controller 48 | template: 49 | metadata: 50 | labels: 51 | app: consul-smi-controller 52 | spec: 53 | serviceAccountName: smi-controller 54 | automountServiceAccountToken: true 55 | containers: 56 | - name: consul-smi-controller 57 | image: hashicorp/consul-smi-controller:v0.0.0-alpha.1 58 | imagePullPolicy: IfNotPresent 59 | command: ['/app/smi-controller'] 60 | args: ["--consul-http-addr=http://$(HOST_IP):8500", "--consul-http-token=$(CONSUL_HTTP_TOKEN)"] 61 | env: 62 | - name: CONSUL_HTTP_TOKEN 63 | valueFrom: 64 | secretKeyRef: 65 | name: consul-smi-acl-token 66 | key: token 67 | - name: HOST_IP 68 | valueFrom: 69 | fieldRef: 70 | fieldPath: status.hostIP 71 | -------------------------------------------------------------------------------- /example/example-app.yml: -------------------------------------------------------------------------------- 1 | 2 | # Define a ServiceAccount for Service A 3 | --- 4 | apiVersion: v1 5 | kind: ServiceAccount 6 | metadata: 7 | name: counting 8 | automountServiceAccountToken: false 9 | 10 | # Define a ServiceAccount for Service B 11 | --- 12 | apiVersion: v1 13 | kind: ServiceAccount 14 | metadata: 15 | name: dashboard 16 | automountServiceAccountToken: false 17 | 18 | # Define public loadbalancer 19 | --- 20 | apiVersion: v1 21 | kind: Service 22 | metadata: 23 | name: counting-dashboard 24 | spec: 25 | selector: 26 | app: dashboard 27 | ports: 28 | - protocol: TCP 29 | port: 80 30 | targetPort: 9002 31 | type: LoadBalancer 32 | 33 | # Create a pod for backend service 34 | --- 35 | apiVersion: apps/v1 36 | kind: Deployment 37 | metadata: 38 | name: counting-deployment 39 | labels: 40 | app: counting 41 | spec: 42 | replicas: 3 43 | selector: 44 | matchLabels: 45 | app: counting 46 | template: 47 | metadata: 48 | name: counting 49 | labels: 50 | app: counting 51 | annotations: 52 | 'consul.hashicorp.com/connect-inject': 'true' 53 | "consul.hashicorp.com/connect-service": "counting" 54 | spec: 55 | serviceAccountName: counting 56 | automountServiceAccountToken: true 57 | containers: 58 | - name: counting 59 | image: hashicorp/counting-service:0.0.2 60 | ports: 61 | - containerPort: 9001 62 | name: http 63 | 64 | # Create a pod for frontend service 65 | --- 66 | apiVersion: apps/v1 67 | kind: Deployment 68 | metadata: 69 | name: dashboard-deployment 70 | labels: 71 | app: dashboard 72 | spec: 73 | replicas: 3 74 | selector: 75 | matchLabels: 76 | app: dashboard 77 | template: 78 | metadata: 79 | name: dashboard 80 | labels: 81 | app: 'dashboard' 82 | annotations: 83 | 'consul.hashicorp.com/connect-inject': 'true' 84 | 'consul.hashicorp.com/connect-service-upstreams': 'counting:9001' 85 | spec: 86 | serviceAccountName: dashboard 87 | automountServiceAccountToken: true 88 | containers: 89 | - name: dashboard 90 | image: hashicorp/dashboard-service:0.0.3 91 | ports: 92 | - containerPort: 9002 93 | name: http 94 | env: 95 | - name: COUNTING_SERVICE_URL 96 | value: 'http://localhost:9001' 97 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/hashicorp/consul-smi-controller 2 | 3 | go 1.12 4 | 5 | require ( 6 | cloud.google.com/go v0.41.0 // indirect 7 | github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878 // indirect 8 | github.com/deislabs/smi-sdk-go v0.0.0-20190621175932-114e91dce170 9 | github.com/evanphx/json-patch v4.5.0+incompatible // indirect 10 | github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 // indirect 11 | github.com/golang/protobuf v1.3.2 // indirect 12 | github.com/googleapis/gnostic v0.3.0 // indirect 13 | github.com/hashicorp/consul/api v1.1.0 14 | github.com/hashicorp/go-immutable-radix v1.1.0 // indirect 15 | github.com/hashicorp/go-msgpack v0.5.5 // indirect 16 | github.com/hashicorp/go-rootcerts v1.0.1 // indirect 17 | github.com/hashicorp/go-sockaddr v1.0.2 // indirect 18 | github.com/hashicorp/memberlist v0.1.4 // indirect 19 | github.com/hashicorp/serf v0.8.3 // indirect 20 | github.com/imdario/mergo v0.3.7 // indirect 21 | github.com/miekg/dns v1.1.15 // indirect 22 | github.com/onsi/ginkgo v1.8.0 // indirect 23 | github.com/onsi/gomega v1.5.0 // indirect 24 | github.com/spf13/pflag v1.0.3 // indirect 25 | github.com/stretchr/objx v0.2.0 // indirect 26 | github.com/stretchr/testify v1.3.0 27 | golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 // indirect 28 | golang.org/x/net v0.0.0-20190628185345-da137c7871d7 // indirect 29 | golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7 // indirect 30 | k8s.io/api v0.0.0-20190712022805-31fe033ae6f9 31 | k8s.io/apimachinery v0.0.0-20190715170309-6171873045ff 32 | k8s.io/client-go v11.0.0+incompatible 33 | k8s.io/klog v0.3.3 34 | k8s.io/kube-openapi v0.0.0-20190709113604-33be087ad058 // indirect 35 | k8s.io/sample-controller v0.0.0-20190713023659-499fb3ff94b9 36 | k8s.io/utils v0.0.0-20190712204705-3dccf664f023 // indirect 37 | ) 38 | 39 | replace ( 40 | golang.org/x/sync => golang.org/x/sync v0.0.0-20181108010431-42b317875d0f 41 | golang.org/x/sys => golang.org/x/sys v0.0.0-20190209173611-3b5209105503 42 | golang.org/x/tools => golang.org/x/tools v0.0.0-20190313210603-aa82965741a9 43 | k8s.io/api => k8s.io/api v0.0.0-20190425012535-181e1f9c52c1 44 | k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20190425132440-17f84483f500 45 | k8s.io/client-go => k8s.io/client-go v0.0.0-20190425172711-65184652c889 46 | k8s.io/code-generator => k8s.io/code-generator v0.0.0-20190419212335-ff26e7842f9d 47 | ) 48 | 49 | replace k8s.io/component-base => k8s.io/component-base v0.0.0-20190424053038-9fe063da3132 50 | -------------------------------------------------------------------------------- /example/consul/connect-inject-deployment.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: consul/templates/connect-inject-deployment.yaml 3 | # The deployment for running the Connect sidecar injector 4 | apiVersion: apps/v1 5 | kind: Deployment 6 | metadata: 7 | name: consul-consul-connect-injector-webhook-deployment 8 | namespace: default 9 | labels: 10 | app: consul 11 | chart: consul-helm 12 | heritage: Tiller 13 | release: consul 14 | spec: 15 | replicas: 1 16 | selector: 17 | matchLabels: 18 | app: consul 19 | chart: consul-helm 20 | release: consul 21 | component: connect-injector 22 | template: 23 | metadata: 24 | labels: 25 | app: consul 26 | chart: consul-helm 27 | release: consul 28 | component: connect-injector 29 | annotations: 30 | "consul.hashicorp.com/connect-inject": "false" 31 | spec: 32 | serviceAccountName: consul-consul-connect-injector-webhook-svc-account 33 | containers: 34 | - name: sidecar-injector 35 | image: "hashicorp/consul-k8s:0.8.1" 36 | env: 37 | - name: NAMESPACE 38 | valueFrom: 39 | fieldRef: 40 | fieldPath: metadata.namespace 41 | command: 42 | - "/bin/sh" 43 | - "-ec" 44 | - | 45 | CONSUL_FULLNAME="consul-consul" 46 | 47 | consul-k8s inject-connect \ 48 | -default-inject=false \ 49 | -consul-image="consul:1.5.0" \ 50 | -listen=:8080 \ 51 | -acl-auth-method="consul-consul-k8s-auth-method" \ 52 | -enable-central-config=true \ 53 | -tls-auto=${CONSUL_FULLNAME}-connect-injector-cfg \ 54 | -tls-auto-hosts=${CONSUL_FULLNAME}-connect-injector-svc,${CONSUL_FULLNAME}-connect-injector-svc.${NAMESPACE},${CONSUL_FULLNAME}-connect-injector-svc.${NAMESPACE}.svc 55 | livenessProbe: 56 | httpGet: 57 | path: /health/ready 58 | port: 8080 59 | scheme: HTTPS 60 | failureThreshold: 2 61 | initialDelaySeconds: 1 62 | periodSeconds: 2 63 | successThreshold: 1 64 | timeoutSeconds: 5 65 | readinessProbe: 66 | httpGet: 67 | path: /health/ready 68 | port: 8080 69 | scheme: HTTPS 70 | failureThreshold: 2 71 | initialDelaySeconds: 2 72 | periodSeconds: 2 73 | successThreshold: 1 74 | timeoutSeconds: 5 75 | -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "log" 6 | "time" 7 | 8 | kubeinformers "k8s.io/client-go/informers" 9 | "k8s.io/client-go/kubernetes" 10 | "k8s.io/client-go/tools/cache" 11 | "k8s.io/client-go/tools/clientcmd" 12 | "k8s.io/klog" 13 | "k8s.io/sample-controller/pkg/signals" 14 | 15 | // Uncomment the following line to load the gcp plugin (only required to authenticate against GKE clusters). 16 | _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" 17 | 18 | accessClientset "github.com/deislabs/smi-sdk-go/pkg/gen/client/access/clientset/versioned" 19 | accessInformers "github.com/deislabs/smi-sdk-go/pkg/gen/client/access/informers/externalversions" 20 | specsClientset "github.com/deislabs/smi-sdk-go/pkg/gen/client/specs/clientset/versioned" 21 | specsInformers "github.com/deislabs/smi-sdk-go/pkg/gen/client/specs/informers/externalversions" 22 | "github.com/hashicorp/consul-smi-controller/access" 23 | "github.com/hashicorp/consul-smi-controller/clients" 24 | ) 25 | 26 | var ( 27 | masterURL string 28 | kubeconfig string 29 | consulACLToken string 30 | consulHTTPAddr string 31 | ) 32 | 33 | func main() { 34 | flag.Parse() 35 | 36 | klog.InitFlags(nil) 37 | flag.Set("v", "3") 38 | 39 | // create the consul client 40 | consulClient, err := clients.NewConsul(consulHTTPAddr, consulACLToken) 41 | if err != nil { 42 | log.Fatal("Unable to create Consul client", err) 43 | } 44 | 45 | // set up signals so we handle the first shutdown signal gracefully 46 | stopCh := signals.SetupSignalHandler() 47 | 48 | cfg, err := clientcmd.BuildConfigFromFlags(masterURL, kubeconfig) 49 | if err != nil { 50 | klog.Fatalf("Error building kubeconfig: %s", err.Error()) 51 | } 52 | 53 | kubeClient, err := kubernetes.NewForConfig(cfg) 54 | if err != nil { 55 | klog.Fatalf("Error building kubernetes clientset: %s", err.Error()) 56 | } 57 | 58 | accessClient, err := accessClientset.NewForConfig(cfg) 59 | if err != nil { 60 | klog.Fatalf("Error building access clientset: %s", err.Error()) 61 | } 62 | 63 | specsClient, err := specsClientset.NewForConfig(cfg) 64 | if err != nil { 65 | klog.Fatalf("Error building specs clientset: %s", err.Error()) 66 | } 67 | 68 | kubeInformerFactory := kubeinformers.NewSharedInformerFactory(kubeClient, time.Second*30) 69 | accessInformerFactory := accessInformers.NewSharedInformerFactory(accessClient, time.Second*30) 70 | specsInformerFactory := specsInformers.NewSharedInformerFactory(specsClient, time.Second*30) 71 | deletedIndexer := cache.NewIndexer(cache.DeletionHandlingMetaNamespaceKeyFunc, cache.Indexers{}) 72 | 73 | controller := access.NewController( 74 | kubeClient, 75 | accessClient, 76 | accessInformerFactory.Access().V1alpha1().TrafficTargets(), 77 | deletedIndexer, 78 | consulClient, 79 | ) 80 | 81 | // notice that there is no need to run Start methods in a separate goroutine. (i.e. go kubeInformerFactory.Start(stopCh) 82 | // Start method is non-blocking and runs all registered informers in a dedicated goroutine. 83 | kubeInformerFactory.Start(stopCh) 84 | accessInformerFactory.Start(stopCh) 85 | specsInformerFactory.Start(stopCh) 86 | 87 | if err = controller.Run(1, stopCh); err != nil { 88 | klog.Fatalf("Error running controller: %s", err.Error()) 89 | } 90 | } 91 | 92 | func init() { 93 | flag.StringVar(&kubeconfig, "kubeconfig", "", "Path to a kubeconfig. Only required if out-of-cluster.") 94 | flag.StringVar(&masterURL, "master", "", "The address of the Kubernetes API server. Overrides any value in kubeconfig. Only required if out-of-cluster.") 95 | flag.StringVar(&consulACLToken, "consul-http-token", "", "ACL Token for communicating with Consul") 96 | flag.StringVar(&consulHTTPAddr, "consul-http-addr", "http://localhost:8500", "Address of the consul server, default http://localhost:8500") 97 | } 98 | -------------------------------------------------------------------------------- /clients/consul.go: -------------------------------------------------------------------------------- 1 | package clients 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/hashicorp/consul/api" 7 | "k8s.io/klog" 8 | ) 9 | 10 | // Consul defines an interface for a Consul client 11 | type Consul interface { 12 | // SyncIntetions will update the list of intentions in Consul to match 13 | // the provided source and destinations 14 | SyncIntentions(source []string, destination string) error 15 | } 16 | 17 | // ConsulImpl concrete implementation of the Consul client interface 18 | type ConsulImpl struct { 19 | client *api.Client 20 | } 21 | 22 | // NewConsul creates a new Consul client 23 | func NewConsul(httpAddr, aclToken string) (Consul, error) { 24 | conf := api.DefaultConfig() 25 | conf.Address = httpAddr 26 | conf.Token = aclToken 27 | 28 | cli, err := api.NewClient(conf) 29 | if err != nil { 30 | return nil, err 31 | } 32 | 33 | return &ConsulImpl{cli}, nil 34 | } 35 | 36 | // createIntention creates an intention in Consul 37 | func (c *ConsulImpl) createIntention(source string, destination string) error { 38 | in := api.Intention{ 39 | SourceName: source, 40 | DestinationName: destination, 41 | Action: api.IntentionActionAllow, 42 | Description: "Automatically added by K8s SMI controller", 43 | Meta: map[string]string{"CreatedBy": "SMI"}, 44 | } 45 | 46 | _, _, err := c.client.Connect().IntentionCreate(&in, nil) 47 | if err != nil { 48 | return err 49 | } 50 | 51 | return nil 52 | } 53 | 54 | // deleteIntention deletes an intention in Consul 55 | func (c *ConsulImpl) deleteIntention(id string) error { 56 | _, err := c.client.Connect().IntentionDelete(id, nil) 57 | return err 58 | } 59 | 60 | // SyncIntentions will update the list of intentions in Consul to match 61 | // the provided source and destinations 62 | func (c *ConsulImpl) SyncIntentions(source []string, destination string) error { 63 | klog.Infof("Syncing Intentions %s -> %s", source, destination) 64 | 65 | // Get a list of intentions from Consul matching the destination 66 | in, _, err := c.client.Connect().IntentionMatch( 67 | &api.IntentionMatch{ 68 | By: api.IntentionMatchDestination, 69 | Names: []string{destination}, 70 | }, 71 | &api.QueryOptions{}, 72 | ) 73 | 74 | if err != nil { 75 | return err 76 | } 77 | 78 | deleted := make([]string, 0) 79 | created := make([]string, 0) 80 | 81 | intentions := in[destination] 82 | 83 | // process deletions 84 | for _, v := range intentions { 85 | // only delete intentions when it has been created by this controller 86 | // we can use the Meta field CreatedBy=SMI to handle this 87 | if v.Meta["CreatedBy"] != "SMI" { 88 | fmt.Println("not created by SMI") 89 | continue 90 | } 91 | 92 | exists := false 93 | for _, s := range source { 94 | if v.SourceName == s && v.DestinationName == destination { 95 | exists = true 96 | break 97 | } 98 | } 99 | 100 | if !exists { 101 | deleted = append(deleted, v.ID) 102 | } 103 | } 104 | 105 | // process creations 106 | for _, s := range source { 107 | exists := false 108 | for _, v := range intentions { 109 | if v.SourceName == s && v.DestinationName == destination { 110 | exists = true 111 | break 112 | } 113 | } 114 | 115 | if !exists { 116 | created = append(created, s) 117 | } 118 | } 119 | 120 | for _, d := range deleted { 121 | klog.Infof("Deleting: %s -> %s", d, destination) 122 | if err := c.deleteIntention(d); err != nil { 123 | return err 124 | } 125 | } 126 | 127 | for _, cr := range created { 128 | klog.Infof("Creating: %s -> %s", cr, destination) 129 | if err := c.createIntention(cr, destination); err != nil { 130 | return err 131 | } 132 | } 133 | 134 | return nil 135 | } 136 | -------------------------------------------------------------------------------- /example/consul/server-statefulset.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: consul/templates/server-statefulset.yaml 3 | # StatefulSet to run the actual Consul server cluster. 4 | apiVersion: apps/v1 5 | kind: StatefulSet 6 | metadata: 7 | name: consul-consul-server 8 | namespace: default 9 | labels: 10 | app: consul 11 | chart: consul-helm 12 | heritage: Tiller 13 | release: consul 14 | spec: 15 | serviceName: consul-consul-server 16 | podManagementPolicy: Parallel 17 | replicas: 1 18 | selector: 19 | matchLabels: 20 | app: consul 21 | chart: consul-helm 22 | release: consul 23 | component: server 24 | hasDNS: "true" 25 | template: 26 | metadata: 27 | labels: 28 | app: consul 29 | chart: consul-helm 30 | release: consul 31 | component: server 32 | hasDNS: "true" 33 | annotations: 34 | "consul.hashicorp.com/connect-inject": "false" 35 | spec: 36 | affinity: 37 | podAntiAffinity: 38 | requiredDuringSchedulingIgnoredDuringExecution: 39 | - labelSelector: 40 | matchLabels: 41 | app: consul 42 | release: "consul" 43 | component: server 44 | topologyKey: kubernetes.io/hostname 45 | terminationGracePeriodSeconds: 10 46 | serviceAccountName: consul-consul-server 47 | securityContext: 48 | fsGroup: 1000 49 | volumes: 50 | - name: config 51 | configMap: 52 | name: consul-consul-server-config 53 | containers: 54 | - name: consul 55 | image: "consul:1.5.0" 56 | env: 57 | - name: POD_IP 58 | valueFrom: 59 | fieldRef: 60 | fieldPath: status.podIP 61 | - name: NAMESPACE 62 | valueFrom: 63 | fieldRef: 64 | fieldPath: metadata.namespace 65 | 66 | command: 67 | - "/bin/sh" 68 | - "-ec" 69 | - | 70 | CONSUL_FULLNAME="consul-consul" 71 | 72 | exec /bin/consul agent \ 73 | -advertise="${POD_IP}" \ 74 | -bind=0.0.0.0 \ 75 | -bootstrap-expect=1 \ 76 | -client=0.0.0.0 \ 77 | -config-dir=/consul/config \ 78 | -datacenter=dc1 \ 79 | -data-dir=/consul/data \ 80 | -domain=consul \ 81 | -hcl="connect { enabled = true }" \ 82 | -ui \ 83 | -retry-join=${CONSUL_FULLNAME}-server-0.${CONSUL_FULLNAME}-server.${NAMESPACE}.svc \ 84 | -server 85 | volumeMounts: 86 | - name: data-default 87 | mountPath: /consul/data 88 | - name: config 89 | mountPath: /consul/config 90 | lifecycle: 91 | preStop: 92 | exec: 93 | command: 94 | - /bin/sh 95 | - -c 96 | - consul leave 97 | ports: 98 | - containerPort: 8500 99 | name: http 100 | - containerPort: 8301 101 | name: serflan 102 | - containerPort: 8302 103 | name: serfwan 104 | - containerPort: 8300 105 | name: server 106 | - containerPort: 8600 107 | name: dns-tcp 108 | protocol: "TCP" 109 | - containerPort: 8600 110 | name: dns-udp 111 | protocol: "UDP" 112 | readinessProbe: 113 | # NOTE(mitchellh): when our HTTP status endpoints support the 114 | # proper status codes, we should switch to that. This is temporary. 115 | exec: 116 | command: 117 | - "/bin/sh" 118 | - "-ec" 119 | - | 120 | curl http://127.0.0.1:8500/v1/status/leader 2>/dev/null | \ 121 | grep -E '".+"' 122 | failureThreshold: 2 123 | initialDelaySeconds: 5 124 | periodSeconds: 3 125 | successThreshold: 1 126 | timeoutSeconds: 5 127 | volumeClaimTemplates: 128 | - metadata: 129 | name: data-default 130 | spec: 131 | accessModes: 132 | - ReadWriteOnce 133 | resources: 134 | requests: 135 | storage: 1Gi 136 | -------------------------------------------------------------------------------- /example/consul/client-daemonset.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: consul/templates/client-daemonset.yaml 3 | # DaemonSet to run the Consul clients on every node. 4 | apiVersion: apps/v1 5 | kind: DaemonSet 6 | metadata: 7 | name: consul-consul 8 | namespace: default 9 | labels: 10 | app: consul 11 | chart: consul-helm 12 | heritage: Tiller 13 | release: consul 14 | spec: 15 | selector: 16 | matchLabels: 17 | app: consul 18 | chart: consul-helm 19 | release: consul 20 | component: client 21 | hasDNS: "true" 22 | template: 23 | metadata: 24 | labels: 25 | app: consul 26 | chart: consul-helm 27 | release: consul 28 | component: client 29 | hasDNS: "true" 30 | annotations: 31 | "consul.hashicorp.com/connect-inject": "false" 32 | spec: 33 | terminationGracePeriodSeconds: 10 34 | serviceAccountName: consul-consul-client 35 | 36 | # Consul agents require a directory for data, even clients. The data 37 | # is okay to be wiped though if the Pod is removed, so just use an 38 | # emptyDir volume. 39 | volumes: 40 | - name: data 41 | emptyDir: {} 42 | - name: config 43 | configMap: 44 | name: consul-consul-client-config 45 | - name: aclconfig 46 | emptyDir: {} 47 | 48 | containers: 49 | - name: consul 50 | image: "consul:1.5.0" 51 | env: 52 | - name: POD_IP 53 | valueFrom: 54 | fieldRef: 55 | fieldPath: status.podIP 56 | - name: NAMESPACE 57 | valueFrom: 58 | fieldRef: 59 | fieldPath: metadata.namespace 60 | - name: NODE 61 | valueFrom: 62 | fieldRef: 63 | fieldPath: spec.nodeName 64 | 65 | command: 66 | - "/bin/sh" 67 | - "-ec" 68 | - | 69 | CONSUL_FULLNAME="consul-consul" 70 | 71 | exec /bin/consul agent \ 72 | -node="${NODE}" \ 73 | -advertise="${POD_IP}" \ 74 | -bind=0.0.0.0 \ 75 | -client=0.0.0.0 \ 76 | -hcl="ports { grpc = 8502 }" \ 77 | -config-dir=/consul/config \ 78 | -config-dir=/consul/aclconfig \ 79 | -datacenter=dc1 \ 80 | -data-dir=/consul/data \ 81 | -retry-join=${CONSUL_FULLNAME}-server-0.${CONSUL_FULLNAME}-server.${NAMESPACE}.svc \ 82 | -domain=consul 83 | volumeMounts: 84 | - name: data 85 | mountPath: /consul/data 86 | - name: config 87 | mountPath: /consul/config 88 | - name: aclconfig 89 | mountPath: /consul/aclconfig 90 | lifecycle: 91 | preStop: 92 | exec: 93 | command: 94 | - /bin/sh 95 | - -c 96 | - consul leave 97 | ports: 98 | - containerPort: 8500 99 | hostPort: 8500 100 | name: http 101 | - containerPort: 8502 102 | hostPort: 8502 103 | name: grpc 104 | - containerPort: 8301 105 | name: serflan 106 | - containerPort: 8302 107 | name: serfwan 108 | - containerPort: 8300 109 | name: server 110 | - containerPort: 8600 111 | name: dns-tcp 112 | protocol: "TCP" 113 | - containerPort: 8600 114 | name: dns-udp 115 | protocol: "UDP" 116 | readinessProbe: 117 | # NOTE(mitchellh): when our HTTP status endpoints support the 118 | # proper status codes, we should switch to that. This is temporary. 119 | exec: 120 | command: 121 | - "/bin/sh" 122 | - "-ec" 123 | - | 124 | curl http://127.0.0.1:8500/v1/status/leader 2>/dev/null | \ 125 | grep -E '".+"' 126 | initContainers: 127 | - name: client-acl-init 128 | image: hashicorp/consul-k8s:0.8.0 129 | command: 130 | - "/bin/sh" 131 | - "-ec" 132 | - | 133 | consul-k8s acl-init \ 134 | -secret-name="consul-consul-client-acl-token" \ 135 | -k8s-namespace=default \ 136 | -init-type="client" 137 | volumeMounts: 138 | - name: aclconfig 139 | mountPath: /consul/aclconfig 140 | -------------------------------------------------------------------------------- /clients/consul_test.go: -------------------------------------------------------------------------------- 1 | package clients 2 | 3 | import ( 4 | "encoding/json" 5 | "net/http" 6 | "net/http/httptest" 7 | "strings" 8 | "testing" 9 | 10 | "os" 11 | 12 | "github.com/hashicorp/consul/api" 13 | "github.com/stretchr/testify/assert" 14 | "k8s.io/klog" 15 | ) 16 | 17 | type testObjects struct { 18 | testAPIServer *httptest.Server 19 | createdIntentions []api.Intention 20 | deletedIntentions []string 21 | intentionsResponse string 22 | } 23 | 24 | func (to *testObjects) apiHandler(rw http.ResponseWriter, r *http.Request) { 25 | defer r.Body.Close() 26 | 27 | if r.URL.Path == "/v1/connect/intentions/match" { 28 | to.handleIntentionMatch(rw, r) 29 | } 30 | 31 | if strings.HasPrefix(r.URL.Path, "/v1/connect/intentions") { 32 | to.handleIntention(rw, r) 33 | } 34 | } 35 | 36 | func (to *testObjects) handleIntentionMatch(rw http.ResponseWriter, r *http.Request) { 37 | rw.Write([]byte(to.intentionsResponse)) 38 | } 39 | 40 | func (to *testObjects) handleIntention(rw http.ResponseWriter, r *http.Request) { 41 | if r.Method == http.MethodPost { 42 | i := api.Intention{} 43 | err := json.NewDecoder(r.Body).Decode(&i) 44 | if err != nil { 45 | panic(err) 46 | } 47 | 48 | to.createdIntentions = append(to.createdIntentions, i) 49 | 50 | // send the response 51 | rw.Write([]byte(`{"ID": "abc123"}`)) 52 | } 53 | 54 | if r.Method == http.MethodDelete { 55 | id := strings.Replace(r.URL.Path, "/v1/connect/intentions/", "", -1) 56 | to.deletedIntentions = append(to.deletedIntentions, id) 57 | } 58 | } 59 | 60 | func setupClient(t *testing.T, ir string) (Consul, *testObjects) { 61 | klog.SetOutput(os.Stdout) 62 | to := testObjects{ 63 | intentionsResponse: ir, 64 | createdIntentions: make([]api.Intention, 0), 65 | deletedIntentions: make([]string, 0), 66 | } 67 | 68 | to.testAPIServer = httptest.NewServer(http.HandlerFunc(to.apiHandler)) 69 | 70 | c, err := NewConsul(to.testAPIServer.URL, "") 71 | if err != nil { 72 | t.Fatal(err) 73 | } 74 | 75 | return c, &to 76 | } 77 | 78 | func TestSyncCreatesIntentions(t *testing.T) { 79 | c, to := setupClient(t, intentionsWithMeta) 80 | 81 | c.SyncIntentions([]string{"a", "d"}, "b") 82 | 83 | assert.Equal(t, 2, len(to.createdIntentions)) 84 | 85 | assert.Equal(t, "a", to.createdIntentions[0].SourceName) 86 | assert.Equal(t, "b", to.createdIntentions[0].DestinationName) 87 | assert.Equal(t, "SMI", to.createdIntentions[0].Meta["CreatedBy"]) 88 | 89 | assert.Equal(t, "d", to.createdIntentions[1].SourceName) 90 | assert.Equal(t, "b", to.createdIntentions[1].DestinationName) 91 | assert.Equal(t, "SMI", to.createdIntentions[1].Meta["CreatedBy"]) 92 | } 93 | 94 | func TestSyncDoesNotCreateIntentionWhenExists(t *testing.T) { 95 | c, to := setupClient(t, intentionsWithMeta) 96 | 97 | c.SyncIntentions([]string{"c"}, "b") 98 | 99 | assert.Equal(t, 0, len(to.createdIntentions)) 100 | } 101 | 102 | func TestSyncDeletesIntention(t *testing.T) { 103 | c, to := setupClient(t, intentionsWithMeta) 104 | 105 | c.SyncIntentions([]string{}, "b") 106 | 107 | assert.Equal(t, 2, len(to.deletedIntentions)) 108 | assert.Equal(t, "ed16f6a6-d863-1bec-af45-96bbdcbe02be", to.deletedIntentions[0]) 109 | assert.Equal(t, "e9ebc19f-d481-42b1-4871-4d298d3acd5c", to.deletedIntentions[1]) 110 | } 111 | 112 | func TestSyncDeletesIntentionHonoringMeta(t *testing.T) { 113 | c, to := setupClient(t, intentionsOnly1WithMeta) 114 | 115 | c.SyncIntentions([]string{}, "b") 116 | 117 | assert.Equal(t, 1, len(to.deletedIntentions)) 118 | assert.Equal(t, "ed16f6a6-d863-1bec-af45-96bbdcbe02be", to.deletedIntentions[0]) 119 | } 120 | 121 | var intentionsWithMeta = ` 122 | { 123 | "b": [ 124 | { 125 | "ID": "ed16f6a6-d863-1bec-af45-96bbdcbe02be", 126 | "Description": "", 127 | "SourceNS": "default", 128 | "SourceName": "c", 129 | "DestinationNS": "default", 130 | "DestinationName": "b", 131 | "SourceType": "consul", 132 | "Action": "deny", 133 | "DefaultAddr": "", 134 | "DefaultPort": 0, 135 | "Meta": {"CreatedBy":"SMI"}, 136 | "CreatedAt": "2018-05-21T16:41:33.296693825Z", 137 | "UpdatedAt": "2018-05-21T16:41:33.296694288Z", 138 | "CreateIndex": 12, 139 | "ModifyIndex": 12 140 | }, 141 | { 142 | "ID": "e9ebc19f-d481-42b1-4871-4d298d3acd5c", 143 | "Description": "", 144 | "SourceNS": "default", 145 | "SourceName": "web", 146 | "DestinationNS": "default", 147 | "DestinationName": "b", 148 | "SourceType": "consul", 149 | "Action": "allow", 150 | "DefaultAddr": "", 151 | "DefaultPort": 0, 152 | "Meta": {"CreatedBy":"SMI"}, 153 | "CreatedAt": "2018-05-21T16:41:27.977155457Z", 154 | "UpdatedAt": "2018-05-21T16:41:27.977157724Z", 155 | "CreateIndex": 11, 156 | "ModifyIndex": 11 157 | } 158 | ] 159 | } 160 | ` 161 | 162 | var intentionsOnly1WithMeta = ` 163 | { 164 | "b": [ 165 | { 166 | "ID": "ed16f6a6-d863-1bec-af45-96bbdcbe02be", 167 | "Description": "", 168 | "SourceNS": "default", 169 | "SourceName": "c", 170 | "DestinationNS": "default", 171 | "DestinationName": "b", 172 | "SourceType": "consul", 173 | "Action": "deny", 174 | "DefaultAddr": "", 175 | "DefaultPort": 0, 176 | "Meta": {"CreatedBy":"SMI"}, 177 | "CreatedAt": "2018-05-21T16:41:33.296693825Z", 178 | "UpdatedAt": "2018-05-21T16:41:33.296694288Z", 179 | "CreateIndex": 12, 180 | "ModifyIndex": 12 181 | }, 182 | { 183 | "ID": "e9ebc19f-d481-42b1-4871-4d298d3acd5c", 184 | "Description": "", 185 | "SourceNS": "default", 186 | "SourceName": "web", 187 | "DestinationNS": "default", 188 | "DestinationName": "b", 189 | "SourceType": "consul", 190 | "Action": "allow", 191 | "DefaultAddr": "", 192 | "DefaultPort": 0, 193 | "Meta": {}, 194 | "CreatedAt": "2018-05-21T16:41:27.977155457Z", 195 | "UpdatedAt": "2018-05-21T16:41:27.977157724Z", 196 | "CreateIndex": 11, 197 | "ModifyIndex": 11 198 | } 199 | ] 200 | } 201 | ` 202 | -------------------------------------------------------------------------------- /access/traffictarget_test.go: -------------------------------------------------------------------------------- 1 | package access 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | "time" 7 | 8 | accessv1alpha1 "github.com/deislabs/smi-sdk-go/pkg/apis/access/v1alpha1" 9 | "github.com/deislabs/smi-sdk-go/pkg/gen/client/access/clientset/versioned/fake" 10 | accessInformers "github.com/deislabs/smi-sdk-go/pkg/gen/client/access/informers/externalversions" 11 | "github.com/hashicorp/consul-smi-controller/clients" 12 | "github.com/stretchr/testify/assert" 13 | "github.com/stretchr/testify/mock" 14 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 15 | "k8s.io/apimachinery/pkg/runtime" 16 | "k8s.io/apimachinery/pkg/runtime/schema" 17 | fclient "k8s.io/client-go/kubernetes/fake" 18 | core "k8s.io/client-go/testing" 19 | "k8s.io/client-go/tools/cache" 20 | "k8s.io/client-go/tools/record" 21 | "k8s.io/klog" 22 | ) 23 | 24 | var () 25 | 26 | type fixtures struct { 27 | consulClient *clients.ConsulMock 28 | client *fake.Clientset 29 | kubeClient *fclient.Clientset 30 | ready chan struct{} 31 | deletedIndexer cache.Indexer 32 | controller *Controller 33 | t *testing.T 34 | // Actions expected to happen on the client 35 | actions []core.Action 36 | // Objects to put in the store 37 | trafficLister []*accessv1alpha1.TrafficTarget 38 | // Objects preloaded in NewSimpleFake 39 | objects []runtime.Object 40 | } 41 | 42 | func alwaysReady() bool { return true } 43 | 44 | func noResyncPeriod() time.Duration { return 0 } 45 | 46 | func newFixtures(t *testing.T) *fixtures { 47 | klog.SetOutput(os.Stdout) 48 | 49 | f := &fixtures{} 50 | f.t = t 51 | f.objects = []runtime.Object{} 52 | 53 | f.consulClient = &clients.ConsulMock{} 54 | f.consulClient.Mock.On("SyncIntentions", mock.Anything, mock.Anything). 55 | Return(nil) 56 | 57 | f.deletedIndexer = cache.NewIndexer(cache.DeletionHandlingMetaNamespaceKeyFunc, cache.Indexers{}) 58 | 59 | return f 60 | } 61 | 62 | // filterInformerActions filters list and watch actions for testing resources. 63 | // Since list and watch don't change resource state we can filter it to lower 64 | // nose level in our tests. 65 | func filterInformerActions(actions []core.Action) []core.Action { 66 | ret := []core.Action{} 67 | for _, action := range actions { 68 | if len(action.GetNamespace()) == 0 && 69 | (action.Matches("list", "traffictargets") || 70 | action.Matches("watch", "traffictargets") || 71 | action.Matches("list", "deployments") || 72 | action.Matches("watch", "deployments")) { 73 | continue 74 | } 75 | ret = append(ret, action) 76 | } 77 | 78 | return ret 79 | } 80 | 81 | func (f *fixtures) newController() (*Controller, accessInformers.SharedInformerFactory) { 82 | f.client = fake.NewSimpleClientset(f.objects...) 83 | f.kubeClient = fclient.NewSimpleClientset() 84 | i := accessInformers.NewSharedInformerFactory(f.client, noResyncPeriod()) 85 | 86 | c := NewController( 87 | f.kubeClient, 88 | f.client, 89 | i.Access().V1alpha1().TrafficTargets(), 90 | f.deletedIndexer, 91 | f.consulClient, 92 | ) 93 | 94 | c.targetSynced = alwaysReady 95 | c.recorder = &record.FakeRecorder{} 96 | 97 | for _, t := range f.trafficLister { 98 | i.Access().V1alpha1().TrafficTargets().Informer().GetIndexer().Add(t) 99 | } 100 | 101 | return c, i 102 | } 103 | 104 | func (f *fixtures) run(name string) { 105 | c, i := f.newController() 106 | 107 | startInformers := true 108 | expectError := false 109 | 110 | if startInformers { 111 | stopCh := make(chan struct{}) 112 | defer close(stopCh) 113 | i.Start(stopCh) 114 | } 115 | 116 | err := c.syncHandler(name) 117 | if !expectError && err != nil { 118 | f.t.Errorf("error syncing traffictarget: %v", err) 119 | } else if expectError && err == nil { 120 | f.t.Error("expected error syncing traffictarget, got nil") 121 | } 122 | 123 | actions := filterInformerActions(f.client.Actions()) 124 | for i := range actions { 125 | if len(f.actions) < i+1 { 126 | f.t.Errorf("%d unexpected actions: %+v", len(actions)-len(f.actions), actions[i:]) 127 | break 128 | } 129 | 130 | //expectedAction := f.actions[i] 131 | //checkAction(expectedAction, action, f.t) 132 | } 133 | 134 | if len(f.actions) > len(actions) { 135 | f.t.Errorf("%d additional expected actions:%+v", len(f.actions)-len(actions), f.actions[len(actions):]) 136 | } 137 | } 138 | 139 | func (f *fixtures) expectCreateTrafficTargetAction(tt *accessv1alpha1.TrafficTarget) { 140 | action := core.NewCreateAction(schema.GroupVersionResource{Resource: "traffictargets"}, tt.Namespace, tt) 141 | 142 | f.actions = append(f.actions, action) 143 | } 144 | 145 | func (f *fixtures) expectUpdateTrafficTargetAction(tt *accessv1alpha1.TrafficTarget) { 146 | action := core.NewUpdateAction(schema.GroupVersionResource{Resource: "traffictargets"}, tt.Namespace, tt) 147 | f.actions = append(f.actions, action) 148 | } 149 | 150 | func getKey(tt *accessv1alpha1.TrafficTarget, t *testing.T) string { 151 | key, err := cache.DeletionHandlingMetaNamespaceKeyFunc(tt) 152 | if err != nil { 153 | t.Errorf("Unexpected error getting key for traffictarget %v: %v", tt.Name, err) 154 | return "" 155 | } 156 | return key 157 | } 158 | 159 | func createTrafficTarget(name, source, destination string) *accessv1alpha1.TrafficTarget { 160 | return &accessv1alpha1.TrafficTarget{ 161 | TypeMeta: metav1.TypeMeta{APIVersion: accessv1alpha1.SchemeGroupVersion.String()}, 162 | ObjectMeta: metav1.ObjectMeta{ 163 | Name: name, 164 | Namespace: metav1.NamespaceDefault, 165 | }, 166 | Destination: accessv1alpha1.IdentityBindingSubject{ 167 | Kind: "ServiceAccount", 168 | Name: destination, 169 | Namespace: "default", 170 | }, 171 | Sources: []accessv1alpha1.IdentityBindingSubject{ 172 | accessv1alpha1.IdentityBindingSubject{ 173 | Kind: "ServiceAccount", 174 | Name: source, 175 | Namespace: "default", 176 | }, 177 | }, 178 | } 179 | } 180 | 181 | // Tests that the intentions are created correctly when a new TrafficTarget 182 | // is submitted 183 | func TestUpdatesIntentionsFromNewTrafficTarget(t *testing.T) { 184 | tt := createTrafficTarget("servicea-target", "serviceb", "servicea") 185 | f := newFixtures(t) 186 | f.trafficLister = append(f.trafficLister, tt) 187 | f.objects = append(f.objects, tt) 188 | 189 | // expect a traffic target to be created 190 | f.expectCreateTrafficTargetAction(tt) 191 | 192 | // start the controller 193 | f.run(getKey(tt, t)) 194 | 195 | // assert consul client was called 196 | f.consulClient.Mock.AssertCalled(t, "SyncIntentions", []string{"serviceb"}, "servicea") 197 | } 198 | 199 | // Tests that the intentions are deleted correctly when a TrafficTarget is 200 | // deleted 201 | func TestUpdatesIntentionsFromDeletedTrafficTarget(t *testing.T) { 202 | tt := createTrafficTarget("servicea-target", "serviceb", "servicea") 203 | f := newFixtures(t) 204 | f.objects = append(f.objects, tt) 205 | f.deletedIndexer.Add(tt) 206 | 207 | // start the controller 208 | f.run(getKey(tt, t)) 209 | 210 | // assert consul client was called 211 | f.consulClient.Mock.AssertCalled(t, "SyncIntentions", []string{}, "servicea") 212 | // assert the deleted object is removed from the cache 213 | _, exists, err := f.deletedIndexer.Get(tt) 214 | assert.NoError(t, err) 215 | assert.False(t, exists, "target should have been deleted from the cache") 216 | } 217 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Consul Service Mesh Interface Controller 2 | 3 | Experimental repository containing Kubernetes CRDs for the Service Mesh Interface spec (SMI) 4 | **Requires Consul 1.5.x or above** 5 | 6 | ## Service Mesh Interface 7 | Microsoft’s Service Mesh Interface is a series of Kubernetes controllers for implementing various service mesh capabilities. At launch, SMI will support four primary functions: 8 | - Traffic Specs - define traffic routing on a per-protocol basis. These resources work in unison with access control and other types of policy to manage traffic at a protocol level. 9 | - Traffic Access Control - configure access to specific pods and routes based on the identity of a client, to only allow specific users and services. 10 | - Traffic Split - direct weighted traffic between services or versions of a service, enabling Canary Testing or Dark Launches. 11 | - Traffic Metrics - expose common traffic metrics for use by tools such as dashboards and autoscalers. 12 | 13 | At launch, HashiCorp Consul will support the Traffic Access Control specification, with possible integrations for the others in the future. 14 | 15 | ## TrafficTarget CRD 16 | One of the custom resources defined by SMI is the TrafficTarget resource, developed by us in collaboration with the Microsoft team to assist with the challenge of securing service to service traffic. This resource enables the user to define Consul Connect intentions in a Kubernetes custom resource (CRD) and manage them through `kubectl`, `Helm` or `Terraform`, rather than having to configure them directly through Consul. This enables developers to ensure that newly deployed applications have a secure connection to resources through a single workflow. 17 | 18 | ## How to install 19 | To use the Consul SMI Controller, you will need to have a running Consul cluster with Connect enabled. 20 | 21 | ### Installing Consul 22 | Paying attention to the values shown below, you can use the official Consul Helm chart by cloning `https://github.com/hashicorp/consul-helm.git`. 23 | Then installing it by running `helm install -f values.yaml --name ./consul-helm`. 24 | 25 | ```yaml 26 | # Enable bootstrapping of ACLs, available in Consul 1.5.0+ 27 | global: 28 | image: "consul:1.5.0" 29 | imageK8S: "hashicorp/consul-k8s:0.8.1" 30 | 31 | bootstrapACLs: true 32 | 33 | # Enable connect in order to use Service Mesh functionality 34 | server: 35 | enabled: true 36 | replicas: 3 37 | bootstrapExpect: 3 # Should <= replicas count 38 | 39 | connect: true 40 | 41 | client: 42 | enabled: true 43 | grpc: true 44 | 45 | ui: 46 | enabled: true 47 | 48 | # Synchronize services between Kubernetes and Consul 49 | syncCatalog: 50 | enabled: true 51 | default: true 52 | toConsul: true 53 | toK8S: true 54 | syncClusterIPServices: true 55 | 56 | # ConnectInject will enable the automatic Connect sidecar injector 57 | connectInject: 58 | enabled: true 59 | default: false # true will inject by default, otherwise requires annotation. 60 | 61 | # Requires Consul v1.5+ and consul-k8s v0.8.0+. 62 | aclBindingRuleSelector: "serviceaccount.name!=default" 63 | 64 | # Enable central configuration for easier management for services and proxies. 65 | centralConfig: 66 | enabled: true 67 | ``` 68 | 69 | ### Deploying the Consul SMI Controller 70 | In order for the Consul SMI Controller to work, it needs to be able to read and write Intentions in Consul. 71 | To do this, you need to issue an ACL token with the policy *global-management* 72 | 73 | ``` 74 | consul acl token create -description "read/write access for the consul-smi-controller" -policy-name global-management 75 | ``` 76 | 77 | and copy the token that it outputs. 78 | 79 | With this token, you create a secret named `consul-smi-controller-acl-token` in Kubernetes that the Consul SMI Controller can read and use. 80 | 81 | ```yaml 82 | $ kubectl create secret generic consul-smi-acl-token --from-literal=token=[your token] 83 | ``` 84 | 85 | And then deploy the Consul SMI Controller using: 86 | 87 | ``` 88 | kubectl apply -f consul-smi-controller.yaml 89 | ``` 90 | 91 | ## How to use 92 | ### Deploying the applications 93 | Now that you have a running Consul cluster, you can deploy the applications with an annotation of `'consul.hashicorp.com/connect-inject': 'true'` and `"consul.hashicorp.com/connect-service": ""`. A sidecar proxy will automatically be injected and the service automatically registered in the service catalog of Consul. 94 | 95 | Authentication is done using Kubernetes service accounts to ensure the service is who it says it is. 96 | Lets create a service account for both the frontend and backend service. 97 | 98 | ```yaml 99 | --- 100 | apiVersion: v1 101 | kind: ServiceAccount 102 | metadata: 103 | name: counting 104 | automountServiceAccountToken: false 105 | ``` 106 | 107 | ```yaml 108 | --- 109 | apiVersion: v1 110 | kind: ServiceAccount 111 | metadata: 112 | name: dashboard 113 | automountServiceAccountToken: false 114 | ``` 115 | 116 | Then create the pods using those service accounts and adding the annotations, so the services get registered and a sidecar is injected. 117 | 118 | ```yaml 119 | --- 120 | apiVersion: v1 121 | kind: Pod 122 | metadata: 123 | name: counting 124 | labels: 125 | app: counting 126 | annotations: 127 | 'consul.hashicorp.com/connect-inject': 'true' 128 | "consul.hashicorp.com/connect-service": "counting" 129 | spec: 130 | serviceAccountName: counting 131 | automountServiceAccountToken: true 132 | containers: 133 | - name: counting 134 | image: hashicorp/counting-service:0.0.2 135 | ports: 136 | - containerPort: 9001 137 | name: http 138 | ``` 139 | 140 | ```yaml 141 | --- 142 | apiVersion: v1 143 | kind: Pod 144 | metadata: 145 | name: dashboard 146 | labels: 147 | app: dashboard 148 | annotations: 149 | 'consul.hashicorp.com/connect-inject': 'true' 150 | 'consul.hashicorp.com/connect-service-upstreams': 'counting:9001' 151 | spec: 152 | serviceAccountName: dashboard 153 | automountServiceAccountToken: true 154 | containers: 155 | - name: dashboard 156 | image: hashicorp/dashboard-service:0.0.3 157 | ports: 158 | - containerPort: 9002 159 | name: http 160 | env: 161 | - name: COUNTING_SERVICE_URL 162 | value: 'http://localhost:9001' 163 | ``` 164 | 165 | Notice how the dashboard has an upstream defined as counting:9001. This will send all traffic to localhost:9001 to the sidecar proxy of the counting service. 166 | 167 | ### Creating intentions 168 | Assuming you now have two services running in Kubernetes: a dashboard that shows the current value and a counting service that increases the count with each request. Both are configured to communicate via the Envoy sidecar proxy. 169 | 170 | By default, Consul Connect denies all traffic through the service mesh. In order for traffic from the dashboard to be able to reach the backend service, you need to define an intention that allows traffic from the dashboard to the backend service. 171 | 172 | You can create this intention using the TrafficTarget CRD below, store it as `intention.yaml` and apply it using `kubectl apply -f intention.yaml`. 173 | 174 | ```yaml 175 | # TCPRoute for Counting Service. 176 | --- 177 | apiVersion: specs.smi-spec.io/v1alpha1 178 | kind: TCPRoute 179 | metadata: 180 | name: service-counting-tcp-route 181 | ``` 182 | 183 | ```yaml 184 | # TrafficTarget defines allowed routes for counting. 185 | # In this example dashboard is allow to connect using 186 | # TCP. 187 | --- 188 | kind: TrafficTarget 189 | apiVersion: access.smi-spec.io/v1alpha1 190 | metadata: 191 | name: counting-traffic-target 192 | namespace: default 193 | destination: 194 | kind: ServiceAccount 195 | name: counting 196 | namespace: default 197 | sources: 198 | - kind: ServiceAccount 199 | name: dashboard 200 | namespace: default 201 | specs: 202 | - kind: TCPRoute 203 | name: counting-tcp-route 204 | ``` 205 | 206 | This will create an intention in Consul that allows traffic from the dashboard service to the counting service. 207 | With this intention created the dashboard will be able to show the current value retrieved from the counting backend. 208 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # SMI TrafficTarget Demo 2 | The following instructions show how to run a simple example of the SMI TrafficTarget 3 | spec on Kubernetes with HashiCorp Consul Service Mesh. 4 | 5 | ## Example Walkthrough 6 | A walkthrough of these instructions can be found at the following link: 7 | 8 | https://www.loom.com/share/6907c66621294bbea75cc021c70a89c5 9 | **password**: smisecret 10 | 11 | ## Setting up Consul 12 | To run the example Consul and the SMI controller must be running on Kuberenetes. 13 | The controller has been built to take advantage of the latest features in 14 | Consul 1.5 which integrates Consul ACL tokens with K8s service tokens. 15 | 16 | When dealing with security in a service mesh, service identity must be tightly 17 | controlled, services should only be allowed to assume the identity which has been 18 | issued to them. In the event that an individual service is compromised, the service should 19 | not be able to reconfigure itself to obtain a different service identity which allows 20 | it to bypass network security policy. 21 | 22 | Consul ACL tokens control the identity which a service can obtain, however this system 23 | is designed to work in a wider context than Kubernetes. To simplify integration when 24 | working with Kuberentes, K8s service tokens can be associated with Consul ACL tokens. 25 | 26 | When a service starts it uses the service token from the assigned K8s service account to 27 | obtain a Consul ACL token. K8s service tokens are cryptographically verifiable, before 28 | Consul issues the ACL token which can be used to obtain a service mesh identity, it 29 | validates the K8s service token with the K8s API. The name of the service account is 30 | mapped to a service identity inside of Consul, this is linked to the ACL token which is 31 | returned to the service. 32 | 33 | The service now has the ability to obtain a service mesh identity, and register itself 34 | with the Consul service catalog. 35 | 36 | All of this happens transparently when the pod starts, as long as the pod has the correct 37 | service account assigned to it, it can participate in the service mesh. 38 | 39 | ### 1. Deploy Consul to Kubernetes 40 | There is an official Helm chart for running Consul on Kuberenetes, but for convienience 41 | I have already configured the options and generated flat Kuberentes config from this chart. 42 | 43 | The following command will setup a single Consul Server instance and daemon set which runs 44 | Consul Agent on each node. Applications do not directly communicate with Consul, they do 45 | so through the local agent. The benefit of this approach is that the local agent can manage 46 | caching and load balancing to the Consul Server. Should the Consul Server fail then due 47 | to Agent caching the Service Mesh will continue to work. 48 | 49 | ```bash 50 | $ kubectl apply -f ./consul --validate=false 51 | ``` 52 | 53 | It should take about 60 seconds for the Server to be deployed and all checks to become 54 | healthy. For convenience the Consul UI has been mapped to a Public IP using a LoadBalancer. 55 | 56 | ### 2. Deploy the SMI CRDs and Controller 57 | The next step is to deploy the CRDs for the SMI spec and the SMI controller for Consul. 58 | The controller is currently available in a private repository which requires credentials 59 | to access. The `crd.yaml` file contains the credentials for the private repository and 60 | a pod spec to deploy the controller. 61 | 62 | ```bash 63 | $ kubectl apply -f ./crd.yaml 64 | ``` 65 | 66 | ### 3. Deploy the demo application 67 | The demo application is a simple two tier application consisting of a graphical 68 | dashboard and a back end service. The dashboard shows a continually incrementing count 69 | which is retrieved from the backend service. 70 | 71 | Communication between the dashboard and the counting service is passed through the 72 | service mesh. By default all service mesh traffic is set to `Deny All`. When you first 73 | load the dashboard you will see that it can not connect to the counting service. 74 | This is because we have not yet configured the TrafficTarget which creates the Consul 75 | Intentions to allow traffic between two services. 76 | 77 | ```bash 78 | $ kubectl apply -f ./example.yaml 79 | ``` 80 | 81 | The application is now setup to demo the SMI `TrafficTarget`. 82 | 83 | ### Main Demo 84 | Open the dashboard to the counting service. 85 | 86 | ```bash 87 | # Linux 88 | $ xdg-open http://$(kubectl get svc counting-dashboard -o jsonpath="{.status.loadBalancer.ingress[0].ip}") 89 | # or Mac 90 | $ open http://$(kubectl get svc counting-dashboard -o jsonpath="{.status.loadBalancer.ingress[0].ip}") 91 | ``` 92 | 93 | Explain the dashboard connects to an upstream API and that all the traffic is flowing through the service mesh. 94 | By default all service mesh traffic is denied, to allow traffic between services we need to configure 95 | the service mesh. This configuration is specific from service mesh to service mesh. The example I am showing 96 | uses the HashiCorp Consul Service Mesh. In Consul you need to define intentions to allow or deny traffic. 97 | 98 | **Open the Consul UI** and show intentions tab 99 | 100 | ```bash 101 | # Linux 102 | $ xdg-open http://$(kubectl get svc consul-consul-ui -o jsonpath="{.status.loadBalancer.ingress[0].ip}") 103 | # or Mac 104 | $ open http://$(kubectl get svc consul-consul-ui -o jsonpath="{.status.loadBalancer.ingress[0].ip}") 105 | ``` 106 | 107 | At present we do not have any intentions, so the dashboard will not be able to communicate with the upstream service, 108 | SMI defines a specification called TrafficTarget, it provides a Kubernetes centric way of managing 109 | Service Mesh security. 110 | 111 | It looks like this: 112 | 113 | ```yaml 114 | # TCPRoute for Counting Service 115 | --- 116 | apiVersion: specs.smi-spec.io/v1alpha1 117 | kind: TCPRoute 118 | metadata: 119 | name: service-counting-tcp-route 120 | 121 | # TrafficTarget defines allowed routes for service-a 122 | # In this example service-b is allow to connect using 123 | # TCP 124 | --- 125 | kind: TrafficTarget 126 | apiVersion: access.smi-spec.io/v1alpha1 127 | metadata: 128 | name: service-counting-targets 129 | namespace: default 130 | destination: 131 | kind: ServiceAccount 132 | name: counting 133 | namespace: default 134 | sources: 135 | - kind: ServiceAccount 136 | name: dashboard 137 | namespace: default 138 | specs: 139 | - kind: TCPRoute 140 | name: service-counting-tcp-route 141 | ``` 142 | 143 | When you apply this resource the controller will interpret this and make changes to the service mesh. 144 | We are stating that we would like to allow traffic from a source with identity 145 | dashboard to a destination with an identity counting. 146 | 147 | If you apply this configuration: 148 | 149 | ``` 150 | $ kubectl apply -f smi.yaml 151 | ``` 152 | 153 | You can see in the Consul UI (refresh intentions), that the TrafficTarget controller 154 | has correctly configured the Consul Service Mesh. 155 | If you reload your dashboard, everything is now working as expected as the correct 156 | security configuration has been applied. 157 | 158 | ### Notes 159 | If you delete the TrafficTarget resource the controller will correctly delete 160 | the intention, however connections are persistent between a source and destination. 161 | This is far more efficient than establishing a new connection every time and Envoy 162 | having to authorize the connection. To force the closure of a connection the easiest 163 | approach is to delete the pods (counting, dashboard) and re-create. 164 | 165 | The whole process works as Consul (Control Plane) configures Envoy (Data Plane) with a TLS certificate and client 166 | certificate. When Envoy connects to an upstream the Envoy proxy at the other end requests 167 | that the downstream sends its client certificate (standard mTLS). The upstream then 168 | validates that the certificate is signed by the same chain of trust that its own 169 | certificate is signed. This completes the authentication part of the process. 170 | Secondary to Authentication Envoy uses the SPIFFE id encoded into the client certificate 171 | and makes a call to the Control Plane requesting an Authorization check. The control 172 | plane determines if the source service is allowed to connect to the destination using 173 | the Intentions graph configured by the TrafficTarget. 174 | -------------------------------------------------------------------------------- /access/traffictarget.go: -------------------------------------------------------------------------------- 1 | package access 2 | 3 | import ( 4 | "fmt" 5 | "time" 6 | 7 | corev1 "k8s.io/api/core/v1" 8 | "k8s.io/apimachinery/pkg/api/errors" 9 | "k8s.io/apimachinery/pkg/labels" 10 | utilruntime "k8s.io/apimachinery/pkg/util/runtime" 11 | "k8s.io/apimachinery/pkg/util/wait" 12 | "k8s.io/client-go/kubernetes" 13 | "k8s.io/client-go/kubernetes/scheme" 14 | typedcorev1 "k8s.io/client-go/kubernetes/typed/core/v1" 15 | "k8s.io/client-go/tools/cache" 16 | "k8s.io/client-go/tools/record" 17 | "k8s.io/client-go/util/workqueue" 18 | "k8s.io/klog" 19 | 20 | accessv1alpha1 "github.com/deislabs/smi-sdk-go/pkg/apis/access/v1alpha1" 21 | accessClientset "github.com/deislabs/smi-sdk-go/pkg/gen/client/access/clientset/versioned" 22 | accessScheme "github.com/deislabs/smi-sdk-go/pkg/gen/client/access/clientset/versioned/scheme" 23 | accessInformers "github.com/deislabs/smi-sdk-go/pkg/gen/client/access/informers/externalversions/access/v1alpha1" 24 | accessListers "github.com/deislabs/smi-sdk-go/pkg/gen/client/access/listers/access/v1alpha1" 25 | "github.com/hashicorp/consul-smi-controller/clients" 26 | ) 27 | 28 | const controllerAgentName = "traffictarget-controller" 29 | 30 | const ( 31 | // SuccessSynced is used as part of the Event 'reason' when a TrafficTarget is synced 32 | SuccessSynced = "Synced" 33 | 34 | // ErrSyncingIntentions is used as part of the Event 'reason' when a TrafficTarget intentions can not be synced 35 | ErrSyncingIntentions = "ErrSyncingIntentions" 36 | 37 | // ErrResourceExists is used as part of the Event 'reason' when a Foo fails 38 | // to sync due to a Deployment of the same name already existing. 39 | ErrResourceExists = "ErrResourceExists" 40 | 41 | // MessageResourceExists is the message used for Events when a resource 42 | // fails to sync due to a Deployment already existing 43 | MessageResourceExists = "Resource %q already exists and is not managed by Foo" 44 | 45 | // MessageResourceSyncFailed is the message used for an Event fired when a TrafficTarget 46 | // is not synced successfully 47 | MessageResourceSyncFailed = "%s/%s synced failed: %s" 48 | 49 | // MessageResourceSynced is the message used for an Event fired when a TrafficTarget 50 | // is synced successfully 51 | MessageResourceSynced = "%s/%s synced successfully" 52 | ) 53 | 54 | // Controller is the controller implementation for Foo resources 55 | type Controller struct { 56 | // kubeClient is a standard kubernetes clientset 57 | kubeClient kubernetes.Interface 58 | // accessClient is a clientset for our own API group 59 | accessClient accessClientset.Interface 60 | 61 | targetLister accessListers.TrafficTargetLister 62 | targetSynced cache.InformerSynced 63 | 64 | // stores deleted objects 65 | deletedIndexer cache.Indexer 66 | 67 | // workqueue is a rate limited work queue. This is used to queue work to be 68 | // processed instead of performing it as soon as a change happens. This 69 | // means we can ensure we only process a fixed amount of resources at a 70 | // time, and makes it easy to ensure we are never processing the same item 71 | // simultaneously in two different workers. 72 | workqueue workqueue.RateLimitingInterface 73 | // recorder is an event recorder for recording Event resources to the 74 | // Kubernetes API. 75 | recorder record.EventRecorder 76 | // consulClient is a client for interacting with Consul 77 | consulClient clients.Consul 78 | } 79 | 80 | // NewController returns a new sample controller 81 | func NewController( 82 | kubeClient kubernetes.Interface, 83 | accessClient accessClientset.Interface, 84 | targetInformer accessInformers.TrafficTargetInformer, 85 | deletedIndexer cache.Indexer, 86 | consulClient clients.Consul) *Controller { 87 | 88 | // Create event broadcaster 89 | // Add controller types to the default Kubernetes Scheme so Events can be 90 | // logged for controller types. 91 | utilruntime.Must(accessScheme.AddToScheme(scheme.Scheme)) 92 | eventBroadcaster := record.NewBroadcaster() 93 | eventBroadcaster.StartLogging(klog.Infof) 94 | eventBroadcaster.StartRecordingToSink(&typedcorev1.EventSinkImpl{Interface: kubeClient.CoreV1().Events("")}) 95 | recorder := eventBroadcaster.NewRecorder(scheme.Scheme, corev1.EventSource{Component: controllerAgentName}) 96 | 97 | controller := &Controller{ 98 | kubeClient: kubeClient, 99 | accessClient: accessClient, 100 | targetLister: targetInformer.Lister(), 101 | targetSynced: targetInformer.Informer().HasSynced, 102 | deletedIndexer: deletedIndexer, 103 | workqueue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "TrafficTargets"), 104 | recorder: recorder, 105 | consulClient: consulClient, 106 | } 107 | 108 | klog.Info("Setting up event handlers") 109 | targetInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ 110 | AddFunc: controller.enqueueTarget, 111 | DeleteFunc: controller.enqueueDeleted, 112 | UpdateFunc: func(old, new interface{}) { 113 | if old == new { 114 | klog.Info("Skipping update, old instance is the same as the new instance") 115 | return 116 | } 117 | 118 | controller.enqueueTarget(new) 119 | }, 120 | }) 121 | 122 | return controller 123 | } 124 | 125 | func (c *Controller) enqueueTarget(obj interface{}) { 126 | var key string 127 | var err error 128 | if key, err = cache.MetaNamespaceKeyFunc(obj); err != nil { 129 | utilruntime.HandleError(err) 130 | return 131 | } 132 | 133 | c.workqueue.Add(key) 134 | } 135 | 136 | func (c *Controller) enqueueDeleted(obj interface{}) { 137 | var key string 138 | var err error 139 | if key, err = cache.DeletionHandlingMetaNamespaceKeyFunc(obj); err != nil { 140 | utilruntime.HandleError(err) 141 | return 142 | } 143 | 144 | dt, ok := obj.(*accessv1alpha1.TrafficTarget) 145 | if !ok { 146 | utilruntime.HandleError(fmt.Errorf("Unabled to enqueue deleted item, unable to cast")) 147 | return 148 | } 149 | 150 | c.deletedIndexer.Add(dt) 151 | c.workqueue.Add(key) 152 | } 153 | 154 | // Run will set up the event handlers for types we are interested in, as well 155 | // as syncing informer caches and starting workers. It will block until stopCh 156 | // is closed, at which point it will shutdown the workqueue and wait for 157 | // workers to finish processing their current work items. 158 | func (c *Controller) Run(threadiness int, stopCh <-chan struct{}) error { 159 | defer utilruntime.HandleCrash() 160 | defer c.workqueue.ShutDown() 161 | 162 | // Start the informer factories to begin populating the informer caches 163 | klog.Info("Starting controller") 164 | 165 | // Wait for the caches to be synced before starting workers 166 | klog.Info("Waiting for informer caches to sync") 167 | if ok := cache.WaitForCacheSync(stopCh, c.targetSynced); !ok { 168 | return fmt.Errorf("failed to wait for caches to sync") 169 | } 170 | 171 | klog.Infof("Starting %d workers", threadiness) 172 | // Launch n workers to process resources 173 | for i := 0; i < threadiness; i++ { 174 | go wait.Until(c.runWorker, time.Second, stopCh) 175 | } 176 | 177 | <-stopCh 178 | klog.Info("Shutting down workers") 179 | 180 | return nil 181 | } 182 | 183 | // runWorker is a long-running function that will continually call the 184 | // processNextWorkItem function in order to read and process a message on the 185 | // workqueue. 186 | func (c *Controller) runWorker() { 187 | for c.processNextWorkItem() { 188 | } 189 | } 190 | 191 | // processNextWorkItem will read a single work item off the workqueue and 192 | // attempt to process it, by calling the syncHandler. 193 | func (c *Controller) processNextWorkItem() bool { 194 | klog.Info("processNextWorkItem") 195 | 196 | obj, shutdown := c.workqueue.Get() 197 | 198 | if shutdown { 199 | return false 200 | } 201 | 202 | // We wrap this block in a func so we can defer c.workqueue.Done. 203 | err := func(obj interface{}) error { 204 | // We call Done here so the workqueue knows we have finished 205 | // processing this item. We also must remember to call Forget if we 206 | // do not want this work item being re-queued. For example, we do 207 | // not call Forget if a transient error occurs, instead the item is 208 | // put back on the workqueue and attempted again after a back-off 209 | // period. 210 | defer c.workqueue.Done(obj) 211 | var key string 212 | var ok bool 213 | // We expect strings to come off the workqueue. These are of the 214 | // form namespace/name. We do this as the delayed nature of the 215 | // workqueue means the items in the informer cache may actually be 216 | // more up to date that when the item was initially put onto the 217 | // workqueue. 218 | if key, ok = obj.(string); !ok { 219 | // As the item in the workqueue is actually invalid, we call 220 | // Forget here else we'd go into a loop of attempting to 221 | // process a work item that is invalid. 222 | c.workqueue.Forget(obj) 223 | utilruntime.HandleError(fmt.Errorf("expected string in workqueue but got %#v", obj)) 224 | return nil 225 | } 226 | // Run the syncHandler, passing it the namespace/name string of the 227 | // TrafficTarget resource to be synced. 228 | if err := c.syncHandler(key); err != nil { 229 | // Put the item back on the workqueue to handle any transient errors. 230 | c.workqueue.AddRateLimited(key) 231 | return fmt.Errorf("error syncing '%s': %s, requeuing", key, err.Error()) 232 | } 233 | 234 | // Finally, if no error occurs we Forget this item so it does not 235 | // get queued again until another change happens. 236 | c.workqueue.Forget(obj) 237 | klog.Infof("Successfully synced '%s'", key) 238 | return nil 239 | }(obj) 240 | 241 | if err != nil { 242 | utilruntime.HandleError(err) 243 | return true 244 | } 245 | 246 | return true 247 | } 248 | 249 | // syncHandler compares the actual state with the desired, and attempts to 250 | // converge the two. It then updates the Status block of the resource 251 | // with the current status of the resource. 252 | func (c *Controller) syncHandler(key string) error { 253 | // are we doing a delete? 254 | // we need to track this separately as any mutation to the 255 | // TrafficTarget changes the hash which means we can not 256 | // delete it from the cache 257 | deleteOperation := false 258 | 259 | // Convert the namespace/name string into a distinct namespace and name 260 | namespace, name, err := cache.SplitMetaNamespaceKey(key) 261 | if err != nil { 262 | return err 263 | } 264 | 265 | klog.Infof("syncHandler: key: %s name: %s", key, name) 266 | 267 | // Get the TrafficTarget resource with this namespace/name 268 | var tt *accessv1alpha1.TrafficTarget 269 | 270 | tt, err = c.targetLister.TrafficTargets(namespace).Get(name) 271 | if err != nil { 272 | // The TrafficTarget resource may no longer exist, in which case we stop 273 | // processing. 274 | if !errors.IsNotFound(err) { 275 | return err 276 | } 277 | 278 | // check to see if we have a deleted item 279 | 280 | item, exists, err := c.deletedIndexer.GetByKey(key) 281 | 282 | if !exists || err != nil { 283 | utilruntime.HandleError(fmt.Errorf("traffictarget '%s' in work queue no longer exists", key)) 284 | return nil 285 | } 286 | 287 | klog.Info("Found deleted item", item) 288 | var ok bool 289 | tt, ok = item.(*accessv1alpha1.TrafficTarget) 290 | if !ok { 291 | utilruntime.HandleError(fmt.Errorf("unable to cast '%s' to TrafficTarget", key)) 292 | c.deletedIndexer.Delete(key) 293 | return nil 294 | } 295 | 296 | deleteOperation = true 297 | } 298 | 299 | // Get all targets. 300 | allTargets, err := c.targetLister.TrafficTargets(tt.Namespace).List(labels.Everything()) 301 | if err != nil { 302 | utilruntime.HandleError(fmt.Errorf("unable to list targets: %s", err.Error())) 303 | return nil 304 | } 305 | 306 | toService := tt.Destination.Name 307 | fromServices := []string{} 308 | 309 | // Loop over the targets and if it's the same destination, add the sources. 310 | for _, t := range allTargets { 311 | if t.Destination.Name == tt.Destination.Name { 312 | for _, s := range t.Sources { 313 | fromServices = append(fromServices, s.Name) 314 | } 315 | } 316 | } 317 | 318 | klog.Infof("Syncing Intentions sources: %v, destination: %s", fromServices, toService) 319 | // Sync the current state with the desired state 320 | err = c.consulClient.SyncIntentions(fromServices, toService) 321 | if err != nil { 322 | 323 | // ignore the error settings the status, we need to return the underlying error 324 | klog.Infof("Setting status: %s", accessv1alpha1.StatusPending) 325 | c.setStatus(tt, accessv1alpha1.StatusPending) 326 | c.recorder.Event(tt, corev1.EventTypeNormal, ErrSyncingIntentions, fmt.Sprintf(MessageResourceSyncFailed, tt.Namespace, tt.Name, err.Error())) 327 | 328 | // re-add to the queue 329 | utilruntime.HandleError(fmt.Errorf("Unable to sync intentions: %s", err.Error())) 330 | return err 331 | } 332 | 333 | // So set status to created if not deleted item 334 | if deleteOperation { 335 | // get the original object using the key then delete 336 | item, _, err := c.deletedIndexer.GetByKey(key) 337 | if err != nil { 338 | utilruntime.HandleError(fmt.Errorf("unable to remove deleted item from cache: %s", err.Error())) 339 | return nil 340 | } 341 | 342 | c.deletedIndexer.Delete(item) 343 | return nil 344 | } 345 | 346 | //Not a deleted item so set the status 347 | klog.Infof("Setting status: %s", accessv1alpha1.StatusCreated) 348 | err = c.setStatus(tt, accessv1alpha1.StatusCreated) 349 | if err != nil { 350 | return err 351 | } 352 | 353 | c.recorder.Event(tt, corev1.EventTypeNormal, SuccessSynced, fmt.Sprintf(MessageResourceSynced, tt.Namespace, tt.Name)) 354 | 355 | return nil 356 | } 357 | 358 | func (c *Controller) setStatus(target *accessv1alpha1.TrafficTarget, status accessv1alpha1.Status) error { 359 | targetCopy := target.DeepCopy() 360 | targetCopy.Status = status 361 | 362 | _, err := c.accessClient.AccessV1alpha1().TrafficTargets(target.Namespace).Update(targetCopy) 363 | return err 364 | } 365 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= 2 | cloud.google.com/go v0.34.0 h1:eOI3/cP2VTU6uZLDYAoic+eyzzB9YyGmJ7eIjl8rOPg= 3 | cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= 4 | cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= 5 | cloud.google.com/go v0.41.0 h1:NFvqUTDnSNYPX5oReekmB+D+90jrJIcVImxQ3qrBVgM= 6 | cloud.google.com/go v0.41.0/go.mod h1:OauMR7DV8fzvZIl2qg6rkaIhD/vmgk4iwEw/h6ercmg= 7 | contrib.go.opencensus.io/exporter/ocagent v0.4.12/go.mod h1:450APlNTSR6FrvC3CTRqYosuDstRB9un7SOx2k/9ckA= 8 | github.com/Azure/go-autorest v11.1.2+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= 9 | github.com/Azure/go-autorest/autorest/adal v0.1.0/go.mod h1:MeS4XhScH55IST095THyTxElntu7WqB7pNbZo8Q5G3E= 10 | github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= 11 | github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= 12 | github.com/Azure/go-autorest/tracing v0.1.0/go.mod h1:ROEEAFwXycQw7Sn3DXNtEedEvdeRAgDr0izn4z5Ij88= 13 | github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= 14 | github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= 15 | github.com/DataDog/datadog-go v2.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= 16 | github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= 17 | github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= 18 | github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= 19 | github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= 20 | github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= 21 | github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= 22 | github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= 23 | github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= 24 | github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= 25 | github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da h1:8GUt8eRujhVEGZFFEjBj46YV4rDjvGrNxb0KMWYkL2I= 26 | github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= 27 | github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878 h1:EFSB7Zo9Eg91v7MJPVsifUysc/wPdN+NOnVe6bWbdBM= 28 | github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878/go.mod h1:3AMJUQhVx52RsWOnlkpikZr01T/yAVN2gn0861vByNg= 29 | github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= 30 | github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= 31 | github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= 32 | github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= 33 | github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= 34 | github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= 35 | github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= 36 | github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 37 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 38 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 39 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 40 | github.com/deislabs/smi-sdk-go v0.0.0-20190621175932-114e91dce170 h1:7DSv4db1Ra5pZDEJXgMNOCcTMCLZPm+KfhTNG/VdfOs= 41 | github.com/deislabs/smi-sdk-go v0.0.0-20190621175932-114e91dce170/go.mod h1:V6ndj+Y+b1dsvdmMBsi5Y20c01dM/TnxU5LLcxzFals= 42 | github.com/dgrijalva/jwt-go v0.0.0-20160705203006-01aeca54ebda/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= 43 | github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= 44 | github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= 45 | github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= 46 | github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= 47 | github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= 48 | github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= 49 | github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= 50 | github.com/evanphx/json-patch v0.0.0-20190203023257-5858425f7550/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= 51 | github.com/evanphx/json-patch v4.2.0+incompatible h1:fUDGZCv/7iAN7u0puUVhvKCcsR6vRfwrJatElLBEf0I= 52 | github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= 53 | github.com/evanphx/json-patch v4.5.0+incompatible h1:ouOWdg56aJriqS0huScTkVXPC5IcNrDCXZ6OoTAWu7M= 54 | github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= 55 | github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= 56 | github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= 57 | github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= 58 | github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= 59 | github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= 60 | github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= 61 | github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= 62 | github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= 63 | github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= 64 | github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= 65 | github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= 66 | github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= 67 | github.com/gogo/protobuf v0.0.0-20171007142547-342cbe0a0415 h1:WSBJMqJbLxsn+bTCPyPYZfqHdJmc8MK4wrBjMft6BAM= 68 | github.com/gogo/protobuf v0.0.0-20171007142547-342cbe0a0415/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= 69 | github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= 70 | github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= 71 | github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= 72 | github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= 73 | github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= 74 | github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903 h1:LbsanbbD6LieFkXbj9YNNBupiGHJgFeLpO0j0Fza1h8= 75 | github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 76 | github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 h1:ZgQEtGgCBiWRM39fZuwSd1LwSqqSW0hOdXCYYDX0R3I= 77 | github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 78 | github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= 79 | github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= 80 | github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= 81 | github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 82 | github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= 83 | github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 84 | github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= 85 | github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 86 | github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= 87 | github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 88 | github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= 89 | github.com/google/btree v0.0.0-20160524151835-7d79101e329e/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 90 | github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c h1:964Od4U6p2jUkFxvCydnIczKteheJEzHRToSGK3Bnlw= 91 | github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 92 | github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= 93 | github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 94 | github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 95 | github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 96 | github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= 97 | github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf h1:+RRA9JqSOZFfKrOeqr2z77+8R2RKyh8PG66dcu1V0ck= 98 | github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= 99 | github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= 100 | github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= 101 | github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= 102 | github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= 103 | github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= 104 | github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 105 | github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= 106 | github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= 107 | github.com/googleapis/gnostic v0.0.0-20170426233943-68f4ded48ba9/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= 108 | github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d h1:7XGaL1e6bYS1yIonGp9761ExpPPV1ui0SAC59Yube9k= 109 | github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= 110 | github.com/googleapis/gnostic v0.2.0 h1:l6N3VoaVzTncYYW+9yOz2LJJammFZGBO13sqgEhpy9g= 111 | github.com/googleapis/gnostic v0.2.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= 112 | github.com/googleapis/gnostic v0.3.0 h1:CcQijm0XKekKjP/YCz28LXVSpgguuB+nCxaSjCe09y0= 113 | github.com/googleapis/gnostic v0.3.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= 114 | github.com/gophercloud/gophercloud v0.0.0-20190126172459-c818fa66e4c8/go.mod h1:3WdhXV3rUYy9p6AUW8d94kr+HS62Y4VL9mBnFxsD8q4= 115 | github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= 116 | github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= 117 | github.com/gregjones/httpcache v0.0.0-20170728041850-787624de3eb7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= 118 | github.com/gregjones/httpcache v0.0.0-20190212212710-3befbb6ad0cc/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= 119 | github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= 120 | github.com/hashicorp/consul/api v1.1.0 h1:BNQPM9ytxj6jbjjdRPioQ94T6YXriSopn0i8COv6SRA= 121 | github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= 122 | github.com/hashicorp/consul/sdk v0.1.1 h1:LnuDWGNsoajlhGyHJvuWW6FVqRl8JOTPqS6CPTsYjhY= 123 | github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= 124 | github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= 125 | github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= 126 | github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= 127 | github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= 128 | github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= 129 | github.com/hashicorp/go-immutable-radix v1.0.0 h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0= 130 | github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= 131 | github.com/hashicorp/go-immutable-radix v1.1.0 h1:vN9wG1D6KG6YHRTWr8512cxGOVgTMEfgEdSj/hr8MPc= 132 | github.com/hashicorp/go-immutable-radix v1.1.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= 133 | github.com/hashicorp/go-msgpack v0.5.3 h1:zKjpN5BK/P5lMYrLmBHdBULWbJ0XpYR+7NGzqkZzoD4= 134 | github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= 135 | github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI= 136 | github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= 137 | github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= 138 | github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= 139 | github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= 140 | github.com/hashicorp/go-rootcerts v1.0.0 h1:Rqb66Oo1X/eSV1x66xbDccZjhJigjg0+e82kpwzSwCI= 141 | github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= 142 | github.com/hashicorp/go-rootcerts v1.0.1 h1:DMo4fmknnz0E0evoNYnV48RjWndOsmd6OW+09R3cEP8= 143 | github.com/hashicorp/go-rootcerts v1.0.1/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= 144 | github.com/hashicorp/go-sockaddr v1.0.0 h1:GeH6tui99pF4NJgfnhp+L6+FfobzVW3Ah46sLo0ICXs= 145 | github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= 146 | github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0SyteCQc= 147 | github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= 148 | github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= 149 | github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= 150 | github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= 151 | github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= 152 | github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= 153 | github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo= 154 | github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= 155 | github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= 156 | github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= 157 | github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= 158 | github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= 159 | github.com/hashicorp/memberlist v0.1.3 h1:EmmoJme1matNzb+hMpDuR/0sbJSUisxyqBGG676r31M= 160 | github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= 161 | github.com/hashicorp/memberlist v0.1.4 h1:gkyML/r71w3FL8gUi74Vk76avkj/9lYAY9lvg0OcoGs= 162 | github.com/hashicorp/memberlist v0.1.4/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= 163 | github.com/hashicorp/serf v0.8.2 h1:YZ7UKsJv+hKjqGVUUbtE3HNj79Eln2oQ75tniF6iPt0= 164 | github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= 165 | github.com/hashicorp/serf v0.8.3 h1:MWYcmct5EtKz0efYooPcL0yNkem+7kWxqXDi/UIh+8k= 166 | github.com/hashicorp/serf v0.8.3/go.mod h1:UpNcs7fFbpKIyZaUuSW6EPiH+eZC7OuyFD+wc1oal+k= 167 | github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= 168 | github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= 169 | github.com/imdario/mergo v0.3.5 h1:JboBksRwiiAJWvIYJVo46AfV+IAIKZpfrSzVKj42R4Q= 170 | github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= 171 | github.com/imdario/mergo v0.3.7 h1:Y+UAYTZ7gDEuOfhxKWy+dvb5dRQ6rJjFSdX2HZY1/gI= 172 | github.com/imdario/mergo v0.3.7/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= 173 | github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= 174 | github.com/json-iterator/go v0.0.0-20180701071628-ab8a2e0c74be h1:AHimNtVIpiBjPUhEF5KNCkrUyqTSA5zWUl8sQ2bfGBE= 175 | github.com/json-iterator/go v0.0.0-20180701071628-ab8a2e0c74be/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= 176 | github.com/json-iterator/go v1.1.6 h1:MrUvLMLTMxbqFJ9kzlvat/rYZqZnW3u4wkLzWTaFwKs= 177 | github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= 178 | github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= 179 | github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= 180 | github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= 181 | github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= 182 | github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= 183 | github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= 184 | github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= 185 | github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= 186 | github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= 187 | github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= 188 | github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= 189 | github.com/kubernetes-client/go v0.0.0-20190516163813-075b33afc74f/go.mod h1:ks4KCmmxdXksTSu2dlnUanEOqNd/dsoyS6/7bay2RQ8= 190 | github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= 191 | github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= 192 | github.com/mattn/go-isatty v0.0.3 h1:ns/ykhmWi7G9O+8a448SecJU3nSMBXJfqQkl0upE1jI= 193 | github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= 194 | github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= 195 | github.com/miekg/dns v1.0.14 h1:9jZdLNd/P4+SfEJ0TNyxYpsK8N4GtfylBLqtbYN1sbA= 196 | github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= 197 | github.com/miekg/dns v1.1.15 h1:CSSIDtllwGLMoA6zjdKnaE6Tx6eVUxQ29LUgGetiDCI= 198 | github.com/miekg/dns v1.1.15/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= 199 | github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= 200 | github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= 201 | github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= 202 | github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= 203 | github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= 204 | github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= 205 | github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= 206 | github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= 207 | github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= 208 | github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= 209 | github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= 210 | github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= 211 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= 212 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= 213 | github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= 214 | github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= 215 | github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= 216 | github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= 217 | github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= 218 | github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= 219 | github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 220 | github.com/onsi/ginkgo v1.6.0 h1:Ix8l273rp3QzYgXSR+c8d1fTG7UPgYkOSELPhiY/YGw= 221 | github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 222 | github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 223 | github.com/onsi/ginkgo v1.8.0 h1:VkHVNpR4iVnU8XQR6DBm8BqYjN7CRzw+xKUbVVbbW9w= 224 | github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= 225 | github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= 226 | github.com/onsi/gomega v0.0.0-20190113212917-5533ce8a0da3 h1:EooPXg51Tn+xmWPXJUGCnJhJSpeuMlBmfJVcqIRmmv8= 227 | github.com/onsi/gomega v0.0.0-20190113212917-5533ce8a0da3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= 228 | github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= 229 | github.com/onsi/gomega v1.5.0 h1:izbySO9zDPmjJ8rDjLvkA2zJHIo+HkYXHnf7eN7SSyo= 230 | github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= 231 | github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= 232 | github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c h1:Lgl0gzECD8GnQ5QCWA8o6BtfL6mDH5rQgM4/fX3avOs= 233 | github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= 234 | github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= 235 | github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= 236 | github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= 237 | github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= 238 | github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 239 | github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= 240 | github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 241 | github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 242 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 243 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 244 | github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= 245 | github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= 246 | github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= 247 | github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= 248 | github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= 249 | github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= 250 | github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= 251 | github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= 252 | github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= 253 | github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= 254 | github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= 255 | github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= 256 | github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= 257 | github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= 258 | github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= 259 | github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= 260 | github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= 261 | github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= 262 | github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= 263 | github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= 264 | github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 265 | github.com/spf13/pflag v1.0.1 h1:aCvUg6QPl3ibpQUxyLkrEkCHtPqYJL4x9AuhqVqFis4= 266 | github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 267 | github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= 268 | github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 269 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 270 | github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 271 | github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= 272 | github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= 273 | github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= 274 | github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= 275 | github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= 276 | github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= 277 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 278 | github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= 279 | go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= 280 | go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= 281 | go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= 282 | go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= 283 | golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 284 | golang.org/x/crypto v0.0.0-20181025213731-e84da0312774 h1:a4tQYYYuK9QdeO/+kEvNYyuR21S+7ve5EANok6hABhI= 285 | golang.org/x/crypto v0.0.0-20181025213731-e84da0312774/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 286 | golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 287 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= 288 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 289 | golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 290 | golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 h1:HuIa8hRrWRSrqYzx1qI49NNxhdi2PrY7gxVSq1JjLDc= 291 | golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 292 | golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 293 | golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 294 | golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= 295 | golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= 296 | golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= 297 | golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= 298 | golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= 299 | golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= 300 | golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 301 | golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 302 | golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= 303 | golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 304 | golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 305 | golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 306 | golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 307 | golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 308 | golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 309 | golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 310 | golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 311 | golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 312 | golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 313 | golang.org/x/net v0.0.0-20190206173232-65e2d4e15006 h1:bfLnR+k0tq5Lqt6dflRLcZiz6UaXCMt3vhYJ1l4FQ80= 314 | golang.org/x/net v0.0.0-20190206173232-65e2d4e15006/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 315 | golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 316 | golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 317 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 318 | golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 319 | golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c h1:uOCk1iQW6Vc18bnC13MfzScl+wdKBmM9Y9kU7Z83/lw= 320 | golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 321 | golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= 322 | golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 323 | golang.org/x/net v0.0.0-20190628185345-da137c7871d7 h1:rTIdg5QFRR7XCaK4LCjBiPbx8j4DQRpdYMnGn/bJUEU= 324 | golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 325 | golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= 326 | golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 327 | golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a h1:tImsplftrFpALCYumobsd0K86vlAs/eXGFms2txfJfA= 328 | golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 329 | golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= 330 | golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= 331 | golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ= 332 | golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 333 | golang.org/x/sys v0.0.0-20190209173611-3b5209105503 h1:5SvYFrOM3W8Mexn9/oA44Ji7vhXAZQ9hiP+1Q/DMrWg= 334 | golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 335 | golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 336 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 337 | golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 338 | golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db h1:6/JqlYfC1CCaLnGceQTI+sDGhC9UBSPAsBqI0Gun6kU= 339 | golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 340 | golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= 341 | golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 342 | golang.org/x/time v0.0.0-20161028155119-f51c12702a4d h1:TnM+PKb3ylGmZvyPXmo9m/wktg7Jn/a/fNmr33HSj8g= 343 | golang.org/x/time v0.0.0-20161028155119-f51c12702a4d/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 344 | golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 345 | golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= 346 | golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 347 | golang.org/x/tools v0.0.0-20190313210603-aa82965741a9/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 348 | gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= 349 | gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= 350 | gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= 351 | google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= 352 | google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= 353 | google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= 354 | google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= 355 | google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 356 | google.golang.org/appengine v1.5.0 h1:KxkO13IPW4Lslp2bz+KHP2E3gtFlrIGNThxkZQ3g+4c= 357 | google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 358 | google.golang.org/appengine v1.6.1 h1:QzqyMA1tlu6CgqCDUtU9V+ZKhLFT2dkJuANu5QaxI3I= 359 | google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= 360 | google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= 361 | google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 362 | google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 363 | google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 364 | google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 365 | google.golang.org/genproto v0.0.0-20190626174449-989357319d63/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= 366 | google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= 367 | google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= 368 | google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= 369 | google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= 370 | google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= 371 | gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= 372 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= 373 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 374 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 375 | gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= 376 | gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= 377 | gopkg.in/inf.v0 v0.9.0 h1:3zYtXIO92bvsdS3ggAdA8Gb4Azj0YU+TVY1uGYNFA8o= 378 | gopkg.in/inf.v0 v0.9.0/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= 379 | gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= 380 | gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= 381 | gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= 382 | gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= 383 | gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= 384 | gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= 385 | gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= 386 | gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 387 | gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= 388 | gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 389 | honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 390 | honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 391 | honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 392 | honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 393 | k8s.io/api v0.0.0-20190425012535-181e1f9c52c1 h1:VfWCVGGx0+ll/JC2oT+5ClpHdiLKLhuko1l7LKG4dh4= 394 | k8s.io/api v0.0.0-20190425012535-181e1f9c52c1/go.mod h1:AhUc3Ph6fhRc0SCpt0Hwv0E+Q8QiEAASkXKwfmT2JwU= 395 | k8s.io/apimachinery v0.0.0-20190425132440-17f84483f500 h1:WP0qwo6Cks8BJpy/B2EOUWOyuVoGEYu3x9kVpON7wTs= 396 | k8s.io/apimachinery v0.0.0-20190425132440-17f84483f500/go.mod h1:5CBnzrKYGHzv9ZsSKmQ8wHt4XI4/TUBPDwYM9FlZMyw= 397 | k8s.io/client-go v0.0.0-20190425172711-65184652c889 h1:pWRBXbVKnn/NYm4uGk3If9XmXaaWxwJ9J+fSok8LmME= 398 | k8s.io/client-go v0.0.0-20190425172711-65184652c889/go.mod h1:PeVFCnjeDy6EwLN+wdDIZd1DwDY6jnkpQt9psMo5YRU= 399 | k8s.io/code-generator v0.0.0-20190419212335-ff26e7842f9d/go.mod h1:rVrFWfTVftGH7bb972nWC6N4QkJ4LU7FOXu8GH2UkJo= 400 | k8s.io/gengo v0.0.0-20190116091435-f8a0810f38af/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= 401 | k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= 402 | k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= 403 | k8s.io/klog v0.3.0 h1:0VPpR+sizsiivjIfIAQH/rl8tan6jvWkS7lU+0di3lE= 404 | k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= 405 | k8s.io/klog v0.3.1/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= 406 | k8s.io/klog v0.3.2/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= 407 | k8s.io/klog v0.3.3 h1:niceAagH1tzskmaie/icWd7ci1wbG7Bf2c6YGcQv+3c= 408 | k8s.io/klog v0.3.3/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= 409 | k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30 h1:TRb4wNWoBVrH9plmkp2q86FIDppkbrEXdXlxU3a3BMI= 410 | k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= 411 | k8s.io/kube-openapi v0.0.0-20190502190224-411b2483e503 h1:IrnrEIp9du1SngrzGC1fdYEdos7Il6I6EVxwFQHJwCg= 412 | k8s.io/kube-openapi v0.0.0-20190502190224-411b2483e503/go.mod h1:iU+ZGYsNlvU9XKUSso6SQfKTCCw7lFduMZy26Mgr2Fw= 413 | k8s.io/kube-openapi v0.0.0-20190709113604-33be087ad058 h1:di3XCwddOR9cWBNpfgXaskhh6cgJuwcK54rvtwUaC10= 414 | k8s.io/kube-openapi v0.0.0-20190709113604-33be087ad058/go.mod h1:nfDlWeOsu3pUf4yWGL+ERqohP4YsZcBJXWMK+gkzOA4= 415 | k8s.io/sample-controller v0.0.0-20190713023659-499fb3ff94b9 h1:7caAzwYvKUAm0GG0SEtcysjcgVfr8oZ8C8PMDl9GuBc= 416 | k8s.io/sample-controller v0.0.0-20190713023659-499fb3ff94b9/go.mod h1:fwo8ase3A1Jv3UDf+BVRbU6Q+gMsDZw07tGoS3wfdMI= 417 | k8s.io/utils v0.0.0-20190221042446-c2654d5206da h1:ElyM7RPonbKnQqOcw7dG2IK5uvQQn3b/WPHqD5mBvP4= 418 | k8s.io/utils v0.0.0-20190221042446-c2654d5206da/go.mod h1:8k8uAuAQ0rXslZKaEWd0c3oVhZz7sSzSiPnVZayjIX0= 419 | k8s.io/utils v0.0.0-20190506122338-8fab8cb257d5 h1:VBM/0P5TWxwk+Nw6Z+lAw3DKgO76g90ETOiA6rfLV1Y= 420 | k8s.io/utils v0.0.0-20190506122338-8fab8cb257d5/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= 421 | k8s.io/utils v0.0.0-20190712204705-3dccf664f023 h1:1H4Jyzb0z2X0GfBMTwRjnt5ejffRHrGftUgJcV/ZfDc= 422 | k8s.io/utils v0.0.0-20190712204705-3dccf664f023/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= 423 | modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= 424 | modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= 425 | modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= 426 | modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= 427 | modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= 428 | rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= 429 | sigs.k8s.io/structured-merge-diff v0.0.0-20190426204423-ea680f03cc65/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= 430 | sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= 431 | sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= 432 | sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= 433 | --------------------------------------------------------------------------------