Skip to content
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
28 changes: 28 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: "2"
linters:
default: standard
enable:
- unparam

formatters:
enable:
- gofmt
- goimports
settings:
gofmt:
rewrite-rules:
- pattern: 'interface{}'
replacement: 'any'

issues:
max-same-issues: 100

exclude-files:
- generated.*\\.go

exclude-dirs:
- client
- vendor

run:
timeout: 10m
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ lint: $(BUILD_DIRS)
--env GO111MODULE=on \
--env GOFLAGS="-mod=vendor" \
$(BUILD_IMAGE) \
golangci-lint run --enable $(ADDTL_LINTERS) --timeout=30m --exclude-files="generated.*\.go$\" --exclude-dirs-use-default --exclude-dirs=client,vendor
golangci-lint run

$(BUILD_DIRS):
@mkdir -p $@
Expand Down
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module stash.appscode.dev/etcd

go 1.23.0

toolchain go1.24.4
go 1.24.0

require (
github.com/spf13/cobra v1.8.0
Expand Down
43 changes: 0 additions & 43 deletions lintconf.yaml

This file was deleted.

10 changes: 5 additions & 5 deletions pkg/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func (opt *options) createRestorePods(memberPod corev1.Pod, args []string) (*cor

for _, vol := range memberPod.Spec.Volumes {
if vol.Name == dataVolume {
pvcName = vol.VolumeSource.PersistentVolumeClaim.ClaimName
pvcName = vol.PersistentVolumeClaim.ClaimName
break
}
}
Expand Down Expand Up @@ -285,7 +285,7 @@ func (opt *options) replaceOldDataWithRestoredData(restorePods []corev1.Pod) err
command := []string{StashEtcd, "replace"}
command = append(command, "--data-dir="+opt.etcd.dataDir)

execOut, err := opt.execCommandOnPod(&pod, pod.ObjectMeta.Name, command)
execOut, err := opt.execCommandOnPod(&pod, pod.Name, command)
if err != nil {
return err
}
Expand Down Expand Up @@ -388,7 +388,7 @@ func (opt *options) getEtcdMemberPods() ([]corev1.Pod, error) {
}
return []corev1.Pod{*pod}, nil
default:
return nil, errors.New("Could not find any member for etcd server")
return nil, errors.New("could not find any member for etcd server")
}
}

Expand Down Expand Up @@ -422,7 +422,7 @@ func (opt *options) execCommandOnPod(pod *corev1.Pod, containerName string, comm
Tty: true,
})
if err != nil {
return nil, fmt.Errorf("Could not execute: %v, reason: %s", err, execErr.String())
return nil, fmt.Errorf("could not execute: %v, reason: %s", err, execErr.String())
}

return execOut.Bytes(), nil
Expand Down Expand Up @@ -545,7 +545,7 @@ func (opt *options) getCredential(appBinding *appcatalog.AppBinding) ([]string,
tlsArgs = fmt.Sprintf("--key=%v", filepath.Join(opt.setupOptions.ScratchDir, EtcdClientKeyFile))
args = append(args, tlsArgs)
} else {
return nil, errors.New("Client cert and client key needed for TLS secured operation")
return nil, errors.New("client cert and client key needed for TLS secured operation")
}

return args, nil
Expand Down
Loading