update vendor

Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
This commit is contained in:
Jess Frazelle 2018-09-25 12:27:46 -04:00
parent 19a32db84d
commit 94d1cfbfbf
No known key found for this signature in database
GPG key ID: 18F3685C0022BFF3
10501 changed files with 2307943 additions and 29279 deletions

44
vendor/github.com/docker/cli/e2e/stack/deploy_test.go generated vendored Normal file
View file

@ -0,0 +1,44 @@
package stack
import (
"fmt"
"sort"
"strings"
"testing"
"github.com/docker/cli/internal/test/environment"
"gotest.tools/assert"
"gotest.tools/golden"
"gotest.tools/icmd"
"gotest.tools/skip"
)
func TestDeployWithNamedResources(t *testing.T) {
t.Run("Swarm", func(t *testing.T) {
testDeployWithNamedResources(t, "swarm")
})
t.Run("Kubernetes", func(t *testing.T) {
// FIXME(chris-crone): currently does not work with compose for kubernetes.
t.Skip("FIXME(chris-crone): currently does not work with compose for kubernetes.")
skip.If(t, !environment.KubernetesEnabled())
testDeployWithNamedResources(t, "kubernetes")
})
}
func testDeployWithNamedResources(t *testing.T, orchestrator string) {
stackname := fmt.Sprintf("test-stack-deploy-with-names-%s", orchestrator)
composefile := golden.Path("stack-with-named-resources.yml")
result := icmd.RunCommand("docker", "stack", "deploy",
"-c", composefile, stackname, "--orchestrator", orchestrator)
defer icmd.RunCommand("docker", "stack", "rm",
"--orchestrator", orchestrator, stackname)
result.Assert(t, icmd.Success)
stdout := strings.Split(result.Stdout(), "\n")
expected := strings.Split(string(golden.Get(t, fmt.Sprintf("stack-deploy-with-names-%s.golden", orchestrator))), "\n")
sort.Strings(stdout)
sort.Strings(expected)
assert.DeepEqual(t, stdout, expected)
}

24
vendor/github.com/docker/cli/e2e/stack/help_test.go generated vendored Normal file
View file

@ -0,0 +1,24 @@
package stack
import (
"fmt"
"testing"
"gotest.tools/golden"
"gotest.tools/icmd"
)
func TestStackDeployHelp(t *testing.T) {
t.Run("Swarm", func(t *testing.T) {
testStackDeployHelp(t, "swarm")
})
t.Run("Kubernetes", func(t *testing.T) {
testStackDeployHelp(t, "kubernetes")
})
}
func testStackDeployHelp(t *testing.T, orchestrator string) {
result := icmd.RunCommand("docker", "stack", "deploy", "--orchestrator", orchestrator, "--help")
result.Assert(t, icmd.Success)
golden.Assert(t, result.Stdout(), fmt.Sprintf("stack-deploy-help-%s.golden", orchestrator))
}

17
vendor/github.com/docker/cli/e2e/stack/main_test.go generated vendored Normal file
View file

@ -0,0 +1,17 @@
package stack
import (
"fmt"
"os"
"testing"
"github.com/docker/cli/internal/test/environment"
)
func TestMain(m *testing.M) {
if err := environment.Setup(); err != nil {
fmt.Println(err.Error())
os.Exit(3)
}
os.Exit(m.Run())
}

85
vendor/github.com/docker/cli/e2e/stack/remove_test.go generated vendored Normal file
View file

