Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade sops to go 1.13 #566

Merged
merged 1 commit into from
Nov 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ jobs:
build:
working_directory: /go/src/go.mozilla.org/sops
docker:
- image: circleci/golang:1.12
- image: circleci/golang:1.13
steps:
- checkout
- setup_remote_docker
Expand Down
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: go
go: 1.12
go: 1.13
go_import_path: go.mozilla.org/sops/

env:
Expand All @@ -21,6 +21,7 @@ before_install:

before_script:
- vault server -dev -dev-root-token-id="$VAULT_TOKEN" &
- sleep 5
- vault secrets enable -version=1 kv

script:
Expand All @@ -37,7 +38,7 @@ before_deploy:
- GOOS=linux CGO_ENABLED=0 GO111MODULE=on go build -mod vendor -o dist/sops-${TRAVIS_TAG}.linux go.mozilla.org/sops/cmd/sops
- |
if [ ! -z "$TRAVIS_TAG" ]; then
version="$(grep '^const Version' version/version.go |cut -d '"' -f 2)"
version="v$(grep '^const Version' version/version.go |cut -d '"' -f 2)"
if [ "$version" != "$TRAVIS_TAG" ]; then
echo "Git tag $TRAVIS_TAG does not match version $version, update the source!"
exit 1
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ all: test vet generate install functional-tests
origin-build: test vet generate install functional-tests-all

install:
$(GO) install go.mozilla.org/sops/cmd/sops
$(GO) install go.mozilla.org/sops/v3/cmd/sops
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@carlpett Not changing this was the cause of the addition of the old sops path to go.mod.


tag: all
git tag -s $(TAGVER) -a -m "$(TAGMSG)"
Expand Down Expand Up @@ -39,13 +39,13 @@ generate: keyservice/keyservice.pb.go
protoc --go_out=plugins=grpc:. $<

functional-tests:
$(GO) build -o functional-tests/sops go.mozilla.org/sops/cmd/sops
$(GO) build -o functional-tests/sops go.mozilla.org/sops/v3/cmd/sops
cd functional-tests && cargo test

# Ignored tests are ones that require external services (e.g. AWS KMS)
# TODO: Once `--include-ignored` lands in rust stable, switch to that.
functional-tests-all:
$(GO) build -o functional-tests/sops go.mozilla.org/sops/cmd/sops
$(GO) build -o functional-tests/sops go.mozilla.org/sops/v3/cmd/sops
cd functional-tests && cargo test && cargo test -- --ignored

deb-pkg: install
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ For the adventurous, unstable features are available in the `develop` branch, wh

.. code:: bash

$ go get -u go.mozilla.org/sops/cmd/sops
$ go get -u go.mozilla.org/sops/v3/cmd/sops
$ cd $GOPATH/src/go.mozilla.org/sops/
$ git checkout develop
$ make install

(requires Go >= 1.12)
ajvb marked this conversation as resolved.
Show resolved Hide resolved
(requires Go >= 1.13)

If you don't have Go installed, set it up with:

Expand Down
6 changes: 3 additions & 3 deletions aes/cipher.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
Package aes defines a Cipher that uses 256-bit AES-GCM authenticated encryption to encrypt values the SOPS tree.
*/
package aes //import "go.mozilla.org/sops/aes"
package aes //import "go.mozilla.org/sops/v3/aes"

import (
cryptoaes "crypto/aes"
Expand All @@ -14,8 +14,8 @@ import (
"strings"

"github.com/sirupsen/logrus"
"go.mozilla.org/sops"
"go.mozilla.org/sops/logging"
"go.mozilla.org/sops/v3"
"go.mozilla.org/sops/v3/logging"
)

var log *logrus.Logger
Expand Down
2 changes: 1 addition & 1 deletion aes/cipher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"testing/quick"

"github.com/stretchr/testify/assert"
"go.mozilla.org/sops"
"go.mozilla.org/sops/v3"
)

