Skip to content

Commit 24ca63a

Browse files
committed
wip
1 parent 292f50f commit 24ca63a

File tree

10 files changed

+8
-889
lines changed

10 files changed

+8
-889
lines changed

Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM docker.io/library/golang:1.22.1-alpine3.19 as builder
2-
RUN apk add --no-cache btrfs-progs-dev lvm2-dev make build-base gpgme-dev
2+
RUN apk add --no-cache btrfs-progs-dev lvm2-dev make
33
WORKDIR /go/src/container-image-csi-driver
44
COPY go.mod go.sum ./
55
RUN go mod download
@@ -13,7 +13,7 @@ FROM scratch as install-util
1313
COPY --from=builder /go/src/container-image-csi-driver/_output/warm-metal-csi-image-install /
1414

1515
FROM alpine:3.19
16-
RUN apk add --no-cache btrfs-progs-dev lvm2-dev gpgme-dev netavark skopeo
16+
RUN apk add --no-cache btrfs-progs-dev lvm2-dev
1717
WORKDIR /
1818
COPY --from=builder /go/src/container-image-csi-driver/_output/csi-image-plugin /usr/bin/
1919
ENTRYPOINT ["csi-image-plugin"]

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export IMG = $(REGISTRY)/csi-image:$(VERSION)
1212
.PHONY: build
1313
build:
1414
go fmt ./...
15-
# go vet ./...
15+
go vet ./...
1616
go build -o _output/csi-image-plugin ./cmd/plugin
1717

1818
.PHONY: sanity

charts/warm-metal-csi-driver/templates/nodeplugin.yaml

-10
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,6 @@ spec:
123123
- mountPath: {{ .Values.crioMountProgram }}
124124
name: crio-mount-program
125125
{{- end }}
126-
{{- if eq .Values.runtime.engine "buildah" }}
127-
- mountPath: /run/containers/storage
128-
name: storagerunroot-dir
129-
{{- end }}
130126
hostNetwork: {{.Values.csiPlugin.hostNetwork}}
131127
serviceAccountName: {{ include "warm-metal-csi-driver.fullname" . }}-nodeplugin
132128
volumes:
@@ -162,12 +158,6 @@ spec:
162158
path: {{ .Values.snapshotRoot }}
163159
type: DirectoryOrCreate
164160
name: snapshot-root-0
165-
{{- if eq .Values.runtime.engine "buildah" }}
166-
- hostPath:
167-
path: /run/containers/storage
168-
type: DirectoryOrCreate
169-
name: storagerunroot-dir
170-
{{- end }}
171161
{{- with .Values.affinity }}
172162
affinity:
173163
{{- toYaml . | nindent 8 }}

charts/warm-metal-csi-driver/values-wmbuildah.yaml

-61
This file was deleted.

cmd/plugin/main.go

