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

Set the CSI driver name from env var #68

Merged
merged 2 commits into from
Jul 1, 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
5 changes: 5 additions & 0 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ spec:
- --leader-elect
image: controller:latest
name: manager
env:
# The service name of the lustre-csi-driver.
# From its pkg/lustre-driver/service/service.go.
- name: LUSTRE_CSI_SERVICE_NAME
value: "lustre-csi.hpe.com"
securityContext:
allowPrivilegeEscalation: false
livenessProbe:
Expand Down
6 changes: 0 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ go 1.19

require (
github.com/DataWorkflowServices/dws v0.0.1-0.20240628142816-167b50149e2d
github.com/HewlettPackard/lustre-csi-driver v0.0.1-0.20240430143029-c559e76880e8
github.com/google/go-cmp v0.5.9
github.com/google/gofuzz v1.2.0
github.com/google/uuid v1.3.0
Expand All @@ -19,7 +18,6 @@ require (
require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/container-storage-interface/spec v1.5.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.10.1 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
Expand Down Expand Up @@ -48,7 +46,6 @@ require (
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/prometheus/procfs v0.10.1 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.25.0 // indirect
Expand All @@ -62,8 +59,6 @@ require (
golang.org/x/tools v0.9.3 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect
google.golang.org/grpc v1.54.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand All @@ -72,7 +67,6 @@ require (
k8s.io/component-base v0.28.1 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
k8s.io/mount-utils v0.24.2 // indirect
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
Expand Down
55 changes: 0 additions & 55 deletions go.sum

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions internal/controller/lustrefilesystem_controller.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021-2023 Hewlett Packard Enterprise Development LP
* Copyright 2021-2024 Hewlett Packard Enterprise Development LP
* Other additional copyright holders may be indicated within.
*
* The entirety of this work is licensed under the Apache License,
Expand All @@ -21,6 +21,7 @@ package controller

import (
"context"
"os"

"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/meta"
Expand All @@ -38,7 +39,6 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/DataWorkflowServices/dws/utils/updater"
"github.com/HewlettPackard/lustre-csi-driver/pkg/lustre-driver/service"
lusv1beta1 "github.com/NearNodeFlash/lustre-fs-operator/api/v1beta1"
)

Expand Down Expand Up @@ -309,7 +309,7 @@ func (r *LustreFileSystemReconciler) createOrUpdatePersistentVolume(ctx context.

pv.Spec.PersistentVolumeSource = corev1.PersistentVolumeSource{
CSI: &corev1.CSIPersistentVolumeSource{
Driver: service.Name,
Driver: os.Getenv("LUSTRE_CSI_SERVICE_NAME"),
FSType: "lustre",
VolumeHandle: fs.Spec.MgsNids + ":/" + fs.Spec.Name,
},
Expand Down
6 changes: 5 additions & 1 deletion internal/controller/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package controller

import (
"context"
"os"
"path/filepath"
"testing"

Expand Down Expand Up @@ -61,14 +62,17 @@ var _ = BeforeSuite(func() {
ctx, cancel = context.WithCancel(context.TODO())

By("bootstrapping test environment")
var err error

err = os.Setenv("LUSTRE_CSI_SERVICE_NAME", "lustre-csi.hpe.com")
Expect(err).NotTo(HaveOccurred())

// See https://github.com/kubernetes-sigs/controller-runtime/issues/1882
// about getting the conversion webhook to register properly.
// Begin by relocating the code that builds the scheme, so it happens
// before calling envtest.Start().
// Then add the scheme to envtest.CRDInstallOptions.

var err error
err = lusv1alpha1.AddToScheme(scheme.Scheme)
Expect(err).NotTo(HaveOccurred())

Expand Down
202 changes: 0 additions & 202 deletions vendor/github.com/HewlettPackard/lustre-csi-driver/LICENSE

This file was deleted.

Loading
Loading