func TestDecrypt(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions audit/audit.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
// empty import as per https://godoc.org/github.com/lib/pq
_ "github.com/lib/pq"

"github.com/mozilla-services/yaml"
"github.com/sirupsen/logrus"
"go.mozilla.org/sops/logging"
"gopkg.in/yaml.v2"
"go.mozilla.org/sops/v3/logging"
)

var log *logrus.Logger
Expand Down
6 changes: 3 additions & 3 deletions azkv/keysource.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
Package azkv contains an implementation of the go.mozilla.org/sops/keys.MasterKey interface that encrypts and decrypts the
Package azkv contains an implementation of the go.mozilla.org/sops/v3/keys.MasterKey interface that encrypts and decrypts the
data key using Azure Key Vault with the Azure Go SDK.
*/
package azkv //import "go.mozilla.org/sops/azkv"
package azkv //import "go.mozilla.org/sops/v3/azkv"

import (
"context"
Expand All @@ -14,7 +14,7 @@ import (
"strings"
"time"

"go.mozilla.org/sops/logging"
"go.mozilla.org/sops/v3/logging"

"github.com/Azure/azure-sdk-for-go/services/keyvault/2016-10-01/keyvault"
"github.com/Azure/go-autorest/autorest"
Expand Down
22 changes: 11 additions & 11 deletions cmd/sops/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ import (

"github.com/fatih/color"
wordwrap "github.com/mitchellh/go-wordwrap"
"go.mozilla.org/sops"
"go.mozilla.org/sops/cmd/sops/codes"
. "go.mozilla.org/sops/cmd/sops/formats"
"go.mozilla.org/sops/keys"
"go.mozilla.org/sops/keyservice"
"go.mozilla.org/sops/kms"
"go.mozilla.org/sops/stores/dotenv"
"go.mozilla.org/sops/stores/ini"
"go.mozilla.org/sops/stores/json"
"go.mozilla.org/sops/stores/yaml"
"go.mozilla.org/sops/version"
"go.mozilla.org/sops/v3"
"go.mozilla.org/sops/v3/cmd/sops/codes"
. "go.mozilla.org/sops/v3/cmd/sops/formats"
"go.mozilla.org/sops/v3/keys"
"go.mozilla.org/sops/v3/keyservice"
"go.mozilla.org/sops/v3/kms"
"go.mozilla.org/sops/v3/stores/dotenv"
"go.mozilla.org/sops/v3/stores/ini"
"go.mozilla.org/sops/v3/stores/json"
"go.mozilla.org/sops/v3/stores/yaml"
"go.mozilla.org/sops/v3/version"
"golang.org/x/crypto/ssh/terminal"
"gopkg.in/urfave/cli.v1"
)
Expand Down
8 changes: 4 additions & 4 deletions cmd/sops/decrypt.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package main
import (
"fmt"

"go.mozilla.org/sops"
"go.mozilla.org/sops/cmd/sops/codes"
"go.mozilla.org/sops/cmd/sops/common"
"go.mozilla.org/sops/keyservice"
"go.mozilla.org/sops/v3"
"go.mozilla.org/sops/v3/cmd/sops/codes"
"go.mozilla.org/sops/v3/cmd/sops/common"
"go.mozilla.org/sops/v3/keyservice"
)

type decryptOpts struct {
Expand Down
10 changes: 5 additions & 5 deletions cmd/sops/edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ import (
"path/filepath"

"github.com/google/shlex"
"go.mozilla.org/sops"
"go.mozilla.org/sops/cmd/sops/codes"
"go.mozilla.org/sops/cmd/sops/common"
"go.mozilla.org/sops/keyservice"
"go.mozilla.org/sops/version"
"go.mozilla.org/sops/v3"
"go.mozilla.org/sops/v3/cmd/sops/codes"
"go.mozilla.org/sops/v3/cmd/sops/common"
"go.mozilla.org/sops/v3/keyservice"
"go.mozilla.org/sops/v3/version"
)

type editOpts struct {
Expand Down
10 changes: 5 additions & 5 deletions cmd/sops/encrypt.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import (
"fmt"

wordwrap "github.com/mitchellh/go-wordwrap"
"go.mozilla.org/sops"
"go.mozilla.org/sops/cmd/sops/codes"
"go.mozilla.org/sops/cmd/sops/common"
"go.mozilla.org/sops/keyservice"
"go.mozilla.org/sops/version"
"go.mozilla.org/sops/v3"
"go.mozilla.org/sops/v3/cmd/sops/codes"
"go.mozilla.org/sops/v3/cmd/sops/common"
"go.mozilla.org/sops/v3/keyservice"
"go.mozilla.org/sops/v3/version"
)

type encryptOpts struct {
Expand Down
44 changes: 22 additions & 22 deletions cmd/sops/main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package main //import "go.mozilla.org/sops/cmd/sops"
package main //import "go.mozilla.org/sops/v3/cmd/sops"

import (
encodingjson "encoding/json"
Expand All @@ -13,27 +13,27 @@ import (
"time"

"github.com/sirupsen/logrus"
"go.mozilla.org/sops"
"go.mozilla.org/sops/aes"
_ "go.mozilla.org/sops/audit"
"go.mozilla.org/sops/azkv"
"go.mozilla.org/sops/cmd/sops/codes"
"go.mozilla.org/sops/cmd/sops/common"
"go.mozilla.org/sops/cmd/sops/subcommand/exec"
"go.mozilla.org/sops/cmd/sops/subcommand/groups"
keyservicecmd "go.mozilla.org/sops/cmd/sops/subcommand/keyservice"
publishcmd "go.mozilla.org/sops/cmd/sops/subcommand/publish"
"go.mozilla.org/sops/cmd/sops/subcommand/updatekeys"
"go.mozilla.org/sops/config"
"go.mozilla.org/sops/gcpkms"
"go.mozilla.org/sops/keys"
"go.mozilla.org/sops/keyservice"
"go.mozilla.org/sops/kms"
"go.mozilla.org/sops/logging"
"go.mozilla.org/sops/pgp"
"go.mozilla.org/sops/stores/dotenv"
"go.mozilla.org/sops/stores/json"
"go.mozilla.org/sops/version"
"go.mozilla.org/sops/v3"
"go.mozilla.org/sops/v3/aes"
_ "go.mozilla.org/sops/v3/audit"
"go.mozilla.org/sops/v3/azkv"
"go.mozilla.org/sops/v3/cmd/sops/codes"
"go.mozilla.org/sops/v3/cmd/sops/common"
"go.mozilla.org/sops/v3/cmd/sops/subcommand/exec"
"go.mozilla.org/sops/v3/cmd/sops/subcommand/groups"
keyservicecmd "go.mozilla.org/sops/v3/cmd/sops/subcommand/keyservice"
publishcmd "go.mozilla.org/sops/v3/cmd/sops/subcommand/publish"
"go.mozilla.org/sops/v3/cmd/sops/subcommand/updatekeys"
"go.mozilla.org/sops/v3/config"
"go.mozilla.org/sops/v3/gcpkms"
"go.mozilla.org/sops/v3/keys"
"go.mozilla.org/sops/v3/keyservice"
"go.mozilla.org/sops/v3/kms"
"go.mozilla.org/sops/v3/logging"
"go.mozilla.org/sops/v3/pgp"
"go.mozilla.org/sops/v3/stores/dotenv"
"go.mozilla.org/sops/v3/stores/json"
"go.mozilla.org/sops/v3/version"
"google.golang.org/grpc"
"gopkg.in/urfave/cli.v1"
)
Expand Down
12 changes: 6 additions & 6 deletions cmd/sops/rotate.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package main
import (
"fmt"

"go.mozilla.org/sops"
"go.mozilla.org/sops/audit"
"go.mozilla.org/sops/cmd/sops/codes"
"go.mozilla.org/sops/cmd/sops/common"
"go.mozilla.org/sops/keys"
"go.mozilla.org/sops/keyservice"
"go.mozilla.org/sops/v3"
"go.mozilla.org/sops/v3/audit"
"go.mozilla.org/sops/v3/cmd/sops/codes"
"go.mozilla.org/sops/v3/cmd/sops/common"
"go.mozilla.org/sops/v3/keys"
"go.mozilla.org/sops/v3/keyservice"
)

type rotateOpts struct {
Expand Down
8 changes: 4 additions & 4 deletions cmd/sops/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package main
import (
"fmt"

"go.mozilla.org/sops"
"go.mozilla.org/sops/cmd/sops/codes"
"go.mozilla.org/sops/cmd/sops/common"
"go.mozilla.org/sops/keyservice"
"go.mozilla.org/sops/v3"
"go.mozilla.org/sops/v3/cmd/sops/codes"
"go.mozilla.org/sops/v3/cmd/sops/common"
"go.mozilla.org/sops/v3/keyservice"
)

type setOpts struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/sops/subcommand/exec/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"runtime"
"strings"

"go.mozilla.org/sops/logging"
"go.mozilla.org/sops/v3/logging"

"github.com/sirupsen/logrus"
)
Expand Down
6 changes: 3 additions & 3 deletions cmd/sops/subcommand/groups/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package groups
import (
"os"

"go.mozilla.org/sops"
"go.mozilla.org/sops/cmd/sops/common"
"go.mozilla.org/sops/keyservice"
"go.mozilla.org/sops/v3"
"go.mozilla.org/sops/v3/cmd/sops/common"
"go.mozilla.org/sops/v3/keyservice"
)

// AddOpts are the options for adding a key group to a SOPS file
Expand Down
6 changes: 3 additions & 3 deletions cmd/sops/subcommand/groups/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (

"fmt"

"go.mozilla.org/sops"
"go.mozilla.org/sops/cmd/sops/common"
"go.mozilla.org/sops/keyservice"
"go.mozilla.org/sops/v3"
"go.mozilla.org/sops/v3/cmd/sops/common"
"go.mozilla.org/sops/v3/keyservice"
)

// DeleteOpts are the options for deleting a key group from a SOPS file
Expand Down
4 changes: 2 additions & 2 deletions cmd/sops/subcommand/keyservice/keyservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"os/signal"
"syscall"

"go.mozilla.org/sops/keyservice"
"go.mozilla.org/sops/logging"
"go.mozilla.org/sops/v3/keyservice"
"go.mozilla.org/sops/v3/logging"

"github.com/sirupsen/logrus"
"google.golang.org/grpc"
Expand Down
16 changes: 8 additions & 8 deletions cmd/sops/subcommand/publish/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import (
"os"
"path/filepath"

"go.mozilla.org/sops"
"go.mozilla.org/sops/cmd/sops/codes"
"go.mozilla.org/sops/cmd/sops/common"
"go.mozilla.org/sops/config"
"go.mozilla.org/sops/keyservice"
"go.mozilla.org/sops/logging"
"go.mozilla.org/sops/publish"
"go.mozilla.org/sops/version"
"go.mozilla.org/sops/v3"
"go.mozilla.org/sops/v3/cmd/sops/codes"
"go.mozilla.org/sops/v3/cmd/sops/common"
"go.mozilla.org/sops/v3/config"
"go.mozilla.org/sops/v3/keyservice"
"go.mozilla.org/sops/v3/logging"
"go.mozilla.org/sops/v3/publish"
"go.mozilla.org/sops/v3/version"

"github.com/sirupsen/logrus"
)
Expand Down
8 changes: 4 additions & 4 deletions cmd/sops/subcommand/updatekeys/updatekeys.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"os"
"path/filepath"

"go.mozilla.org/sops/cmd/sops/codes"
"go.mozilla.org/sops/cmd/sops/common"
"go.mozilla.org/sops/config"
"go.mozilla.org/sops/keyservice"
"go.mozilla.org/sops/v3/cmd/sops/codes"
"go.mozilla.org/sops/v3/cmd/sops/common"
"go.mozilla.org/sops/v3/config"
"go.mozilla.org/sops/v3/keyservice"
)

// Opts represents key operation options and config
Expand Down
Loading