Compare commits

..
21 Commits
Author SHA1 Message Date
Marc CARRE d8222d76d9 Add release v2.0.1 2017-06-29 10:58:27 +01:00
Marc Carré 88a3b41135 Merge pull request #3045 from weaveworks/fix-v2-plugin-release
net-plugin release: swap publish and plugin_publish
2017-06-28 17:32:27 +01:00
Marc Carré fb7aa9298d Merge pull request #3044 from weaveworks/check-disco-blank-token
Don't contact peer discovery back-end unless we have a token
2017-06-28 17:30:03 +01:00
Marc Carré b79cc948b3 Merge pull request #3043 from weaveworks/issues/fastdp-enosupport-fallback
Fix fallback to pcap based bridge when odp is not supported
2017-06-28 17:25:45 +01:00
Marc CARRE e7092612a9 Swap publish and plugin_publish.
Currently our `Makefile` and `bin/release` scripts are such that we effectively do the following when releasing:
```
publish:
  for arch in [amd64 arm arm64]:
    sub-publish:
      clean_bin
      publish
plugin_publish
```
which leads the Docker v2 plugin to contain `arm64` binaries even though we target `amd64`.
Swaping `publish` and `plugin_publish` is a simple way to avoid this.
2017-06-28 17:16:53 +01:00
Bryan Boreham 15c512388d Don't contact peer discovery back-end unless we have a token 2017-06-28 13:34:49 +00:00
Martynas Pumputis f37377264b Fix fallback to pcap based bridge when odp is not supported
The fix ensures that if odp is not supported (usually due to
missing openvswitch, vxlan or vport-vxlan kernel modules),
weaver will create the pcap based bridge instead of crashing.
2017-06-27 18:38:21 +02:00
Bryan Boreham bd44b20b4a Merge pull request #3039 from weaveworks/do-not-merge-args
No longer merge proxy and remaining args
2017-06-27 15:17:39 +01:00
Bryan Boreham e25da3c619 Merge pull request #3042 from weaveworks/latest-yaml-from-launch-generator
Update YAMLs to be what the Launch Generator serves.
2017-06-27 14:58:41 +01:00
Bryan Boreham 3499dbfe09 Merge branch '2.0' 2017-06-27 10:48:05 +00:00
Marc CARRE 81c4a0ffce Temporarily increase tests' timeout. 2017-06-27 10:23:36 +01:00
Marc CARRE a0064f7535 Update YAMLs to be what the Launch Generator serves.
See also:
- https://github.com/weaveworks/launch-generator/issues/133
- https://github.com/weaveworks/launch-generator/pull/134

Command used:
```
$ curl -fsSo prog/weave-kube/weave-daemonset-k8s-1.6.yaml "http://localhost:8080/k8s/v1.6/net?v=latest"
$ curl -fsSo prog/weave-kube/weave-daemonset.yaml "http://localhost:8080/k8s/v1.5/net?v=latest"
```
Annotations then removed.
2017-06-26 17:54:17 +01:00
Marc Carré 79c9eff2b9 Merge pull request #3033 from weaveworks/put-namespace-back-in-yaml
Put kube-system namespace back in the weave-kube yaml
2017-06-26 15:09:18 +01:00
Marc CARRE b8bcf0c87d No longer merge proxy and remaining args.
`proxy_parse_args` is currently called:

- once, all the time
- again, if Docker is configured with TLS.

If a second call to `proxy_parse_args` happens, given the way we append to `PROXY_ARGS` and merge proxy and remaining args, genuine arguments like peers can be mixed with flags/options/etc. hence forming an invalid peers list and crashing Weave Net.
2017-06-26 14:54:04 +01:00
Matthias Radestock 179a560e1d Merge branch '2.0' 2017-06-25 21:17:41 +01:00
Matthias Radestock 2245bd25e9 Merge pull request #3036 from weaveworks/3035-remove-proxyplugin-remnants
remove weave{proxy,plugin} remnants

Fixes #3035.
2017-06-25 21:09:27 +01:00
Matthias Radestock c256daceb0 don't panic when TestMain is invoked as a regular test
Just no-op instead.

