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

*: update to etcd 3.5 #71

Merged
merged 4 commits into from
Sep 13, 2021
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
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#Min version required
#See: https://github.com/golang/go/issues/29278#issuecomment-447537558
FROM golang:1.13.3-alpine AS build-env
FROM golang:1.16-alpine3.12 AS build-env

WORKDIR /go/src/github.com/quentin-m/etcd-cloud-operator

# Install & Cache dependencies
RUN apk add --no-cache git curl gcc musl-dev
# Install & cache dependencies
RUN apk add --no-cache git curl gcc musl-dev ca-certificates openssl wget
RUN update-ca-certificates

RUN apk add --update openssl && \
wget https://github.com/coreos/etcd/releases/download/v3.4.13/etcd-v3.4.13-linux-amd64.tar.gz -O /tmp/etcd.tar.gz && \
RUN wget https://github.com/etcd-io/etcd/releases/download/v3.5.0-alpha.0/etcd-v3.5.0-alpha.0-linux-amd64.tar.gz -O /tmp/etcd.tar.gz && \
mkdir /etcd && \
tar xzvf /tmp/etcd.tar.gz -C /etcd --strip-components=1 && \
rm /tmp/etcd.tar.gz
Expand Down
7 changes: 4 additions & 3 deletions cmd/operator/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@
package main

import (
"gopkg.in/yaml.v2"
"io/ioutil"
"os"
"time"

"go.uber.org/zap"

"github.com/quentin-m/etcd-cloud-operator/pkg/etcd"
"github.com/quentin-m/etcd-cloud-operator/pkg/operator"
"github.com/quentin-m/etcd-cloud-operator/pkg/providers/snapshot"
log "github.com/sirupsen/logrus"
"gopkg.in/yaml.v2"
)

// config represents a YAML configuration file that namespaces all ECO
Expand Down Expand Up @@ -86,6 +87,6 @@ func loadConfig(path string) (config, error) {
return config, err
}

log.Infof("loaded configuration file %v", path)
zap.S().Infof("loaded configuration file %v", path)
return config, err
}
17 changes: 2 additions & 15 deletions cmd/operator/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,9 @@ package main

import (
"flag"
"io/ioutil"
"os"
"strings"

"github.com/coreos/pkg/capnslog"
log "github.com/sirupsen/logrus"
etcdcl "go.etcd.io/etcd/clientv3"
"go.uber.org/zap"
"google.golang.org/grpc/grpclog"

"github.com/quentin-m/etcd-cloud-operator/pkg/logger"
"github.com/quentin-m/etcd-cloud-operator/pkg/operator"
Expand All @@ -46,19 +40,12 @@ func main() {
flag.Parse()

// Initialize logging system.
logLevel, err := log.ParseLevel(strings.ToUpper(*flagLogLevel))
log.SetOutput(os.Stdout)
log.SetLevel(logLevel)
log.SetFormatter(&log.TextFormatter{FullTimestamp: true})

capnslog.MustRepoLogger("go.etcd.io/etcd").SetLogLevel(map[string]capnslog.LogLevel{"etcdserver/api/v3rpc": capnslog.CRITICAL}) // TODO: Remove me after v3.5
etcdcl.SetLogger(grpclog.NewLoggerV2(ioutil.Discard, ioutil.Discard, os.Stderr))
zap.ReplaceGlobals(logger.BuildZapLogger(*flagLogLevel))
logger.Configure(*flagLogLevel)

// Read configuration.
config, err := loadConfig(*flagConfigPath)
if err != nil {
log.WithError(err).Fatal("failed to load configuration")
zap.S().With(zap.Error(err)).Fatal("failed to load configuration")
}

// Run.
Expand Down
4 changes: 2 additions & 2 deletions cmd/tester/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"io/ioutil"
"os"

log "github.com/sirupsen/logrus"
"go.uber.org/zap"
"gopkg.in/yaml.v2"

"github.com/quentin-m/etcd-cloud-operator/pkg/tester"
Expand Down Expand Up @@ -53,6 +53,6 @@ func loadConfig(path string) (config, error) {
return config, err
}

log.Infof("loaded configuration file %v", path)
zap.S().Infof("loaded configuration file %v", path)
return config, err
}
13 changes: 4 additions & 9 deletions cmd/tester/tester.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ package main
import (
"flag"
"os"
"strings"

"github.com/coreos/pkg/capnslog"
log "github.com/sirupsen/logrus"
"go.uber.org/zap"

"github.com/quentin-m/etcd-cloud-operator/pkg/logger"
"github.com/quentin-m/etcd-cloud-operator/pkg/tester"
)

Expand All @@ -34,16 +33,12 @@ func main() {
flag.Parse()

// Initialize logging system.
logLevel, err := log.ParseLevel(strings.ToUpper(*flagLogLevel))
log.SetOutput(os.Stdout)
log.SetLevel(logLevel)
log.SetFormatter(&log.TextFormatter{FullTimestamp: true})
capnslog.MustRepoLogger("go.etcd.io/etcd").SetLogLevel(map[string]capnslog.LogLevel{"etcdserver/api/v3rpc": capnslog.CRITICAL})
logger.Configure(*flagLogLevel)

// Read configuration.
config, err := loadConfig(*flagConfigPath)
if err != nil {
log.WithError(err).Fatal("failed to load configuration")
zap.S().With(zap.Error(err)).Fatal("failed to load configuration")
}

// Run.
Expand Down
28 changes: 14 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
module github.com/quentin-m/etcd-cloud-operator

go 1.13
go 1.16

require (
github.com/aws/aws-sdk-go v1.29.19
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf
github.com/prometheus/client_golang v1.0.0
github.com/sirupsen/logrus v1.4.2
go.etcd.io/etcd v0.0.0-20200824191128-ae9734ed278b
go.uber.org/zap v1.10.0
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4
google.golang.org/grpc v1.26.0
gopkg.in/yaml.v2 v2.2.8
k8s.io/api v0.17.3
k8s.io/apimachinery v0.17.3
k8s.io/client-go v0.17.3
github.com/aws/aws-sdk-go v1.38.34
github.com/prometheus/client_golang v1.11.0
go.etcd.io/etcd/api/v3 v3.5.0
go.etcd.io/etcd/client/pkg/v3 v3.5.0
go.etcd.io/etcd/client/v3 v3.5.0
go.etcd.io/etcd/etcdutl/v3 v3.5.0
go.etcd.io/etcd/server/v3 v3.5.0
go.uber.org/zap v1.17.0
golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba
google.golang.org/grpc v1.38.0
gopkg.in/yaml.v2 v2.4.0
moul.io/zapfilter v1.6.1
)
Loading