mirror of
https://github.com/drone/drone-cli.git
synced 2024-11-26 06:07:05 +01:00
Merge pull request #142 from tboerger/server-delete-force
Integrate force flag to server destroy
This commit is contained in:
commit
c394ad262f
137
Gopkg.lock
generated
137
Gopkg.lock
generated
@ -2,6 +2,7 @@
|
||||
|
||||
|
||||
[[projects]]
|
||||
digest = "1:8c08dabeec001da3389028236a924397b9e11d4c519439d0135db44f9f21cb0f"
|
||||
name = "docker.io/go-docker"
|
||||
packages = [
|
||||
".",
|
||||
@ -20,61 +21,77 @@
|
||||
"api/types/swarm/runtime",
|
||||
"api/types/time",
|
||||
"api/types/versions",
|
||||
"api/types/volume"
|
||||
"api/types/volume",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "b3f5b5de7bbce0acc6a7fc0a4c2b88db678e262e"
|
||||
version = "v1.0.0"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:439cb14495e9425575d92e477ddf7aeb801e570dec8db9ecee24eb345a821d8f"
|
||||
name = "github.com/99designs/httpsignatures-go"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "88528bf4ca7e0268c559d30cfa8825208313b3c0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:f9ae348e1f793dcf9ed930ed47136a67343dbd6809c5c91391322267f4476892"
|
||||
name = "github.com/Microsoft/go-winio"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "97e4973ce50b2ff5f09635a57e2b88a037aae829"
|
||||
version = "v0.4.11"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:2aaf2cc045d0219bba79655e4df795b973168c310574669cb75786684f7287d3"
|
||||
name = "github.com/bmatcuk/doublestar"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "85a78806aa1b4707d1dbace9be592cf1ece91ab3"
|
||||
version = "v1.1.1"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:7fe1144cc16bff51e82309996914479ab43006905162cf3ee5b8c09c58a712b4"
|
||||
name = "github.com/buildkite/yaml"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "0caa5f0796e36057e59d6782832a9c774f457842"
|
||||
version = "v2.2.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:4189ee6a3844f555124d9d2656fe7af02fca961c2a9bad9074789df13a0c62e0"
|
||||
name = "github.com/docker/distribution"
|
||||
packages = [
|
||||
"digestset",
|
||||
"reference"
|
||||
"reference",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "edc3ab29cdff8694dd6feb85cfeb4b5f1b38ed9c"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:b6b5c3e8da0fb8073cd2886ba249a40f4402b4391ca6eba905a142cceea97a12"
|
||||
name = "github.com/docker/go-connections"
|
||||
packages = [
|
||||
"nat",
|
||||
"sockets",
|
||||
"tlsconfig"
|
||||
"tlsconfig",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "3ede32e2033de7505e6500d6c868c2b9ed9f169d"
|
||||
version = "v0.3.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:6f82cacd0af5921e99bf3f46748705239b36489464f4529a1589bc895764fb18"
|
||||
name = "github.com/docker/go-units"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "47565b4f722fb6ceae66b95f853feed578a4a51c"
|
||||
version = "v0.3.3"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:f1c7be680bf5bfb93835d5d574feb3929c253bcf66fde821b00abf532c047497"
|
||||
name = "github.com/drone/drone-go"
|
||||
packages = [
|
||||
"drone",
|
||||
@ -83,12 +100,14 @@
|
||||
"plugin/internal/client",
|
||||
"plugin/logger",
|
||||
"plugin/registry",
|
||||
"plugin/secret"
|
||||
"plugin/secret",
|
||||
]
|
||||
revision = "4d6116b897baf4f687b99d6960bd009a1945fdc1"
|
||||
pruneopts = "UT"
|
||||
revision = "cba78c0895aa079f12873aa163f1c6209ff22cb4"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:a98a717e564bc16c925cad119c61f9eddf479565658bc032df17f74907bad347"
|
||||
name = "github.com/drone/drone-runtime"
|
||||
packages = [
|
||||
"engine",
|
||||
@ -96,12 +115,14 @@
|
||||
"engine/docker/auth",
|
||||
"engine/docker/stdcopy",
|
||||
"runtime",
|
||||
"runtime/term"
|
||||
"runtime/term",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "807d0aeaa2212bee10be22b80d12b061fdb66eb9"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:6869fa0995c94e8620f3bccd8a882cfecb161eb9aa931f5e55ac0048fe2eac46"
|
||||
name = "github.com/drone/drone-yaml"
|
||||
packages = [
|
||||
"yaml",
|
||||
@ -118,180 +139,228 @@
|
||||
"yaml/converter/legacy/matrix",
|
||||
"yaml/linter",
|
||||
"yaml/pretty",
|
||||
"yaml/signer"
|
||||
"yaml/signer",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "70fa398b356003054d1df23e8d1c53b0aa86ad87"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:62963b8ba778d17f8c4678b2586ad2e0cd4d3e2f40e16ba1fe31c08e2c6a5dec"
|
||||
name = "github.com/drone/envsubst"
|
||||
packages = [
|
||||
".",
|
||||
"parse",
|
||||
"path"
|
||||
"path",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "611f114088d5d6c3c569e403c003584e2169ccb5"
|
||||
version = "v1.0.1"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:68d38943c39996fecfd0fd8aec17cfa08291b38b662d92fc9250293788bbafc0"
|
||||
name = "github.com/drone/signal"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "8e64eaa3eaf106e8702d6622c43fd78de52ec9d2"
|
||||
version = "v1.0.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:865079840386857c809b72ce300be7580cb50d3d3129ce11bf9aa6ca2bc1934a"
|
||||
name = "github.com/fatih/color"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "5b77d2a35fb0ede96d138fc9a99f5c9b6aef11b4"
|
||||
version = "v1.7.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:2cd7915ab26ede7d95b8749e6b1f933f1c6d5398030684e6505940a10f31cfda"
|
||||
name = "github.com/ghodss/yaml"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "0ca9ea5df5451ffdf184b4428c902747c2c11cd7"
|
||||
version = "v1.0.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:701239373bbf22998c5a36c76d2ff4ee309b3980e39b7a66d72cabd3aab748fa"
|
||||
name = "github.com/gogo/protobuf"
|
||||
packages = ["proto"]
|
||||
pruneopts = "UT"
|
||||
revision = "100ba4e885062801d56799d78530b73b178a78f3"
|
||||
version = "v0.4"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:97df918963298c287643883209a2c3f642e6593379f97ab400c2a2e219ab647d"
|
||||
name = "github.com/golang/protobuf"
|
||||
packages = ["proto"]
|
||||
pruneopts = "UT"
|
||||
revision = "aa810b61a9c79d51363740d207bb46cf8e620ed5"
|
||||
version = "v1.2.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:b72c8ef795e79b80e0a1405566d7ec07b3f465114d2b3f66b4de1f1699fdbe5c"
|
||||
name = "github.com/google/go-jsonnet"
|
||||
packages = [
|
||||
".",
|
||||
"ast",
|
||||
"parser"
|
||||
"parser",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "6144c57d2a054b72ff46219f655bf863b940e174"
|
||||
version = "v0.11.2"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:b9db9f06e1725fa17f939279f3fa1386c54ca5d8abc5ec99d170cf5bc8012d90"
|
||||
name = "github.com/jackspirou/syscerts"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "b68f5469dff16e102bd6a2d5b3e79341c938d736"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:1f4b55d7c57681ad91b7ce3ac7c8e7b139e6dd2f477c5f87e6a7749d298645dc"
|
||||
name = "github.com/joho/godotenv"
|
||||
packages = [
|
||||
".",
|
||||
"autoload"
|
||||
"autoload",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "23d116af351c84513e1946b527c88823e476be13"
|
||||
version = "v1.3.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:c658e84ad3916da105a761660dcaeb01e63416c8ec7bc62256a9b411a05fcd67"
|
||||
name = "github.com/mattn/go-colorable"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "167de6bfdfba052fa6b2d3664c8f5272e23c9072"
|
||||
version = "v0.0.9"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:0981502f9816113c9c8c4ac301583841855c8cf4da8c72f696b3ebedf6d0e4e5"
|
||||
name = "github.com/mattn/go-isatty"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "6ca4dbf54d38eea1a992b3c722a76a5d1c4cb25c"
|
||||
version = "v0.0.4"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:1c9ade3ce0a092eaf9a33fc69b056e68157d69deed5fa758a64744319d3a3d19"
|
||||
name = "github.com/natessilva/dag"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "7194b8dcc5c4ac1f9a86465b7da3dc2f5765c1bf"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:ee4d4af67d93cc7644157882329023ce9a7bcfce956a079069a9405521c7cc8d"
|
||||
name = "github.com/opencontainers/go-digest"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "279bed98673dd5bef374d3b6e4b09e2af76183bf"
|
||||
version = "v1.0.0-rc1"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:11db38d694c130c800d0aefb502fb02519e514dc53d9804ce51d1ad25ec27db6"
|
||||
name = "github.com/opencontainers/image-spec"
|
||||
packages = [
|
||||
"specs-go",
|
||||
"specs-go/v1"
|
||||
"specs-go/v1",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "d60099175f88c47cd379c4738d158884749ed235"
|
||||
version = "v1.0.1"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:635ac9478e783f09b2945663e359ebf74bc225b37f9845795d1b247285b458a2"
|
||||
name = "github.com/pkg/browser"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "0a3d74bf9ce488f035cf5bc36f753a711bc74334"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:40e195917a951a8bf867cd05de2a46aaf1806c50cf92eebf4c16f78cd196f747"
|
||||
name = "github.com/pkg/errors"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "645ef00459ed84a119197bfb8d8205042c6df63d"
|
||||
version = "v0.8.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:b24d38b282bacf9791408a080f606370efa3d364e4b5fd9ba0f7b87786d3b679"
|
||||
name = "github.com/urfave/cli"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "cfb38830724cc34fedffe9a2a29fb54fa9169cd1"
|
||||
version = "v1.20.0"
|
||||
|
||||
[[projects]]
|
||||
branch = "v2"
|
||||
digest = "1:274559f6500c8f32e6cb9f77bd41292a11a86719193d5da802fbf38032b83fcb"
|
||||
name = "github.com/vinzenz/yaml"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "35282ab071f92dad183b70e7ed117f1ab244c880"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:4aafff6a0b6999c4f5b618db52e17f8042409329036b85b6ab7fcce57514e9e9"
|
||||
name = "go.starlark.net"
|
||||
packages = [
|
||||
"internal/compile",
|
||||
"internal/spell",
|
||||
"resolve",
|
||||
"starlark",
|
||||
"syntax"
|
||||
"syntax",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "4eb76950c5f02ec5bcfd3ca898231a6543942fd9"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:d9f9f45d3383b93ce1c7e744b3ede6974917ae4d100e1a7abfc2906e5e5e2e28"
|
||||
name = "golang.org/x/net"
|
||||
packages = [
|
||||
"context",
|
||||
"context/ctxhttp",
|
||||
"internal/socks",
|
||||
"proxy"
|
||||
"proxy",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "146acd28ed5894421fb5aac80ca93bc1b1f46f87"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:28b360454e161aae382c007449bcb1296087b5b52b4f37623bba0f9f9d7207f4"
|
||||
name = "golang.org/x/oauth2"
|
||||
packages = [
|
||||
".",
|
||||
"internal"
|
||||
"internal",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "c57b0facaced709681d9f90397429b9430a74754"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:39ebcc2b11457b703ae9ee2e8cca0f68df21969c6102cb3b705f76cca0ea0239"
|
||||
name = "golang.org/x/sync"
|
||||
packages = ["errgroup"]
|
||||
pruneopts = "UT"
|
||||
revision = "1d60e4601c6fd243af51cc01ddf169918a5407ca"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
digest = "1:850d28ab022512e2cd3cf511a77f363c29e22689b4031f2050871f5de47ae4a0"
|
||||
name = "golang.org/x/sys"
|
||||
packages = [
|
||||
"unix",
|
||||
"windows"
|
||||
"windows",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "4497e2df6f9e69048a54498c7affbbec3294ad47"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:6247f76e55a1e1a5c19a81e2d4b4dff6730461eeb5bbb0a16dd4a8ec8637ee93"
|
||||
name = "google.golang.org/appengine"
|
||||
packages = [
|
||||
"internal",
|
||||
@ -300,20 +369,54 @@
|
||||
"internal/log",
|
||||
"internal/remote_api",
|
||||
"internal/urlfetch",
|
||||
"urlfetch"
|
||||
"urlfetch",
|
||||
]
|
||||
pruneopts = "UT"
|
||||
revision = "ae0ab99deb4dc413a2b4bd6c8bdd0eb67f1e4d06"
|
||||
version = "v1.2.0"
|
||||
|
||||
[[projects]]
|
||||
digest = "1:342378ac4dcb378a5448dd723f0784ae519383532f5e70ade24132c4c8693202"
|
||||
name = "gopkg.in/yaml.v2"
|
||||
packages = ["."]
|
||||
pruneopts = "UT"
|
||||
revision = "5420a8b6744d3b0345ab293f6fcba19c978f1183"
|
||||
version = "v2.2.1"
|
||||
|
||||
[solve-meta]
|
||||
analyzer-name = "dep"
|
||||
analyzer-version = 1
|
||||
inputs-digest = "c30d9d882ed28c6f89a05c22d8c5c553e439349f0d56856ccf8f9e1c6a7f2c96"
|
||||
input-imports = [
|
||||
"github.com/docker/go-units",
|
||||
"github.com/drone/drone-go/drone",
|
||||
"github.com/drone/drone-go/plugin/config",
|
||||
"github.com/drone/drone-go/plugin/registry",
|
||||
"github.com/drone/drone-go/plugin/secret",
|
||||
"github.com/drone/drone-runtime/engine",
|
||||
"github.com/drone/drone-runtime/engine/docker",
|
||||
"github.com/drone/drone-runtime/runtime",
|
||||
"github.com/drone/drone-runtime/runtime/term",
|
||||
"github.com/drone/drone-yaml/yaml",
|
||||
"github.com/drone/drone-yaml/yaml/compiler",
|
||||
"github.com/drone/drone-yaml/yaml/compiler/transform",
|
||||
"github.com/drone/drone-yaml/yaml/converter",
|
||||
"github.com/drone/drone-yaml/yaml/linter",
|
||||
"github.com/drone/drone-yaml/yaml/pretty",
|
||||
"github.com/drone/drone-yaml/yaml/signer",
|
||||
"github.com/drone/envsubst",
|
||||
"github.com/drone/signal",
|
||||
"github.com/fatih/color",
|
||||
"github.com/google/go-jsonnet",
|
||||
"github.com/jackspirou/syscerts",
|
||||
"github.com/joho/godotenv",
|
||||
"github.com/joho/godotenv/autoload",
|
||||
"github.com/mattn/go-colorable",
|
||||
"github.com/mattn/go-isatty",
|
||||
"github.com/pkg/browser",
|
||||
"github.com/urfave/cli",
|
||||
"go.starlark.net/starlark",
|
||||
"golang.org/x/net/proxy",
|
||||
"golang.org/x/oauth2",
|
||||
]
|
||||
solver-name = "gps-cdcl"
|
||||
solver-version = 1
|
||||
|
@ -21,6 +21,10 @@ var serverDestroyCmd = cli.Command{
|
||||
Usage: "format output",
|
||||
Value: tmplServerDestroy,
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "force",
|
||||
Usage: "force destroy",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@ -35,7 +39,7 @@ func serverDestroy(c *cli.Context) error {
|
||||
return fmt.Errorf("Missing or invalid server name")
|
||||
}
|
||||
|
||||
err = client.ServerDelete(name)
|
||||
err = client.ServerDelete(name, c.Bool("foorce"))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
5
vendor/github.com/drone/drone-go/drone/client.go
generated
vendored
5
vendor/github.com/drone/drone-go/drone/client.go
generated
vendored
@ -568,8 +568,11 @@ func (c *client) ServerCreate() (*Server, error) {
|
||||
}
|
||||
|
||||
// ServerDelete terminates a server.
|
||||
func (c *client) ServerDelete(name string) error {
|
||||
func (c *client) ServerDelete(name string, force bool) error {
|
||||
uri := fmt.Sprintf(pathServer, c.addr, name)
|
||||
if force {
|
||||
uri = uri + "?force=true"
|
||||
}
|
||||
return c.delete(uri)
|
||||
}
|
||||
|
||||
|
2
vendor/github.com/drone/drone-go/drone/interface.go
generated
vendored
2
vendor/github.com/drone/drone-go/drone/interface.go
generated
vendored
@ -212,7 +212,7 @@ type Client interface {
|
||||
ServerCreate() (*Server, error)
|
||||
|
||||
// ServerDelete terminates a server.
|
||||
ServerDelete(name string) error
|
||||
ServerDelete(name string, force bool) error
|
||||
|
||||
// AutoscalePause pauses the autoscaler.
|
||||
AutoscalePause() error
|
||||
|
Loading…
Reference in New Issue
Block a user