grim/convey

Parents 230240333309
Children 7cf6e9f9bd9d
Remove the network as it's primary reason for existing was to try to protect the local lan from the container and that's just not the case as that's not how networking works.
--- a/ChangeLog Sat Oct 26 11:45:39 2019 -0500
+++ b/ChangeLog Sat Oct 26 11:47:32 2019 -0500
@@ -31,6 +31,8 @@
* Only create a network if we have a run task.
* Removed deprecated command line options: --graphviz, --list-environment,
--list-meta-plans, --list-plans, --list-tasks, and --config.
+ * Removed the network since it doesn't actually protect the host from the
+ container.
0.13.1: 20180114
* Write warning, error, and fatal log messages to stderr. Fixed #156
--- a/docker/run.go Sat Oct 26 11:45:39 2019 -0500
+++ b/docker/run.go Sat Oct 26 11:47:32 2019 -0500
@@ -224,7 +224,6 @@
cmd := exec.NewGenerator(
"run", "--rm",
"--name", runID,
- "--network", rt.State.Network.Name(),
)
// add the hostname if specified
--- a/network/network.go Sat Oct 26 11:45:39 2019 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-// Convey
-// Copyright 2016-2018 Gary Kramlich <grim@reaperworld.com>
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-// Package network provides the interface creating networks.
-package network
-
-// Network is an interface for representing an isolated network.
-type Network interface {
- Name() string
- Destroy() error
-}
--- a/plans/plans.go Sat Oct 26 11:45:39 2019 -0500
+++ b/plans/plans.go Sat Oct 26 11:47:32 2019 -0500
@@ -27,7 +27,6 @@
"bitbucket.org/rw_grim/convey/docker"
"bitbucket.org/rw_grim/convey/environment"
"bitbucket.org/rw_grim/convey/logging"
- "bitbucket.org/rw_grim/convey/network"
"bitbucket.org/rw_grim/convey/runtime"
"bitbucket.org/rw_grim/convey/stages"
"bitbucket.org/rw_grim/convey/tasks"
@@ -62,43 +61,9 @@
}
func (p *Plan) setup(rt *runtime.Runtime, taskMap map[string]tasks.Task) error {
- if p.haveRunTask(taskMap) {
- network, err := p.createNetwork(rt)
- if err != nil {
- p.logger.Fatal("failed to create network")
-
- return err
- }
-
- rt.State.Network = network
- p.logger.Infof("created network %s", rt.State.Network.Name())
- }
-
return nil
}
-func (p *Plan) createNetwork(rt *runtime.Runtime) (network.Network, error) {
- // create the network
- p.logger.Info("creating network...")
-
- network, err := docker.NewNetwork(rt)
- if err != nil {
- return nil, err
- }
-
- rt.Cleanup(func(logger *log.Entry) {
- p.logger.Infof("removing network %s", rt.State.Network.Name())
-
- if netErr := rt.State.Network.Destroy(); netErr != nil {
- p.logger.Fatalf("failed to remove network %s: %s", rt.State.Network.Name(), netErr)
- } else {
- p.logger.Infof("removed network %s", rt.State.Network.Name())
- }
- })
-
- return network, nil
-}
-
// Execute runs the plan.
func (p *Plan) Execute(path string, tasks map[string]tasks.Task, env *environment.Environment, rt *runtime.Runtime) error {
planEnv := env.Copy().Merge(rt.Environment).MergeSlice(p.Environment)
--- a/state/state.go Sat Oct 26 11:45:39 2019 -0500
+++ b/state/state.go Sat Oct 26 11:47:32 2019 -0500
@@ -25,7 +25,6 @@
log "github.com/sirupsen/logrus"
"bitbucket.org/rw_grim/convey/logging"
- "bitbucket.org/rw_grim/convey/network"
"bitbucket.org/rw_grim/convey/workspace"
)
@@ -35,7 +34,6 @@
logger *log.Entry
CfgPath string
- Network network.Network
Workspace *workspace.Workspace
KeepWorkspace bool