Skip to content

Commit

Permalink
misc: Use go mod
Browse files Browse the repository at this point in the history
Update package imports to reflect go-mod dependency versions.

Update to etcd/v3. etcd upstream versioning doesn't play well with Go
modules or newer versions of gRPC. v3.5.0 and newer follow Go semantic
versioning guidelines and resolves most versioning conflicts with
co-dependent libraries. There are many issues surrounding this, see [1].

Fix test-examples for Go Modules. Previously this test script symlinked
the examples source directory outside of the mgmt tree, but this doesn't
work with Go modules. Switch to building the example programs in-place,
and simplify the script to reduce the amount of superfluous operations.

Fixes a couple shellcheck warnings in test-examples too.

[1]: etcd-io/etcd#12124

Signed-off-by: Joe Groocock <me@frebib.net>
  • Loading branch information
guilhem authored and frebib committed Oct 12, 2021
1 parent 733b2c3 commit 968625c
Show file tree
Hide file tree
Showing 66 changed files with 80 additions and 29 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -154,7 +154,7 @@ lang: ## generates the lexer/parser for the language frontend

# build a `mgmt` binary for current host os/arch
$(PROGRAM): build/mgmt-${GOHOSTOS}-${GOHOSTARCH} ## build an mgmt binary for current host os/arch
cp -a $< $@
@cp -a $< $@

$(PROGRAM).static: $(GO_FILES) $(MCL_FILES)
@echo "Building: $(PROGRAM).static, version: $(SVERSION)..."
Expand Down
1 change: 1 addition & 0 deletions converger/converger_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !root
// +build !root

package converger
Expand Down
1 change: 1 addition & 0 deletions engine/autoedge_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !root
// +build !root

package engine
Expand Down
1 change: 1 addition & 0 deletions engine/graph/autogroup/autogroup_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !root
// +build !root

package autogroup
Expand Down
1 change: 1 addition & 0 deletions engine/graph/graph_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !root
// +build !root

package graph
Expand Down
1 change: 1 addition & 0 deletions engine/graph/semaphore_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !root
// +build !root

package graph
Expand Down
1 change: 1 addition & 0 deletions engine/metaparams_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !root
// +build !root

package engine
Expand Down
1 change: 1 addition & 0 deletions engine/resources/augeas.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !noaugeas
// +build !noaugeas

package resources
Expand Down
1 change: 1 addition & 0 deletions engine/resources/docker_container.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !nodocker
// +build !nodocker

package resources
Expand Down
1 change: 1 addition & 0 deletions engine/resources/docker_container_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !nodocker
// +build !nodocker

package resources
Expand Down
1 change: 1 addition & 0 deletions engine/resources/docker_image.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !nodocker
// +build !nodocker

package resources
Expand Down
1 change: 1 addition & 0 deletions engine/resources/exec_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !root
// +build !root

package resources
Expand Down
1 change: 1 addition & 0 deletions engine/resources/file_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !root
// +build !root

package resources
Expand Down
1 change: 1 addition & 0 deletions engine/resources/mount_linux_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !root || !darwin
// +build !root !darwin

package resources
Expand Down
1 change: 1 addition & 0 deletions engine/resources/mount_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !root
// +build !root

package resources
Expand Down
1 change: 1 addition & 0 deletions engine/resources/msg_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !root
// +build !root

package resources
Expand Down
1 change: 1 addition & 0 deletions engine/resources/net.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !darwin
// +build !darwin

package resources
Expand Down
1 change: 1 addition & 0 deletions engine/resources/net_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !darwin
// +build !darwin

package resources
Expand Down
1 change: 1 addition & 0 deletions engine/resources/noop_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !root
// +build !root

package resources
Expand Down
1 change: 1 addition & 0 deletions engine/resources/pippet_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !root
// +build !root

package resources
Expand Down
1 change: 1 addition & 0 deletions engine/resources/pkg_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !root
// +build !root

package resources
Expand Down
1 change: 1 addition & 0 deletions engine/resources/resources_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !root
// +build !root

package resources
Expand Down
1 change: 1 addition & 0 deletions engine/resources/test_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !root
// +build !root

package resources
Expand Down
1 change: 1 addition & 0 deletions engine/resources/virt.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !novirt
// +build !novirt

package resources
Expand Down
1 change: 1 addition & 0 deletions engine/util/mode_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !root
// +build !root

package util
Expand Down
1 change: 1 addition & 0 deletions engine/util/util_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !root
// +build !root

package util
Expand Down
1 change: 1 addition & 0 deletions integration/basic_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !root
// +build !root

package integration
Expand Down
1 change: 1 addition & 0 deletions integration/util_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !root
// +build !root

package integration
Expand Down
1 change: 1 addition & 0 deletions lang/funcs/core/core_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !root
// +build !root

package core
Expand Down
1 change: 1 addition & 0 deletions lang/funcs/core/datetime/format_func_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !darwin
// +build !darwin

package coredatetime
Expand Down
1 change: 1 addition & 0 deletions lang/funcs/core/sys/cpucount_fact.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !darwin
// +build !darwin

package coresys
Expand Down
1 change: 1 addition & 0 deletions lang/funcs/core/sys/cpucount_fact_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !darwin
// +build !darwin

package coresys
Expand Down
1 change: 1 addition & 0 deletions lang/funcs/core/sys/load_fact_darwin.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build darwin
// +build darwin

package coresys
Expand Down
1 change: 1 addition & 0 deletions lang/funcs/core/sys/load_fact_posix.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !darwin
// +build !darwin

package coresys
Expand Down
1 change: 1 addition & 0 deletions lang/funcs/core/sys/uptime_fact_darwin.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build darwin
// +build darwin

package coresys
Expand Down
1 change: 1 addition & 0 deletions lang/funcs/core/sys/uptime_fact_posix.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !darwin
// +build !darwin

package coresys
Expand Down
1 change: 1 addition & 0 deletions lang/funcs/facts/func_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !root
// +build !root

package facts
Expand Down
1 change: 1 addition & 0 deletions lang/funcs/funcs_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !root
// +build !root

package funcs
Expand Down
1 change: 1 addition & 0 deletions lang/interfaces/metadata_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !root
// +build !root

package interfaces
Expand Down
1 change: 1 addition & 0 deletions lang/interpolate_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !root
// +build !root

package lang
Expand Down
1 change: 1 addition & 0 deletions lang/interpret_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !root
// +build !root

package lang
Expand Down
1 change: 1 addition & 0 deletions lang/lang_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !root
// +build !root

package lang
Expand Down
1 change: 1 addition & 0 deletions lang/lexparse_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !root
// +build !root

package lang
Expand Down
1 change: 1 addition & 0 deletions lang/scope_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !root
// +build !root

package lang
Expand Down
1 change: 1 addition & 0 deletions lang/types/type_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !root
// +build !root

package types
Expand Down
1 change: 1 addition & 0 deletions lang/types/value_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !root
// +build !root

package types
Expand Down
1 change: 1 addition & 0 deletions lang/unification_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !root
// +build !root

package lang
Expand Down
1 change: 1 addition & 0 deletions lib/main_test.go
Expand Up @@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

//go:build !root
// +build !root

package lib
Expand Down

0 comments on commit 968625c

Please sign in to comment.