Skip to content

Commit 7a1c861

Browse files
committed
cleanup
1 parent fa01a49 commit 7a1c861

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+542
-2878
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
FROM --platform=linux/ppc64le k8s.gcr.io/build-image/debian-base:v2.1.3 AS debian-base
77
RUN clean-install ca-certificates e2fsprogs mount udev util-linux xfsprogs
8+
RUN clean-install bash multipath-tools sg3-utils
89
# COPY --from=builder /go/src/github.com/ppc64le-cloud/powervs-csi-driver/bin/powervs-csi-driver /bin/powervs-csi-driver
910
COPY ./bin/powervs-csi-driver /bin/powervs-csi-driver
1011

Makefile

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -31,59 +31,10 @@ PLATFORM=linux/ppc64le
3131
bin/powervs-csi-driver: | bin
3232
CGO_ENABLED=0 GOOS=linux GOARCH=ppc64le go build -ldflags ${LDFLAGS} -o bin/powervs-csi-driver ./cmd/
3333

34-
bin /tmp/helm /tmp/kubeval:
35-
@mkdir -p $@
36-
37-
bin/helm: | /tmp/helm bin
38-
@curl -o /tmp/helm/helm.tar.gz -sSL https://get.helm.sh/helm-v3.1.2-${GOOS}-amd64.tar.gz
39-
@tar -zxf /tmp/helm/helm.tar.gz -C bin --strip-components=1
40-
@rm -rf /tmp/helm/*
41-
42-
bin/kubeval: | /tmp/kubeval bin
43-
@curl -o /tmp/kubeval/kubeval.tar.gz -sSL https://github.com/instrumenta/kubeval/releases/download/0.15.0/kubeval-linux-amd64.tar.gz
44-
@tar -zxf /tmp/kubeval/kubeval.tar.gz -C bin kubeval
45-
@rm -rf /tmp/kubeval/*
46-
47-
bin/mockgen: | bin
48-
go get github.com/golang/mock/mockgen@latest
49-
50-
bin/golangci-lint: | bin
51-
echo "Installing golangci-lint..."
52-
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.21.0
53-
54-
.PHONY: kubeval
55-
kubeval: bin/kubeval
56-
bin/kubeval -d deploy/kubernetes/base,deploy/kubernetes/cluster,deploy/kubernetes/overlays -i kustomization.yaml,crd_.+\.yaml,controller_add
57-
58-
mockgen: bin/mockgen
59-
./hack/update-gomock
60-
61-
.PHONY: verify
62-
verify: bin/golangci-lint
63-
echo "verifying and linting files ..."
64-
./hack/verify-all
65-
echo "Congratulations! All Go source files have been linted."
66-
6734
.PHONY: test
6835
test:
6936
go test -v -race ./cmd/... ./pkg/...
7037

71-
.PHONY: test-sanity
72-
test-sanity:
73-
#go test -v ./tests/sanity/...
74-
echo "succeed"
75-
76-
bin/k8s-e2e-tester: | bin
77-
go get github.com/aws/aws-k8s-tester/e2e/tester/cmd/k8s-e2e-tester@master
78-
79-
.PHONY: test-e2e-single-az
80-
test-e2e-single-az: bin/k8s-e2e-tester
81-
TESTCONFIG=./tester/single-az-config.yaml ${GOBIN}/k8s-e2e-tester
82-
83-
.PHONY: test-e2e-multi-az
84-
test-e2e-multi-az: bin/k8s-e2e-tester
85-
TESTCONFIG=./tester/multi-az-config.yaml ${GOBIN}/k8s-e2e-tester
86-
8738
.PHONY: image-release
8839
image-release:
8940
docker buildx build -t $(IMAGE):$(VERSION) . --target debian-base
@@ -95,19 +46,11 @@ image:
9546
.PHONY: push-release
9647
push-release:
9748
docker push $(IMAGE):$(VERSION)
98-
docker push $(IMAGE):$(VERSION_AMAZONLINUX)
9949

10050
.PHONY: push
10151
push:
10252
docker push $(IMAGE):latest
10353

104-
.PHONY: verify-vendor
105-
test: verify-vendor
106-
verify: verify-vendor
107-
verify-vendor:
108-
@ echo; echo "### $@:"
109-
@ ./hack/verify-vendor.sh
110-
11154
.PHONY: clean
11255
clean:
11356
rm -rf bin/*

cmd/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323

2424
"github.com/ppc64le-cloud/powervs-csi-driver/pkg/driver"
2525

26-
"k8s.io/klog"
26+
"k8s.io/klog/v2"
2727
)
2828

2929
func main() {
@@ -32,12 +32,12 @@ func main() {
3232

3333
drv, err := driver.NewDriver(
3434
driver.WithEndpoint(options.ServerOptions.Endpoint),
35-
driver.WithExtraTags(options.ControllerOptions.ExtraTags),
35+
//driver.WithExtraTags(options.ControllerOptions.ExtraTags),
3636
//river.WithExtraVolumeTags(options.ControllerOptions.ExtraVolumeTags),
3737
driver.WithMode(options.DriverMode),
3838
driver.WithDebug(options.ServerOptions.Debug),
3939
driver.WithVolumeAttachLimit(options.NodeOptions.VolumeAttachLimit),
40-
driver.WithKubernetesClusterID(options.ControllerOptions.KubernetesClusterID),
40+
//driver.WithKubernetesClusterID(options.ControllerOptions.KubernetesClusterID),
4141
driver.WithPVMCloudInstanceID(options.ServerOptions.PVMCloudInstanceID),
4242
)
4343
if err != nil {

cmd/options.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ import (
2727
"github.com/ppc64le-cloud/powervs-csi-driver/cmd/options"
2828
"github.com/ppc64le-cloud/powervs-csi-driver/pkg/driver"
2929

30-
"k8s.io/klog"
30+
"k8s.io/klog/v2"
3131
)
3232

3333
// Options is the combined set of options for all operating modes.
3434
type Options struct {
3535
DriverMode driver.Mode
3636

3737
*options.ServerOptions
38-
*options.ControllerOptions
38+
//*options.ControllerOptions
3939
*options.NodeOptions
4040
}
4141

@@ -52,7 +52,7 @@ func GetOptions(fs *flag.FlagSet) *Options {
5252
mode = driver.AllMode
5353

5454
serverOptions = options.ServerOptions{}
55-
controllerOptions = options.ControllerOptions{}
55+
//controllerOptions = options.ControllerOptions{}
5656
nodeOptions = options.NodeOptions{}
5757
)
5858

@@ -64,7 +64,7 @@ func GetOptions(fs *flag.FlagSet) *Options {
6464

6565
switch {
6666
case cmd == string(driver.ControllerMode):
67-
controllerOptions.AddFlags(fs)
67+
//controllerOptions.AddFlags(fs)
6868
args = os.Args[2:]
6969
mode = driver.ControllerMode
7070

@@ -74,12 +74,12 @@ func GetOptions(fs *flag.FlagSet) *Options {
7474
mode = driver.NodeMode
7575

7676
case cmd == string(driver.AllMode):
77-
controllerOptions.AddFlags(fs)
77+
//controllerOptions.AddFlags(fs)
7878
nodeOptions.AddFlags(fs)
7979
args = os.Args[2:]
8080

8181
case strings.HasPrefix(cmd, "-"):
82-
controllerOptions.AddFlags(fs)
82+
//controllerOptions.AddFlags(fs)
8383
nodeOptions.AddFlags(fs)
8484
args = os.Args[1:]
8585

@@ -106,7 +106,7 @@ func GetOptions(fs *flag.FlagSet) *Options {
106106
DriverMode: mode,
107107

108108
ServerOptions: &serverOptions,
109-
ControllerOptions: &controllerOptions,
109+
//ControllerOptions: &controllerOptions,
110110
NodeOptions: &nodeOptions,
111111
}
112112
}

cmd/options/controller_options.go

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,21 @@ package options
1818

1919
//DONE
2020

21-
import (
22-
"flag"
23-
24-
cliflag "k8s.io/component-base/cli/flag"
25-
)
26-
27-
// ControllerOptions contains options and configuration settings for the controller service.
28-
type ControllerOptions struct {
29-
// ExtraTags is a map of tags that will be attached to each dynamically provisioned
30-
// resource.
31-
ExtraTags map[string]string
32-
//// ExtraVolumeTags is a map of tags that will be attached to each dynamically provisioned
33-
//// volume.
34-
//// DEPRECATED: Use ExtraTags instead.
35-
//ExtraVolumeTags map[string]string
36-
// ID of the kubernetes cluster.
37-
KubernetesClusterID string
38-
}
39-
40-
func (s *ControllerOptions) AddFlags(fs *flag.FlagSet) {
41-
fs.Var(cliflag.NewMapStringString(&s.ExtraTags), "extra-tags", "Extra tags to attach to each dynamically provisioned resource. It is a comma separated list of key value pairs like '<key1>=<value1>,<key2>=<value2>'")
42-
//fs.Var(cliflag.NewMapStringString(&s.ExtraVolumeTags), "extra-volume-tags", "DEPRECATED: Please use --extra-tags instead. Extra volume tags to attach to each dynamically provisioned volume. It is a comma separated list of key value pairs like '<key1>=<value1>,<key2>=<value2>'")
43-
fs.StringVar(&s.KubernetesClusterID, "k8s-tag-cluster-id", "", "ID of the Kubernetes cluster used for tagging provisioned EBS volumes (optional).")
44-
}
21+
//// ControllerOptions contains options and configuration settings for the controller service.
22+
//type ControllerOptions struct {
23+
// // ExtraTags is a map of tags that will be attached to each dynamically provisioned
24+
// // resource.
25+
// ExtraTags map[string]string
26+
// //// ExtraVolumeTags is a map of tags that will be attached to each dynamically provisioned
27+
// //// volume.
28+
// //// DEPRECATED: Use ExtraTags instead.
29+
// //ExtraVolumeTags map[string]string
30+
// // ID of the kubernetes cluster.
31+
// KubernetesClusterID string
32+
//}
33+
34+
//func (s *ControllerOptions) AddFlags(fs *flag.FlagSet) {
35+
// //fs.Var(cliflag.NewMapStringString(&s.ExtraTags), "extra-tags", "Extra tags to attach to each dynamically provisioned resource. It is a comma separated list of key value pairs like '<key1>=<value1>,<key2>=<value2>'")
36+
// //fs.Var(cliflag.NewMapStringString(&s.ExtraVolumeTags), "extra-volume-tags", "DEPRECATED: Please use --extra-tags instead. Extra volume tags to attach to each dynamically provisioned volume. It is a comma separated list of key value pairs like '<key1>=<value1>,<key2>=<value2>'")
37+
// //fs.StringVar(&s.KubernetesClusterID, "k8s-tag-cluster-id", "", "ID of the Kubernetes cluster used for tagging provisioned EBS volumes (optional).")
38+
//}

cmd/options/node_options.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,6 @@ import (
2424

2525
// NodeOptions contains options and configuration settings for the node service.
2626
type NodeOptions struct {
27-
// VolumeAttachLimit specifies the value that shall be reported as "maximum number of attachable volumes"
28-
// in CSINode objects. It is similar to https://kubernetes.io/docs/concepts/storage/storage-limits/#custom-limits
29-
// which allowed administrators to specify custom volume limits by configuring the kube-scheduler. Also, each AWS
30-
// machine type has different volume limits. By default, the EBS CSI driver parses the machine type name and then
31-
// decides the volume limit. However, this is only a rough approximation and not good enough in most cases.
32-
// Specifying the volume attach limit via command line is the alternative until a more sophisticated solution presents
33-
// itself (dynamically discovering the maximum number of attachable volume per EC2 machine type, see also
34-
// https://github.com/kubernetes-sigs/aws-ebs-csi-driver/issues/347).
3527
VolumeAttachLimit int64
3628
}
3729

deploy/kubernetes/base/controller.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ metadata:
77
labels:
88
app.kubernetes.io/name: powervs-csi-driver
99
spec:
10-
replicas: 2
10+
replicas: 1
1111
selector:
1212
matchLabels:
1313
app: powervs-csi-controller

0 commit comments

Comments
 (0)