This change is necessary because previously a recent build-tools
change no longer excludes prog/* from unit testing since other
projects actually do have genuine tests under there.
2017-06-25 20:49:19 +01:00
Matthias Radestock 73b29050b9 update tools to weaveplugin-free version 2017-06-25 20:49:19 +01:00
Matthias Radestock 162da63522 remove remnants of the weaveproxy and weaveplugin containers 2017-06-25 18:42:48 +01:00
Bryan Boreham 01194ee267 Use weaveworks nettest image instead of nginx in plugin test
so we can ensure it has 'ping' in it
2017-06-25 14:52:27 +00:00
Bryan Boreham d958cff58e Put kube-system namespace back in the weave-kube yaml
Save people getting in to trouble when they don't know to add `-n kube-system`
2017-06-23 16:07:55 +00:00
18 changed files with 60 additions and 67 deletions

No files matched your search

-2
View File
@@ -37,7 +37,6 @@ coverage.html
prog/weaver/weaver
prog/weavedns/weavedns
prog/weavehosts/weavehosts
prog/weaveproxy/weaveproxy
prog/sigproxy/sigproxy
prog/weavewait/weavewait
prog/weavewait/weavewait_noop
@@ -55,7 +54,6 @@ releases
weave*.tar.gz
prog/weaver/weave
prog/weaveexec/weavehosts
prog/weaveexec/weaveproxy
prog/weaveexec/weavewait
prog/weaveexec/weavewait_noop
prog/weaveexec/weavewait_nomcast
+13
View File
@@ -1,3 +1,16 @@
## Release 2.0.1
Bug fixes and minor improvements
* Fall back to slower data path (`sleeve`), rather than crashing, when the machine lacks VXLAN support (required for “fast data path”, `fastdp`) #3043
* Fix bug in processing of arguments when Docker has TLS enabled, rather than crashing with invalid peers list, e.g. `lookup --tlsverify: no such host` #3039
* Add `kube-system` namespace back to `weave-kube`'s YAMLs, preventing omissions leading to errors like `error contacting APIServer: the server does not allow access to the requested resource` #3033,#3042
* Fix release script to prevent ARM64 binaries to end up in AMD64 `net-plugin`, leading to `Error response from daemon: dial unix /run/docker/plugins/<id>/weave.sock: connect: no such file or directory` when installing `net-plugin` #3045
* `weave reset` and `weave rmpeer` now only contact Weave Cloud when Weave Net is configured with a Weave Cloud token, preventing unnecessary requests and potentially confusing `401 Unauthorized` errors in Weave Net’s logs #3044
[Full list of changes](https://github.com/weaveworks/weave/milestone/58?closed=1).
## Release 2.0.0
New Features
+8 -8
View File
@@ -187,14 +187,14 @@ publish() {
fi
if [ "$RELEASE_TYPE" = 'PRERELEASE' ] ; then
echo "== Tagging and pushing images on docker hub as user $DOCKERHUB_USER"
make UPDATE_LATEST=$IS_MAINLINE SUDO=$SUDO WEAVE_VERSION=$VERSION DOCKERHUB_USER=$DOCKERHUB_USER publish
echo "** Docker images tagged and pushed"
echo "== Building and pushing plugin"
make UPDATE_LATEST=$IS_MAINLINE SUDO=$SUDO WEAVE_VERSION=$VERSION DOCKERHUB_USER=$DOCKERHUB_USER plugin_publish
echo "** Plugin built and pushed"
echo "== Tagging and pushing images on docker hub as user $DOCKERHUB_USER"
make UPDATE_LATEST=$IS_MAINLINE SUDO=$SUDO WEAVE_VERSION=$VERSION DOCKERHUB_USER=$DOCKERHUB_USER publish
echo "** Docker images tagged and pushed"
echo "== Publishing pre-release on GitHub"
github-release publish \
@@ -223,14 +223,14 @@ publish() {
fi
echo '** Sanity checks OK for publishing tag' $LATEST_TAG as $DOCKERHUB_USER/weave:$VERSION
echo "== Tagging and pushing images on docker hub as user $DOCKERHUB_USER"
make PUBLISH_WEAVEDB=$IS_MAINLINE UPDATE_LATEST=$IS_MAINLINE SUDO=$SUDO WEAVE_VERSION=$VERSION DOCKERHUB_USER=$DOCKERHUB_USER publish
echo "** Docker images tagged and pushed"
echo "== Building and pushing plugin"
make UPDATE_LATEST=$IS_MAINLINE SUDO=$SUDO WEAVE_VERSION=$VERSION DOCKERHUB_USER=$DOCKERHUB_USER plugin_publish
echo "** Plugin built and pushed"
echo "== Tagging and pushing images on docker hub as user $DOCKERHUB_USER"
make PUBLISH_WEAVEDB=$IS_MAINLINE UPDATE_LATEST=$IS_MAINLINE SUDO=$SUDO WEAVE_VERSION=$VERSION DOCKERHUB_USER=$DOCKERHUB_USER publish
echo "** Docker images tagged and pushed"
echo "== Publishing release on GitHub"
github-release publish \
+12 -6
View File
@@ -62,7 +62,8 @@ type Bridge interface {
String() string // human-readable type string
}
var errBridgeFallback = errors.New("special error value used to trigger a fallback to bridge type")
// Used to indicate a fallback to the Bridge type
var errBridgeNotSupported = errors.New("bridge not supported")
type bridgeImpl struct{ bridge netlink.Link }
type fastdpImpl struct{ datapathName string }
@@ -226,7 +227,7 @@ func (config *BridgeConfig) configuredBridgeType() Bridge {
}
}
func EnsureBridge(procPath string, config *BridgeConfig) (Bridge, error) {
func EnsureBridge(procPath string, config *BridgeConfig, log *logrus.Logger) (Bridge, error) {
bridgeType, err := ExistingBridgeType(config.WeaveBridgeName, config.DatapathName)
if bridgeType != nil || err != nil {
return bridgeType, err
@@ -235,7 +236,8 @@ func EnsureBridge(procPath string, config *BridgeConfig) (Bridge, error) {
bridgeType = config.configuredBridgeType()
for {
if err := bridgeType.init(config); err != nil {
if err == errBridgeFallback {
if errors.Cause(err) == errBridgeNotSupported {
log.Warnf("Skipping bridge creation of %q due to: %s", bridgeType, err)
bridgeType = bridgeImpl{}
continue
}
@@ -333,12 +335,16 @@ func (b bridgeImpl) init(config *BridgeConfig) error {
func (f fastdpImpl) init(config *BridgeConfig) error {
odpSupported, err := odp.CreateDatapath(f.datapathName)
if !odpSupported {
msg := ""
if err != nil {
msg = err.Error()
}
return errors.Wrap(errBridgeNotSupported, msg)
}
if err != nil {
return errors.Wrapf(err, "creating datapath %q", f.datapathName)
}
if !odpSupported {
return errBridgeFallback
}
datapath, err := netlink.LinkByName(f.datapathName)
if err != nil {
return errors.Wrapf(err, "finding datapath %q", f.datapathName)
@@ -7,6 +7,7 @@ items:
name: weave-net
labels:
name: weave-net
namespace: kube-system
- apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
@@ -52,6 +53,7 @@ items:
name: weave-net
labels:
name: weave-net
namespace: kube-system
spec:
template:
metadata:
+2
View File
@@ -7,12 +7,14 @@ items:
name: weave-net
labels:
name: weave-net
namespace: kube-system
- apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: weave-net
labels:
name: weave-net
namespace: kube-system
spec:
template:
metadata:
+2 -2
View File
@@ -77,7 +77,7 @@ func peerDiscoveryDelete(discoveryEndpoint, token, peername string) error {
func HandleHTTPPeer(router *mux.Router, alloc *ipam.Allocator, discoveryEndpoint, token, peername string) {
router.Methods("DELETE").Path("/peer").HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if discoveryEndpoint != "" {
if discoveryEndpoint != "" && token != "" {
if err := peerDiscoveryDelete(discoveryEndpoint, token, peername); err != nil {
Log.Errorf("Error while deleting self from peer discovery: %s", err)
}
@@ -90,7 +90,7 @@ func HandleHTTPPeer(router *mux.Router, alloc *ipam.Allocator, discoveryEndpoint
router.Methods("DELETE").Path("/peer/{id}").HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
ident := mux.Vars(r)["id"]
if discoveryEndpoint != "" {
if discoveryEndpoint != "" && token != "" {
// TODO: deal with this being either a peername or a nickname
if err := peerDiscoveryDelete(discoveryEndpoint, token, ident); err != nil {
Log.Errorf("Error while deleting self from peer discovery: %s", err)
+1 -1
View File
@@ -282,7 +282,7 @@ func main() {
name := peerName(routerName, bridgeConfig.WeaveBridgeName, dbPrefix, hostRoot)
bridgeConfig.Mac = name.String()
bridgeType, err := weavenet.EnsureBridge(procPath, &bridgeConfig)
bridgeType, err := weavenet.EnsureBridge(procPath, &bridgeConfig, Log)
checkFatal(err)
Log.Println("Bridge type is", bridgeType)
+3 -2
View File
@@ -7,6 +7,7 @@ import (
)
func TestMain(t *testing.T) {
weavetest.TrimTestArgs()
main()
if weavetest.TrimTestArgs() {
main()
}
}
+2 -1
View File
@@ -4,6 +4,7 @@ import (
"fmt"
"strconv"
"github.com/weaveworks/weave/common"
weavenet "github.com/weaveworks/weave/net"
)
@@ -47,7 +48,7 @@ func createBridge(args []string) error {
NPC: args[9] == "--expect-npc",
}
procPath := args[8]
bridgeType, err := weavenet.EnsureBridge(procPath, &config)
bridgeType, err := weavenet.EnsureBridge(procPath, &config, common.Log)
if err != nil {
return err
}
@@ -1,28 +0,0 @@
---
title: Troubleshooting
menu_order: 60
search_type: Documentation
---
The command
weave status
reports on the current status of various Weave Net components, including
the proxy, if it is running:
```
...
Service: proxy
Address: tcp://127.0.0.1:12375
...
```
Information on the operation of the proxy can be obtained from the
weaveproxy container logs using:
docker logs weaveproxy
**See Also**
* [Troubleshooting Weave](/site/troubleshooting.md)
+1 -1
View File
@@ -12,7 +12,7 @@ assert_raises "check_restart $HOST1 weave"
# in the old containers being removed and new ones created
weave_on $HOST1 stop
weave_on $HOST1 launch --no-restart
assert "docker_on $HOST1 inspect -f '{{.HostConfig.RestartPolicy.Name}}' weave weaveproxy" "no"
assert "docker_on $HOST1 inspect -f '{{.HostConfig.RestartPolicy.Name}}' weave" "no"
assert_raises "! check_restart $HOST1 weave"
# Relaunch to prevent the `weave stop` in `end_suite`
+1 -1
View File
@@ -108,7 +108,7 @@ $SSH $HOST1<<EOF
docker network create --driver="${PLUGIN_NAME}:latest" $NETWORK || true
# Otherwise no containers will be scheduled on host2
sleep 20
docker service create --name=$SERVICE --network=$NETWORK --replicas=2 nginx || true
docker service create --name=$SERVICE --network=$NETWORK --replicas=2 weaveworks/network-tester:latest || true
journalctl -r -u docker.service -n30
EOF
+2 -5
View File
@@ -136,9 +136,7 @@ stop_weave_on() {
host=$1
weave_on $host stop 1>/dev/null 2>&1 || true
if [ -n "$COVERAGE" ]; then
for C in weaveplugin weave ; do
collect_coverage $host $C
done
collect_coverage $host weave
fi
}
@@ -322,8 +320,7 @@ check_restart() {
start_suite() {
for host in $HOSTS; do
[ -z "$DEBUG" ] || echo "Cleaning up on $host: removing all containers and resetting weave"
PLUGIN_FILTER=$(docker_on $host inspect -f 'grep -v {{printf "%.12s" .Id}}' weaveplugin 2>/dev/null) || PLUGIN_FILTER=cat
rm_containers $host $(docker_on $host ps -aq 2>/dev/null | $PLUGIN_FILTER)
rm_containers $host $(docker_on $host ps -aq 2>/dev/null)
weave_on $host reset 2>/dev/null
run_on $host sudo rm -f /opt/cni/bin/weave-plugin-latest /opt/cni/bin/weave-net /opt/cni/bin/weave-ipam /etc/cni/net.d/10-weave.conf
done
+1 -1
View File
@@ -23,4 +23,4 @@ if [ -n "$CIRCLECI" -o -n "$PARALLEL" ]; then
RUNNER_ARGS="$RUNNER_ARGS -parallel"
fi
HOSTS="$HOSTS" "${DIR}/../tools/runner/runner" $RUNNER_ARGS $TESTS
HOSTS="$HOSTS" "${DIR}/../tools/runner/runner" -timeout=240 $RUNNER_ARGS $TESTS
+5 -3
View File
@@ -35,8 +35,9 @@ func stackTrace(all bool) string {
return string(buf[:stacklen])
}
// TrimTestArgs finds the first -- in os.Args and trim all args before that
func TrimTestArgs() {
// TrimTestArgs finds the first -- in os.Args and trim all args before
// that, returning true when a -- was in fact found.
func TrimTestArgs() bool {
i, l := 0, len(os.Args)
for ; i < l; i++ {
if os.Args[i] == "--" {
@@ -44,7 +45,8 @@ func TrimTestArgs() {
}
}
if i == l {
panic("Specify weave args after --")
return false
}
os.Args = append(os.Args[:1], os.Args[i+1:l]...)
return true
}
+1 -1
Submodule tools updated: 80dd78e6e3...11400eaa2c.
+4 -5
View File
@@ -1059,7 +1059,6 @@ host_arg() {
}
proxy_parse_args() {
args=""
while [ $# -gt 0 ]; do
case "$1" in
-H)
@@ -1098,16 +1097,15 @@ proxy_parse_args() {
tls_arg "${1%%=*}" "${1#*=}" key
;;
*)
args="$args $1"
REMAINING_ARGS="$REMAINING_ARGS $1"
;;
esac
shift
done
# Merge proxy options and other args, keeping $args at the end, as these could contain peers:
PROXY_ARGS="$PROXY_ARGS $args"
}
proxy_args() {
REMAINING_ARGS=""
PROXY_VOLUMES=""
PROXY_ARGS=""
PROXY_TLS_ENABLED=""
@@ -1291,7 +1289,8 @@ launch() {
--http-addr $HTTP_ADDR \
--status-addr $STATUS_ADDR \
--resolv-conf "/var/run/weave/etc/$RESOLV_CONF_BASE" \
$PROXY_ARGS)
$PROXY_ARGS \
$REMAINING_ARGS)
wait_for_status $CONTAINER_NAME http_call $HTTP_ADDR
}