@ -0,0 +1,85 @@
package stack
import (
"fmt"
"strings"
"testing"
"github.com/docker/cli/internal/test/environment"
"gotest.tools/golden"
"gotest.tools/icmd"
"gotest.tools/poll"
"gotest.tools/skip"
)
var pollSettings = environment.DefaultPollSettings
func TestRemove(t *testing.T) {
t.Run("Swarm", func(t *testing.T) {
testRemove(t, "swarm")
})
t.Run("Kubernetes", func(t *testing.T) {
skip.If(t, !environment.KubernetesEnabled())
testRemove(t, "kubernetes")
})
}
func testRemove(t *testing.T, orchestrator string) {
stackname := "test-stack-remove-" + orchestrator
deployFullStack(t, orchestrator, stackname)
defer cleanupFullStack(t, orchestrator, stackname)
result := icmd.RunCommand("docker", "stack", "rm",
stackname, "--orchestrator", orchestrator)
result.Assert(t, icmd.Expected{Err: icmd.None})
golden.Assert(t, result.Stdout(),
fmt.Sprintf("stack-remove-%s-success.golden", orchestrator))
}
func deployFullStack(t *testing.T, orchestrator, stackname string) {
// TODO: this stack should have full options not minimal options
result := icmd.RunCommand("docker", "stack", "deploy",
"--compose-file=./testdata/full-stack.yml", stackname, "--orchestrator", orchestrator)
result.Assert(t, icmd.Success)
poll.WaitOn(t, taskCount(orchestrator, stackname, 2), pollSettings)
}
func cleanupFullStack(t *testing.T, orchestrator, stackname string) {
// FIXME(vdemeester) we shouldn't have to do that. it is hidding a race on docker stack rm
poll.WaitOn(t, stackRm(orchestrator, stackname), pollSettings)
poll.WaitOn(t, taskCount(orchestrator, stackname, 0), pollSettings)
}
func stackRm(orchestrator, stackname string) func(t poll.LogT) poll.Result {
return func(poll.LogT) poll.Result {
result := icmd.RunCommand("docker", "stack", "rm", stackname, "--orchestrator", orchestrator)
if result.Error != nil {
if strings.Contains(result.Stderr(), "not found") {
return poll.Success()
}
return poll.Continue("docker stack rm %s failed : %v", stackname, result.Error)
}
return poll.Success()
}
}
func taskCount(orchestrator, stackname string, expected int) func(t poll.LogT) poll.Result {
return func(poll.LogT) poll.Result {
args := []string{"stack", "ps", stackname, "--orchestrator", orchestrator}
// FIXME(chris-crone): remove when we support filtering by desired-state on kubernetes
if orchestrator == "swarm" {
args = append(args, "-f=desired-state=running")
}
result := icmd.RunCommand("docker", args...)
count := lines(result.Stdout()) - 1
if count == expected {
return poll.Success()
}
return poll.Continue("task count is %d waiting for %d", count, expected)
}
}
func lines(out string) int {
return len(strings.Split(strings.TrimSpace(out), "\n"))
}

1
vendor/github.com/docker/cli/e2e/stack/testdata/data generated vendored Normal file
View file

@ -0,0 +1 @@
A file with some text

View file

@ -0,0 +1,9 @@
version: '3.3'
services:
one:
image: registry:5000/alpine:3.6
command: top
two:
image: registry:5000/alpine:3.6
command: top

View file

@ -0,0 +1,14 @@
Usage: docker stack deploy [OPTIONS] STACK
Deploy a new stack or update an existing stack
Aliases:
deploy, up
Options:
-c, --compose-file strings Path to a Compose file, or "-" to read
from stdin
--kubeconfig string Kubernetes config file
--namespace string Kubernetes namespace to use
--orchestrator string Orchestrator to use (swarm|kubernetes|all)

View file

@ -0,0 +1,19 @@
Usage: docker stack deploy [OPTIONS] STACK
Deploy a new stack or update an existing stack
Aliases:
deploy, up
Options:
--bundle-file string Path to a Distributed Application Bundle file
-c, --compose-file strings Path to a Compose file, or "-" to read
from stdin
--orchestrator string Orchestrator to use (swarm|kubernetes|all)
--prune Prune services that are no longer referenced
--resolve-image string Query the registry to resolve image digest
and supported platforms
("always"|"changed"|"never") (default "always")
--with-registry-auth Send registry authentication details to
Swarm agents

View file

@ -0,0 +1,7 @@
Creating network test-stack-deploy-with-names_network2
Creating network named-network
Creating secret named-secret
Creating secret test-stack-deploy-with-names_secret2
Creating config test-stack-deploy-with-names_config2
Creating config named-config
Creating service test-stack-deploy-with-names_web

View file

@ -0,0 +1,7 @@
Creating network test-stack-deploy-with-names-swarm_network2
Creating network named-network
Creating secret named-secret
Creating secret test-stack-deploy-with-names-swarm_secret2
Creating config test-stack-deploy-with-names-swarm_config2
Creating config named-config
Creating service test-stack-deploy-with-names-swarm_web

View file

@ -0,0 +1,7 @@
Creating network test-stack-deploy-with-names_network2
Creating network named-network
Creating secret named-secret
Creating secret test-stack-deploy-with-names_secret2
Creating config test-stack-deploy-with-names_config2
Creating config named-config
Creating service test-stack-deploy-with-names_web

View file

@ -0,0 +1 @@
Removing stack: test-stack-remove-kubernetes

View file

@ -0,0 +1,3 @@
Removing service test-stack-remove-swarm_one
Removing service test-stack-remove-swarm_two
Removing network test-stack-remove-swarm_default

View file

@ -0,0 +1,30 @@
version: '3.5'
services:
web:
image: registry:5000/alpine:3.6
command: top
networks: [network1, network2]
volumes: [volume1, volume2]
secrets: [secret1, secret2]
configs: [config1, config2]
networks:
network1:
name: named-network
network2:
volumes:
volume1:
name: named-volume
volume2:
secrets:
secret1:
name: named-secret
file: ./data
secret2:
file: ./data
configs:
config1:
name: named-config
file: ./data
config2:
file: ./data