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

Misc updates #94

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
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
39 changes: 15 additions & 24 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,34 @@ name: Test
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.15.x, 1.16.x]

services:
etc:
image: quay.io/coreos/etcd
etcd:
image: bitnami/etcd:3.5
ports:
- 2379:2379
env:
ETCD_ADVERTISE_CLIENT_URLS: http://0.0.0.0:2379
ETCD_LISTEN_CLIENT_URLS: http://0.0.0.0:2379
consul:
image: consul
image: hashicorp/consul:1.18
ports:
- 8500:8500
vault096:
image: vault:0.9.6
vault:
image: hashicorp/vault:1.15
ports:
- 8200:8200
env:
VAULT_DEV_ROOT_TOKEN_ID: root
VAULT_DEV_LISTEN_ADDRESS: 0.0.0.0:8200
vault010:
image: vault:0.10.0
ports:
- 8222:8200
env:
VAULT_DEV_ROOT_TOKEN_ID: root
VAULT_DEV_LISTEN_ADDRESS: 0.0.0.0:8200

steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Test
run: make test
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
cache: true
check-latest: true
go-version-file: go.mod
- name: Test
run: make test
34 changes: 0 additions & 34 deletions .travis.yml

This file was deleted.

1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ VAULT_ADDR ?= http://127.0.0.1:8200
.PHONY: test

test:
go build
VAULT_ADDR="$(VAULT_ADDR)" \
go test -v -race -cover -timeout=1m ./... && echo OK || (echo FAIL && exit 1)
4 changes: 2 additions & 2 deletions backend/etcd/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"path"
"strings"

"github.com/coreos/etcd/clientv3"
"github.com/heetch/confita/backend"
clientv3 "go.etcd.io/etcd/client/v3"
)

// Backend loads keys from etcd.
Expand Down Expand Up @@ -70,7 +70,7 @@ func (b *Backend) fetchTree(ctx context.Context) error {
return nil
}

func (b *Backend) fromCache(ctx context.Context, key string) ([]byte, error) {
func (b *Backend) fromCache(_ context.Context, key string) ([]byte, error) {
v, ok := b.cache[key]
if !ok {
return nil, backend.ErrNotFound
Expand Down
3 changes: 2 additions & 1 deletion backend/etcd/etcd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"context"
"testing"

"github.com/coreos/etcd/clientv3"
"github.com/heetch/confita/backend"
"github.com/stretchr/testify/require"
clientv3 "go.etcd.io/etcd/client/v3"
)

func TestEtcdBackend(t *testing.T) {
Expand Down Expand Up @@ -48,6 +48,7 @@ func TestEtcdBackendWithPrefetch(t *testing.T) {

val, err := b.Get(ctx, "key1")
require.NoError(t, err)
require.Equal(t, []byte("value1"), val)

// deleting the tree
client.KV.Delete(ctx, prefix, clientv3.WithPrefix())
Expand Down
82 changes: 53 additions & 29 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,38 +1,62 @@
module github.com/heetch/confita

go 1.22

require (
github.com/BurntSushi/toml v0.3.1
github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878 // indirect
github.com/aws/aws-sdk-go v1.23.20
github.com/coreos/bbolt v1.3.2 // indirect
github.com/coreos/etcd v3.3.3+incompatible
github.com/coreos/go-semver v0.3.0 // indirect
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e // indirect
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect
github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/gogo/protobuf v1.2.0 // indirect
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef // indirect
github.com/google/btree v1.0.0 // indirect
github.com/gorilla/websocket v1.4.0 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.8.6 // indirect
github.com/hashicorp/consul/api v1.1.0
github.com/hashicorp/go-msgpack v0.5.5 // indirect
github.com/hashicorp/vault/api v1.0.4
github.com/jonboulle/clockwork v0.1.0 // indirect
github.com/pkg/errors v0.8.1
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829 // indirect
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 // indirect
github.com/soheilhy/cmux v0.1.4 // indirect
github.com/stretchr/testify v1.4.0
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 // indirect
github.com/ugorji/go v1.1.4 // indirect
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 // indirect
go.etcd.io/bbolt v1.3.2 // indirect
golang.org/x/crypto v0.0.0-20190506204251-e1dfcc566284 // indirect
golang.org/x/sys v0.0.0-20190508220229-2d0786266e9c // indirect
gopkg.in/yaml.v2 v2.2.2
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.8.4
go.etcd.io/etcd/client/v3 v3.5.12
gopkg.in/yaml.v2 v2.4.0
)

go 1.12
require (
github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878 // indirect
github.com/coreos/go-semver v0.3.0 // indirect
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.1 // indirect
github.com/google/btree v1.0.0 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.1 // indirect
github.com/hashicorp/go-immutable-radix v1.0.0 // indirect
github.com/hashicorp/go-msgpack v0.5.5 // indirect
github.com/hashicorp/go-multierror v1.0.0 // indirect
github.com/hashicorp/go-retryablehttp v0.5.4 // indirect
github.com/hashicorp/go-rootcerts v1.0.1 // indirect
github.com/hashicorp/go-sockaddr v1.0.2 // indirect
github.com/hashicorp/golang-lru v0.5.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/serf v0.8.2 // indirect
github.com/hashicorp/vault/sdk v0.1.13 // indirect
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af // indirect
github.com/kr/pretty v0.1.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.1.2 // indirect
github.com/pierrec/lz4 v2.0.5+incompatible // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/ryanuber/go-glob v1.0.0 // indirect
go.etcd.io/etcd/api/v3 v3.5.12 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.12 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.17.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect
google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/grpc v1.59.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/square/go-jose.v2 v2.3.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading
Loading