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

chore(deps): update registry.suse.com/bci/golang docker tag to v1.23 (master) #639

Merged
merged 3 commits into from
Sep 8, 2024
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
6 changes: 4 additions & 2 deletions Dockerfile.dapper
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.suse.com/bci/golang:1.22
FROM registry.suse.com/bci/golang:1.23

ARG DAPPER_HOST_ARCH
ARG http_proxy
Expand All @@ -11,6 +11,8 @@ ENV DAPPER_OUTPUT bin coverage.out
ENV DAPPER_RUN_ARGS --privileged --tmpfs /go/src/github.com/longhorn/longhorn-engine/integration/.venv:exec --tmpfs /go/src/github.com/longhorn/longhorn-engine/integration/.tox:exec -v /dev:/host/dev -v /proc:/host/proc
ENV DAPPER_SOURCE /go/src/github.com/longhorn/longhorn-instance-manager

ENV GOLANGCI_LINT_VERSION="v1.60.3"

WORKDIR ${DAPPER_SOURCE}

ENTRYPOINT ["./scripts/entry"]
Expand All @@ -29,7 +31,7 @@ RUN zypper -n install cmake wget curl git less file \
rm -rf /var/cache/zypp/*

# Install golanci-lint
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /go/bin v1.55.2
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCI_LINT_VERSION}

# Install libqcow to resolve error:
# vendor/github.com/longhorn/longhorn-engine/pkg/qcow/libqcow.go:6:11: fatal error: libqcow.h: No such file or directory
Expand Down
3 changes: 1 addition & 2 deletions app/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package cmd
import (
"context"
"crypto/tls"
"fmt"
"net"
"net/http"
_ "net/http/pprof" // for runtime profiling
Expand Down Expand Up @@ -189,7 +188,7 @@ func start(c *cli.Context) (err error) {
debugHandler := http.DefaultServeMux
logrus.Infof("Debug pprof server listening on %s", debugAddress)
if err := http.ListenAndServe(debugAddress, debugHandler); err != nil && err != http.ErrServerClosed {
logrus.Errorf(fmt.Sprintf("ListenAndServe: %s", err))
logrus.Errorf("ListenAndServe: %s", err)
}
}()

Expand Down
2 changes: 1 addition & 1 deletion package/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Stage 1: build binary from go source code
FROM registry.suse.com/bci/golang:1.22 AS gobuilder
FROM registry.suse.com/bci/golang:1.23 AS gobuilder

ARG ARCH=amd64

Expand Down
18 changes: 9 additions & 9 deletions pkg/proxy/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (

func (p *Proxy) CleanupBackupMountPoints(ctx context.Context, req *emptypb.Empty) (resp *emptypb.Empty, err error) {
if err := backupstore.CleanUpAllMounts(); err != nil {
return &emptypb.Empty{}, grpcstatus.Errorf(grpccodes.Internal, errors.Wrapf(err, "failed to unmount all mount points").Error())
return &emptypb.Empty{}, grpcstatus.Errorf(grpccodes.Internal, "failed to unmount all mount points: %v", err)
}
return &emptypb.Empty{}, nil
}
Expand All @@ -48,7 +48,7 @@ func (p *Proxy) SnapshotBackup(ctx context.Context, req *rpc.EngineSnapshotBacku

credential, err := butil.GetBackupCredential(req.BackupTarget)
if err != nil {
return nil, grpcstatus.Errorf(grpccodes.InvalidArgument, errors.Wrapf(err, "failed to get backup credential").Error())
return nil, grpcstatus.Errorf(grpccodes.InvalidArgument, "failed to get backup credential: %v", err)
}

labels := getLabels(req.Labels)
Expand Down Expand Up @@ -93,7 +93,7 @@ func (ops V1DataEngineProxyOps) SnapshotBackup(ctx context.Context, req *rpc.Eng
func (ops V2DataEngineProxyOps) SnapshotBackup(ctx context.Context, req *rpc.EngineSnapshotBackupRequest, credential map[string]string, labels []string) (resp *rpc.EngineSnapshotBackupProxyResponse, err error) {
c, err := getSPDKClientFromAddress(req.ProxyEngineRequest.Address)
if err != nil {
return nil, grpcstatus.Errorf(grpccodes.Internal, errors.Wrapf(err, "failed to get SPDK client from engine address %v", req.ProxyEngineRequest.Address).Error())
return nil, grpcstatus.Errorf(grpccodes.Internal, "failed to get SPDK client from engine address %v: %v", req.ProxyEngineRequest.Address, err)
}
defer c.Close()

Expand Down Expand Up @@ -223,13 +223,13 @@ func (ops V1DataEngineProxyOps) SnapshotBackupStatus(ctx context.Context, req *r
func (ops V2DataEngineProxyOps) SnapshotBackupStatus(ctx context.Context, req *rpc.EngineSnapshotBackupStatusRequest) (resp *rpc.EngineSnapshotBackupStatusProxyResponse, err error) {
c, err := getSPDKClientFromAddress(req.ProxyEngineRequest.Address)
if err != nil {
return nil, grpcstatus.Errorf(grpccodes.Internal, errors.Wrapf(err, "failed to get SPDK client from engine address %v", req.ProxyEngineRequest.Address).Error())
return nil, grpcstatus.Errorf(grpccodes.Internal, "failed to get SPDK client from engine address %v: %v", req.ProxyEngineRequest.Address, err)
}
defer c.Close()

status, err := c.EngineBackupStatus(req.BackupName, req.ProxyEngineRequest.EngineName, req.ReplicaAddress)
if err != nil {
return nil, grpcstatus.Errorf(grpccodes.Internal, errors.Wrapf(err, "failed to get backup status").Error())
return nil, grpcstatus.Errorf(grpccodes.Internal, "failed to get backup status: %v", err)
}

return &rpc.EngineSnapshotBackupStatusProxyResponse{
Expand Down Expand Up @@ -257,7 +257,7 @@ func (p *Proxy) BackupRestore(ctx context.Context, req *rpc.EngineBackupRestoreR

credential, err := butil.GetBackupCredential(req.Target)
if err != nil {
return nil, grpcstatus.Errorf(grpccodes.InvalidArgument, errors.Wrapf(err, "failed to get backup credential").Error())
return nil, grpcstatus.Errorf(grpccodes.InvalidArgument, "failed to get backup credential: %v", err)
}

resp = &rpc.EngineBackupRestoreProxyResponse{
Expand Down Expand Up @@ -297,7 +297,7 @@ func (ops V1DataEngineProxyOps) BackupRestore(ctx context.Context, req *rpc.Engi
func (ops V2DataEngineProxyOps) BackupRestore(ctx context.Context, req *rpc.EngineBackupRestoreRequest, credential map[string]string) error {
c, err := getSPDKClientFromAddress(req.ProxyEngineRequest.Address)
if err != nil {
return grpcstatus.Errorf(grpccodes.Internal, errors.Wrapf(err, "failed to get SPDK client from engine address %v", req.ProxyEngineRequest.Address).Error())
return grpcstatus.Errorf(grpccodes.Internal, "failed to get SPDK client from engine address %v: %v", req.ProxyEngineRequest.Address, err)
}
defer c.Close()

Expand Down Expand Up @@ -358,13 +358,13 @@ func (ops V1DataEngineProxyOps) BackupRestoreStatus(ctx context.Context, req *rp
func (ops V2DataEngineProxyOps) BackupRestoreStatus(ctx context.Context, req *rpc.ProxyEngineRequest) (resp *rpc.EngineBackupRestoreStatusProxyResponse, err error) {
c, err := getSPDKClientFromAddress(req.Address)
if err != nil {
return nil, grpcstatus.Errorf(grpccodes.Internal, errors.Wrapf(err, "failed to get SPDK client from engine address %v", req.Address).Error())
return nil, grpcstatus.Errorf(grpccodes.Internal, "failed to get SPDK client from engine address %v: %v", req.Address, err)
}
defer c.Close()

recv, err := c.EngineRestoreStatus(req.EngineName)
if err != nil {
return nil, grpcstatus.Errorf(grpccodes.Internal, errors.Wrapf(err, "failed to get restore status").Error())
return nil, grpcstatus.Errorf(grpccodes.Internal, "failed to get restore status: %v", err)
}

resp = &rpc.EngineBackupRestoreStatusProxyResponse{
Expand Down
14 changes: 7 additions & 7 deletions pkg/proxy/replica.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ func (ops V1DataEngineProxyOps) ReplicaAdd(ctx context.Context, req *rpc.EngineR
func (ops V2DataEngineProxyOps) ReplicaAdd(ctx context.Context, req *rpc.EngineReplicaAddRequest) (resp *emptypb.Empty, err error) {
c, err := getSPDKClientFromAddress(req.ProxyEngineRequest.Address)
if err != nil {
return nil, grpcstatus.Errorf(grpccodes.Internal, errors.Wrapf(err, "failed to get SPDK client from engine address %v", req.ProxyEngineRequest.Address).Error())
return nil, grpcstatus.Errorf(grpccodes.Internal, "failed to get SPDK client from engine address %v: %v", req.ProxyEngineRequest.Address, err)
}
defer c.Close()

replicaAddress := strings.TrimPrefix(req.ReplicaAddress, "tcp://")

err = c.EngineReplicaAdd(req.ProxyEngineRequest.EngineName, req.ReplicaName, replicaAddress)
if err != nil {
return nil, grpcstatus.Errorf(grpccodes.Internal, errors.Wrapf(err, "failed to add replica %v", replicaAddress).Error())
return nil, grpcstatus.Errorf(grpccodes.Internal, "failed to add replica %v: %v", replicaAddress, err)
}
return &emptypb.Empty{}, nil
}
Expand Down Expand Up @@ -147,7 +147,7 @@ func replicaModeToGRPCReplicaMode(mode spdktypes.Mode) enginerpc.ReplicaMode {
func (ops V2DataEngineProxyOps) ReplicaList(ctx context.Context, req *rpc.ProxyEngineRequest) (resp *rpc.EngineReplicaListProxyResponse, err error) {
c, err := getSPDKClientFromAddress(req.Address)
if err != nil {
return nil, grpcstatus.Errorf(grpccodes.Internal, errors.Wrapf(err, "failed to get SPDK client from engine address %v", req.Address).Error())
return nil, grpcstatus.Errorf(grpccodes.Internal, "failed to get SPDK client from engine address %v: %v", req.Address, err)
}
defer c.Close()

Expand Down Expand Up @@ -224,13 +224,13 @@ func (ops V1DataEngineProxyOps) ReplicaRebuildingStatus(ctx context.Context, req
func (ops V2DataEngineProxyOps) ReplicaRebuildingStatus(ctx context.Context, req *rpc.ProxyEngineRequest) (resp *rpc.EngineReplicaRebuildStatusProxyResponse, err error) {
engineCli, err := getSPDKClientFromAddress(req.Address)
if err != nil {
return nil, grpcstatus.Errorf(grpccodes.Internal, errors.Wrapf(err, "failed to get SPDK client from engine address %v", req.Address).Error())
return nil, grpcstatus.Errorf(grpccodes.Internal, "failed to get SPDK client from engine address %v: %v", req.Address, err)
}
defer engineCli.Close()

e, err := engineCli.EngineGet(req.EngineName)
if err != nil {
return nil, grpcstatus.Errorf(grpccodes.Internal, errors.Wrapf(err, "failed to get engine %v", req.EngineName).Error())
return nil, grpcstatus.Errorf(grpccodes.Internal, "failed to get engine %v: %v", req.EngineName, err)
}

resp = &rpc.EngineReplicaRebuildStatusProxyResponse{
Expand All @@ -248,7 +248,7 @@ func (ops V2DataEngineProxyOps) ReplicaRebuildingStatus(ctx context.Context, req
tcpReplicaAddress := types.AddTcpPrefixForAddress(replicaAddress)
replicaCli, err := getSPDKClientFromAddress(replicaAddress)
if err != nil {
return nil, grpcstatus.Errorf(grpccodes.Internal, errors.Wrapf(err, "failed to get SPDK client from replica address %v", replicaAddress).Error())
return nil, grpcstatus.Errorf(grpccodes.Internal, "failed to get SPDK client from replica address %v: %v", replicaAddress, err)
}
defer replicaCli.Close()

Expand Down Expand Up @@ -335,7 +335,7 @@ func (ops V1DataEngineProxyOps) ReplicaRemove(ctx context.Context, req *rpc.Engi
func (ops V2DataEngineProxyOps) ReplicaRemove(ctx context.Context, req *rpc.EngineReplicaRemoveRequest) (*emptypb.Empty, error) {
c, err := getSPDKClientFromAddress(req.ProxyEngineRequest.Address)
if err != nil {
return nil, grpcstatus.Errorf(grpccodes.Internal, errors.Wrapf(err, "failed to get SPDK client from engine address %v", req.ProxyEngineRequest.Address).Error())
return nil, grpcstatus.Errorf(grpccodes.Internal, "failed to get SPDK client from engine address %v: %v", req.ProxyEngineRequest.Address, err)
}
defer c.Close()

Expand Down
12 changes: 6 additions & 6 deletions pkg/proxy/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (ops V1DataEngineProxyOps) VolumeSnapshot(ctx context.Context, req *rpc.Eng
func (ops V2DataEngineProxyOps) VolumeSnapshot(ctx context.Context, req *rpc.EngineVolumeSnapshotRequest) (resp *rpc.EngineVolumeSnapshotProxyResponse, err error) {
c, err := getSPDKClientFromAddress(req.ProxyEngineRequest.Address)
if err != nil {
return nil, grpcstatus.Errorf(grpccodes.Internal, errors.Wrapf(err, "failed to get SPDK client from engine address %v", req.ProxyEngineRequest.Address).Error())
return nil, grpcstatus.Errorf(grpccodes.Internal, "failed to get SPDK client from engine address %v: %v", req.ProxyEngineRequest.Address, err)
}
defer c.Close()

Expand All @@ -67,7 +67,7 @@ func (ops V2DataEngineProxyOps) VolumeSnapshot(ctx context.Context, req *rpc.Eng

_, err = c.EngineSnapshotCreate(req.ProxyEngineRequest.EngineName, snapshotName)
if err != nil {
return nil, grpcstatus.Errorf(grpccodes.Internal, errors.Wrapf(err, "failed to create snapshot %v", snapshotName).Error())
return nil, grpcstatus.Errorf(grpccodes.Internal, "failed to create snapshot %v: %v", snapshotName, err)
}
return &rpc.EngineVolumeSnapshotProxyResponse{
Snapshot: &enginerpc.VolumeSnapshotReply{
Expand Down Expand Up @@ -299,13 +299,13 @@ func (ops V1DataEngineProxyOps) SnapshotRevert(ctx context.Context, req *rpc.Eng
func (ops V2DataEngineProxyOps) SnapshotRevert(ctx context.Context, req *rpc.EngineSnapshotRevertRequest) (resp *emptypb.Empty, err error) {
c, err := getSPDKClientFromAddress(req.ProxyEngineRequest.Address)
if err != nil {
return nil, grpcstatus.Errorf(grpccodes.Internal, errors.Wrapf(err, "failed to get SPDK client from engine address %v", req.ProxyEngineRequest.Address).Error())
return nil, grpcstatus.Errorf(grpccodes.Internal, "failed to get SPDK client from engine address %v: %v", req.ProxyEngineRequest.Address, err)
}
defer c.Close()

err = c.EngineSnapshotRevert(req.ProxyEngineRequest.EngineName, req.Name)
if err != nil {
return nil, grpcstatus.Errorf(grpccodes.Internal, errors.Wrapf(err, "failed to create snapshot %v", req.Name).Error())
return nil, grpcstatus.Errorf(grpccodes.Internal, "failed to create snapshot %v: %v", req.Name, err)
}

return &emptypb.Empty{}, nil
Expand Down Expand Up @@ -344,7 +344,7 @@ func (ops V1DataEngineProxyOps) SnapshotPurge(ctx context.Context, req *rpc.Engi
func (ops V2DataEngineProxyOps) SnapshotPurge(ctx context.Context, req *rpc.EngineSnapshotPurgeRequest) (resp *emptypb.Empty, err error) {
c, err := getSPDKClientFromAddress(req.ProxyEngineRequest.Address)
if err != nil {
return nil, grpcstatus.Errorf(grpccodes.Internal, errors.Wrapf(err, "failed to get SPDK client from engine address %v", req.ProxyEngineRequest.Address).Error())
return nil, grpcstatus.Errorf(grpccodes.Internal, "failed to get SPDK client from engine address %v: %v", req.ProxyEngineRequest.Address, err)
}
defer c.Close()

Expand Down Expand Up @@ -441,7 +441,7 @@ func (ops V1DataEngineProxyOps) SnapshotRemove(ctx context.Context, req *rpc.Eng
func (ops V2DataEngineProxyOps) SnapshotRemove(ctx context.Context, req *rpc.EngineSnapshotRemoveRequest) (resp *emptypb.Empty, err error) {
c, err := getSPDKClientFromAddress(req.ProxyEngineRequest.Address)
if err != nil {
return nil, grpcstatus.Errorf(grpccodes.Internal, errors.Wrapf(err, "failed to get SPDK client from engine address %v", req.ProxyEngineRequest.Address).Error())
return nil, grpcstatus.Errorf(grpccodes.Internal, "failed to get SPDK client from engine address %v: %v", req.ProxyEngineRequest.Address, err)
}
defer c.Close()

Expand Down
5 changes: 2 additions & 3 deletions pkg/proxy/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
eclient "github.com/longhorn/longhorn-engine/pkg/controller/client"
"github.com/longhorn/types/pkg/generated/enginerpc"
rpc "github.com/longhorn/types/pkg/generated/imrpc"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"golang.org/x/net/context"
grpccodes "google.golang.org/grpc/codes"
Expand Down Expand Up @@ -68,13 +67,13 @@ func (ops V1DataEngineProxyOps) VolumeGet(ctx context.Context, req *rpc.ProxyEng
func (ops V2DataEngineProxyOps) VolumeGet(ctx context.Context, req *rpc.ProxyEngineRequest) (resp *rpc.EngineVolumeGetProxyResponse, err error) {
c, err := getSPDKClientFromAddress(req.Address)
if err != nil {
return nil, grpcstatus.Errorf(grpccodes.Internal, errors.Wrapf(err, "failed to get SPDK client from engine address %v", req.Address).Error())
return nil, grpcstatus.Errorf(grpccodes.Internal, "failed to get SPDK client from engine address %v: %v", req.Address, err)
}
defer c.Close()

recv, err := c.EngineGet(req.EngineName)
if err != nil {
return nil, grpcstatus.Errorf(grpccodes.Internal, errors.Wrapf(err, "failed to get engine %v", req.EngineName).Error())
return nil, grpcstatus.Errorf(grpccodes.Internal, "failed to get engine %v: %v", req.EngineName, err)
}

return &rpc.EngineVolumeGetProxyResponse{
Expand Down