diff --git a/docker/k8s/vtctlclient/Dockerfile b/docker/k8s/vtctlclient/Dockerfile new file mode 100644 index 00000000000..0cf4956691d --- /dev/null +++ b/docker/k8s/vtctlclient/Dockerfile @@ -0,0 +1,32 @@ +# Copyright 2019 The Vitess Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM vitess/k8s AS k8s + +FROM debian:stretch-slim + +RUN apt-get update && \ + apt-get upgrade -qq && \ + apt-get install jq -qq --no-install-recommends && \ + apt-get autoremove && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +COPY --from=k8s /vt/bin/vtctlclient /usr/bin/ + +# add vitess user/group and add permissions +RUN groupadd -r --gid 2000 vitess && \ + useradd -r -g vitess --uid 1000 vitess + +CMD ["/usr/bin/vtctlclient"] diff --git a/examples/helm/kvtctld.sh b/examples/helm/kvtctld.sh new file mode 100644 index 00000000000..2499e706301 --- /dev/null +++ b/examples/helm/kvtctld.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# Copyright 2019 The Vitess Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This is a convenience script to run vtctlclient against the local example. + +xdg-open "$(minikube service vtctld --url|head -n 1)" diff --git a/examples/kubernetes/etcd-down.sh b/examples/kubernetes/etcd-down.sh new file mode 100644 index 00000000000..3aef6636bd7 --- /dev/null +++ b/examples/kubernetes/etcd-down.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# Copyright 2019 The Vitess Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This is an example script that tears down the etcd servers started by +# etcd-up.sh. + +set -e + +script_root=`dirname "${BASH_SOURCE}"` +source $script_root/env.sh + +replicas=${ETCD_REPLICAS:-3} +cells=`echo $CELLS | tr ',' ' '` + +# Delete etcd clusters +for cell in 'global' $cells; do + echo "Stopping etcd cluster for $cell cell..." + sed -e "s/{{cell}}/$cell/g" -e "s/{{replicas}}/$replicas/g" \ + etcd-service-template.yaml | \ + $KUBECTL $KUBECTL_OPTIONS delete -f - +done diff --git a/go/vt/vttablet/tabletserver/tabletserver.go b/go/vt/vttablet/tabletserver/tabletserver.go index ca14f0b1256..8048a2cebcd 100644 --- a/go/vt/vttablet/tabletserver/tabletserver.go +++ b/go/vt/vttablet/tabletserver/tabletserver.go @@ -286,7 +286,7 @@ func NewTabletServer(config tabletenv.TabletConfig, topoServer *topo.Server, ali // So that vtcombo doesn't even call it once, on the first tablet. // And we can remove the tsOnce variable. tsOnce.Do(func() { - srvTopoServer = srvtopo.NewResilientServer(topoServer, "TabletSrvTopo", true) + srvTopoServer = srvtopo.NewResilientServer(topoServer, "TabletSrvTopo") stats.NewGaugeFunc("TabletState", "Tablet server state", func() int64 { tsv.mu.Lock() state := tsv.state diff --git a/go/vt/vttablet/tabletserver/vstreamer/planbuilder.go b/go/vt/vttablet/tabletserver/vstreamer/planbuilder.go index 8015b9dfa9c..8e8f211cde3 100644 --- a/go/vt/vttablet/tabletserver/vstreamer/planbuilder.go +++ b/go/vt/vttablet/tabletserver/vstreamer/planbuilder.go @@ -138,13 +138,6 @@ func mustSendStmt(query mysql.Query, dbname string) bool { return true } -func mustSendStmt(query mysql.Query, dbname string) bool { - if query.Database != "" && query.Database != dbname { - return false - } - return true -} - func mustSendDDL(query mysql.Query, dbname string, filter *binlogdatapb.Filter) bool { if query.Database != "" && query.Database != dbname { return false