-15
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@ import (
1111
"time"
1212

1313
"github.com/container-storage-interface/spec/lib/go/csi"
14-
"github.com/containers/buildah"
1514
flag "github.com/spf13/pflag"
1615
"github.com/warm-metal/container-image-csi-driver/pkg/backend"
1716
"github.com/warm-metal/container-image-csi-driver/pkg/backend/containerd"
1817
"github.com/warm-metal/container-image-csi-driver/pkg/backend/crio"
19-
"github.com/warm-metal/container-image-csi-driver/pkg/backend/wmbuildah"
2018
"github.com/warm-metal/container-image-csi-driver/pkg/cri"
2119
"github.com/warm-metal/container-image-csi-driver/pkg/metrics"
2220
"github.com/warm-metal/container-image-csi-driver/pkg/secret"
@@ -32,7 +30,6 @@ const (
3230

3331
containerdScheme = "containerd"
3432
criOScheme = "cri-o"
35-
buildahScheme = "buildah"
3633

3734
nodeMode = "node"
3835
controllerMode = "controller"
@@ -69,10 +66,6 @@ var (
6966
)
7067

7168
func main() {
72-
if buildah.InitReexec() {
73-
return
74-
}
75-
7669
klog.InitFlags(nil)
7770
flag.CommandLine.AddGoFlagSet(goflag.CommandLine)
7871
if err := flag.Set("logtostderr", "true"); err != nil {
@@ -153,14 +146,6 @@ func main() {
153146
if err != nil {
154147
klog.Fatalf(`unable to connect to cri daemon "%s": %s`, *endpoint, err)
155148
}
156-
157-
case buildahScheme:
158-
159-
mounter = wmbuildah.NewMounter(&wmbuildah.Options{})
160-
criClient, err = cri.NewRemoteImageServiceBuildah(time.Second)
161-
if err != nil {
162-
klog.Fatalf(`unable to setup buildah: %s`, err)
163-
}
164149
default:
165150
klog.Fatalf("unknown container runtime %q", addr.Scheme)
166151
}

cmd/plugin/node_server.go

-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ func NewNodeServer(driver *csicommon.CSIDriver, mounter backend.Mounter, imageSv
4646
asyncImagePuller: nil,
4747
k8smounter: k8smount.New(""),
4848
volumeLocks: utils.NewNamedLocks(),
49-
imageLocks: utils.NewNamedLocks(),
5049
}
5150
if o.AsyncImagePullTimeout >= time.Duration(30*time.Second) {
5251
klog.Infof("Starting node server in Async mode with %v timeout", asyncImagePullTimeout)
@@ -67,7 +66,6 @@ type NodeServer struct {
6766
asyncImagePuller remoteimageasync.AsyncPuller
6867
k8smounter k8smount.Interface
6968
volumeLocks *utils.NamedLocks
70-
imageLocks *utils.NamedLocks
7169
}
7270

7371
func (n NodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (resp *csi.NodePublishVolumeResponse, err error) {

go.mod

+5-73
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ require (
66
github.com/BurntSushi/toml v1.3.2
77
github.com/container-storage-interface/spec v1.6.0
88
github.com/containerd/containerd v1.7.13
9-
github.com/containers/buildah v1.35.0
10-
github.com/containers/common v0.58.0
11-
github.com/containers/image/v5 v5.30.0
129
github.com/containers/storage v1.53.0
1310
github.com/golang/protobuf v1.5.3
1411
github.com/mitchellh/go-ps v1.0.0
@@ -20,7 +17,6 @@ require (
2017
github.com/warm-metal/csi-drivers v0.5.0-alpha.0.0.20210404173852-9ec9cb097dd2
2118
golang.org/x/net v0.22.0
2219
golang.org/x/sync v0.6.0
23-
golang.org/x/time v0.3.0
2420
google.golang.org/grpc v1.61.0
2521
k8s.io/api v0.26.5
2622
k8s.io/apimachinery v0.26.5
@@ -34,11 +30,9 @@ require (
3430
)
3531

3632
require (
37-
dario.cat/mergo v1.0.0 // indirect
3833
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
3934
github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0 // indirect
4035
github.com/Azure/azure-sdk-for-go v55.0.0+incompatible // indirect
41-
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
4236
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
4337
github.com/Azure/go-autorest/autorest v0.11.27 // indirect
4438
github.com/Azure/go-autorest/autorest/adal v0.9.20 // indirect
@@ -49,154 +43,93 @@ require (
4943
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
5044
github.com/Microsoft/go-winio v0.6.1 // indirect
5145
github.com/Microsoft/hcsshim v0.12.0-rc.3 // indirect
52-
github.com/VividCortex/ewma v1.2.0 // indirect
53-
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d // indirect
54-
github.com/aead/serpent v0.0.0-20160714141033-fba169763ea6 // indirect
55-
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
5646
github.com/aws/aws-sdk-go v1.45.20 // indirect
5747
github.com/beorn7/perks v1.0.1 // indirect
5848
github.com/blang/semver/v4 v4.0.0 // indirect
5949
github.com/cespare/xxhash/v2 v2.2.0 // indirect
60-
github.com/chzyer/readline v1.5.1 // indirect
61-
github.com/cilium/ebpf v0.9.1 // indirect
6250
github.com/containerd/cgroups/v3 v3.0.2 // indirect
6351
github.com/containerd/continuity v0.4.2 // indirect
6452
github.com/containerd/errdefs v0.1.0 // indirect
6553
github.com/containerd/fifo v1.1.0 // indirect
6654
github.com/containerd/log v0.1.0 // indirect
67-
github.com/containerd/stargz-snapshotter/estargz v0.15.1 // indirect
6855
github.com/containerd/ttrpc v1.2.2 // indirect
6956
github.com/containerd/typeurl/v2 v2.1.1 // indirect
70-
github.com/containernetworking/cni v1.1.2 // indirect
71-
github.com/containernetworking/plugins v1.4.0 // indirect
72-
github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01 // indirect
73-
github.com/containers/luksy v0.0.0-20240212203526-ceb12d4fd50c // indirect
74-
github.com/containers/ocicrypt v1.1.9 // indirect
75-
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
76-
github.com/cyberphone/json-canonicalization v0.0.0-20231217050601-ba74d44ecf5f // indirect
77-
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
7857
github.com/davecgh/go-spew v1.1.1 // indirect
79-
github.com/disiqueira/gotree/v3 v3.0.2 // indirect
8058
github.com/distribution/reference v0.5.0 // indirect
8159
github.com/docker/distribution v2.8.3+incompatible // indirect
82-
github.com/docker/docker v25.0.3+incompatible // indirect
83-
github.com/docker/docker-credential-helpers v0.8.1 // indirect
84-
github.com/docker/go-connections v0.5.0 // indirect
8560
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect
8661
github.com/docker/go-units v0.5.0 // indirect
8762
github.com/emicklei/go-restful/v3 v3.10.1 // indirect
8863
github.com/felixge/httpsnoop v1.0.4 // indirect
89-
github.com/fsnotify/fsnotify v1.7.0 // indirect
90-
github.com/fsouza/go-dockerclient v1.10.1 // indirect
91-
github.com/go-jose/go-jose/v3 v3.0.2 // indirect
9264
github.com/go-logr/logr v1.4.1 // indirect
9365
github.com/go-logr/stdr v1.2.2 // indirect
94-
github.com/go-openapi/analysis v0.21.4 // indirect
95-
github.com/go-openapi/errors v0.21.1 // indirect
9666
github.com/go-openapi/jsonpointer v0.19.6 // indirect
9767
github.com/go-openapi/jsonreference v0.20.2 // indirect
98-
github.com/go-openapi/loads v0.21.2 // indirect
99-
github.com/go-openapi/runtime v0.26.0 // indirect
100-
github.com/go-openapi/spec v0.20.9 // indirect
101-
github.com/go-openapi/strfmt v0.22.2 // indirect
10268
github.com/go-openapi/swag v0.22.10 // indirect
103-
github.com/go-openapi/validate v0.22.1 // indirect
104-
github.com/godbus/dbus/v5 v5.1.0 // indirect
10569
github.com/gogo/protobuf v1.3.2 // indirect
10670
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
10771
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
10872
github.com/google/gnostic v0.5.7-v3refs // indirect
10973
github.com/google/go-cmp v0.6.0 // indirect
110-
github.com/google/go-containerregistry v0.19.0 // indirect
11174
github.com/google/go-intervals v0.0.2 // indirect
11275
github.com/google/gofuzz v1.2.0 // indirect
76+
github.com/google/pprof v0.0.0-20230323073829-e72429f035bd // indirect
11377
github.com/google/uuid v1.6.0 // indirect
114-
github.com/gorilla/mux v1.8.1 // indirect
11578
github.com/hashicorp/errwrap v1.1.0 // indirect
11679
github.com/hashicorp/go-multierror v1.1.1 // indirect
11780
github.com/imdario/mergo v0.3.12 // indirect
11881
github.com/inconshreveable/mousetrap v1.1.0 // indirect
119-
github.com/jinzhu/copier v0.4.0 // indirect
12082
github.com/jmespath/go-jmespath v0.4.0 // indirect
12183
github.com/josharian/intern v1.0.0 // indirect
12284
github.com/json-iterator/go v1.1.12 // indirect
12385
github.com/klauspost/compress v1.17.7 // indirect
12486
github.com/klauspost/pgzip v1.2.6 // indirect
12587
github.com/kubernetes-csi/csi-lib-utils v0.9.1 // indirect
126-
github.com/letsencrypt/boulder v0.0.0-20230907030200-6d76a0f91e1e // indirect
12788
github.com/mailru/easyjson v0.7.7 // indirect
128-
github.com/manifoldco/promptui v0.9.0 // indirect
129-
github.com/mattn/go-runewidth v0.0.15 // indirect
13089
github.com/mattn/go-shellwords v1.0.12 // indirect
131-
github.com/mattn/go-sqlite3 v1.14.22 // indirect
13290
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
133-
github.com/miekg/pkcs11 v1.1.1 // indirect
13491
github.com/mistifyio/go-zfs/v3 v3.0.1 // indirect
135-
github.com/mitchellh/mapstructure v1.5.0 // indirect
136-
github.com/moby/buildkit v0.12.5 // indirect
13792
github.com/moby/locker v1.0.1 // indirect
138-
github.com/moby/patternmatcher v0.6.0 // indirect
13993
github.com/moby/sys/mountinfo v0.7.1 // indirect
14094
github.com/moby/sys/sequential v0.5.0 // indirect
14195
github.com/moby/sys/signal v0.7.0 // indirect
14296
github.com/moby/sys/user v0.1.0 // indirect
143-
github.com/moby/term v0.5.0 // indirect
14497
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
14598
github.com/modern-go/reflect2 v1.0.2 // indirect
146-
github.com/morikuni/aec v1.0.0 // indirect
14799
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
148-
github.com/oklog/ulid v1.3.1 // indirect
100+
github.com/onsi/ginkgo/v2 v2.15.0 // indirect
101+
github.com/onsi/gomega v1.31.1 // indirect
149102
github.com/opencontainers/go-digest v1.0.0 // indirect
150-
github.com/opencontainers/runc v1.1.12 // indirect
151103
github.com/opencontainers/runtime-spec v1.2.0 // indirect
152-
github.com/opencontainers/runtime-tools v0.9.1-0.20230914150019-408c51e934dc // indirect
153104
github.com/opencontainers/selinux v1.11.0 // indirect
154-
github.com/openshift/imagebuilder v1.2.6 // indirect
155-
github.com/ostreedev/ostree-go v0.0.0-20210805093236-719684c64e4f // indirect
156105
github.com/pmezard/go-difflib v1.0.0 // indirect
157-
github.com/proglottis/gpgme v0.1.3 // indirect
158106
github.com/prometheus/client_model v0.5.0 // indirect
159107
github.com/prometheus/common v0.44.0 // indirect
160108
github.com/prometheus/procfs v0.11.1 // indirect
161-
github.com/rivo/uniseg v0.4.4 // indirect
162-
github.com/seccomp/libseccomp-golang v0.10.0 // indirect
163-
github.com/secure-systems-lab/go-securesystemslib v0.8.0 // indirect
164-
github.com/sigstore/fulcio v1.4.3 // indirect
165-
github.com/sigstore/rekor v1.2.2 // indirect
166-
github.com/sigstore/sigstore v1.8.2 // indirect
109+
github.com/rogpeppe/go-internal v1.11.0 // indirect
167110
github.com/sirupsen/logrus v1.9.3 // indirect
168111
github.com/spf13/cobra v1.8.0 // indirect
169-
github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980 // indirect
170-
github.com/sylabs/sif/v2 v2.15.1 // indirect
171112
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect
172113
github.com/tchap/go-patricia/v2 v2.3.1 // indirect
173-
github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399 // indirect
174114
github.com/ulikunitz/xz v0.5.11 // indirect
175115
github.com/vbatts/tar-split v0.11.5 // indirect
176-
github.com/vbauerster/mpb/v8 v8.7.2 // indirect
177-
github.com/vishvananda/netlink v1.2.1-beta.2 // indirect
178-
github.com/vishvananda/netns v0.0.4 // indirect
179-
go.etcd.io/bbolt v1.3.9 // indirect
180-
go.mongodb.org/mongo-driver v1.14.0 // indirect
181-
go.mozilla.org/pkcs7 v0.0.0-20210826202110-33d05740a352 // indirect
182116
go.opencensus.io v0.24.0 // indirect
183117
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 // indirect
184118
go.opentelemetry.io/otel v1.22.0 // indirect
185119
go.opentelemetry.io/otel/metric v1.22.0 // indirect
186120
go.opentelemetry.io/otel/trace v1.22.0 // indirect
187121
golang.org/x/crypto v0.21.0 // indirect
188-
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect
189122
golang.org/x/mod v0.15.0 // indirect
190123
golang.org/x/oauth2 v0.18.0 // indirect
191124
golang.org/x/sys v0.18.0 // indirect
192125
golang.org/x/term v0.18.0 // indirect
193126
golang.org/x/text v0.14.0 // indirect
127+
golang.org/x/time v0.3.0 // indirect
194128
golang.org/x/tools v0.18.0 // indirect
195129
google.golang.org/appengine v1.6.8 // indirect
196130
google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 // indirect
197131
google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect
198132
google.golang.org/protobuf v1.31.0 // indirect
199-
gopkg.in/go-jose/go-jose.v2 v2.6.1 // indirect
200133
gopkg.in/inf.v0 v0.9.1 // indirect
201134
gopkg.in/yaml.v2 v2.4.0 // indirect
202135
gopkg.in/yaml.v3 v3.0.1 // indirect
@@ -208,7 +141,6 @@ require (
208141
k8s.io/legacy-cloud-providers v0.0.0 // indirect
209142
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
210143
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
211-
tags.cncf.io/container-device-interface v0.6.2 // indirect
212144
)
213145

214146
replace (

0 commit comments

Comments
 (0)