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

add support for powerscale 2.2.0 #47

Merged
merged 7 commits into from
Feb 24, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
9 changes: 9 additions & 0 deletions api/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ type Driver struct {
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="CSI Driver Type"
CSIDriverType DriverType `json:"csiDriverType" yaml:"csiDriverType"`

// CSIDriverSpec is the specification for CSIDriver
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="CSI Driver Spec"
CSIDriverSpec CSIDriverSpec `json:"csiDriverSpec" yaml:"csiDriverSpec"`

// ConfigVersion is the configuration version of the driver
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Config Version"
ConfigVersion string `json:"configVersion" yaml:"configVersion"`
Expand Down Expand Up @@ -230,3 +234,8 @@ type SnapshotClass struct {
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Snapshot Class Parameters"
Parameters map[string]string `json:"parameters,omitempty" yaml:"parameters"`
}

//CSIDriverSpec struct
type CSIDriverSpec struct {
FSGroupPolicy string `json:"fSGroupPolicy,omitempty" yaml:"fSGroupPolicy,omitempty"`
}
16 changes: 16 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,12 @@ spec:
type: object
type: array
type: object
csiDriverSpec:
description: CSIDriverSpec is the specification for CSIDriver
properties:
fSGroupPolicy:
type: string
type: object
csiDriverType:
description: CSIDriverType is the CSI Driver type for Dell EMC
- e.g, powermax, powerflex,...
Expand Down
4 changes: 4 additions & 0 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ configMapGenerator:
name: manager-config
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: controller
newName: dellemc/dell-csm-operator
newTag: 0.1.0
4 changes: 1 addition & 3 deletions controllers/csm_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -680,12 +680,10 @@ func (r *ContainerStorageModuleReconciler) PreChecks(ctx context.Context, cr *cs
if cr.Spec.Driver.Common.Image == "" {
return fmt.Errorf("driver image not specified in spec")
}
if cr.Spec.Driver.ConfigVersion == "" || cr.Spec.Driver.ConfigVersion != "v2.1.0" {
if cr.Spec.Driver.ConfigVersion == "" || cr.Spec.Driver.ConfigVersion != "v2.2.0" {
return fmt.Errorf("driver version not specified in spec or driver version is not valid")
}

// add check for version

// Check drivers
switch cr.Spec.Driver.CSIDriverType {
case csmv1.PowerScale:
Expand Down
7 changes: 7 additions & 0 deletions deploy/operator.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
apiVersion: v1
kind: Namespace
metadata:
labels:
control-plane: controller-manager
name: dell-csm-operator
---
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ metadata:
spec:
attachRequired: true
podInfoOnMount: true
fsGroupPolicy: ReadWriteOnceWithFSType
volumeLifecycleModes:
- Persistent
- Ephemeral
- Ephemeral
11 changes: 11 additions & 0 deletions pkg/drivers/commonconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,5 +254,16 @@ func GetCSIDriver(ctx context.Context, cr csmv1.ContainerStorageModule, operator
return nil, err
}

if cr.Spec.Driver.CSIDriverSpec.FSGroupPolicy != "" {
fsGroupPolicy := storagev1.NoneFSGroupPolicy
if cr.Spec.Driver.CSIDriverSpec.FSGroupPolicy == "ReadWriteOnceWithFSType" {
fsGroupPolicy = storagev1.ReadWriteOnceWithFSTypeFSGroupPolicy
} else if cr.Spec.Driver.CSIDriverSpec.FSGroupPolicy == "File" {
fsGroupPolicy = storagev1.FileFSGroupPolicy
}
csidriver.Spec.FSGroupPolicy = &fsGroupPolicy
log.Debugw("GetCSIDriver", "fsGroupPolicy", fsGroupPolicy)
}

return &csidriver, nil
}
11 changes: 8 additions & 3 deletions samples/storage_csm_powerscale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,22 @@ metadata:
spec:
driver:
csiDriverType: "isilon"
csiDriverSpec:
# fsGroupPolicy: Defines if the underlying volume supports changing ownership and permission of the volume before being mounted.
# Allowed values: ReadWriteOnceWithFSType, File , None
# Default value: ReadWriteOnceWithFSType
fSGroupPolicy: "ReadWriteOnceWithFSType"
# Config version for CSI PowerScale v2.1.0 driver
configVersion: v2.1.0
configVersion: v2.2.0
authSecret: test-isilon-creds
replicas: 1
dnsPolicy: ClusterFirstWithHostNet
forceUpdate: false
# Uninstall CSI Driver and/or modules when CR is deleted
forceRemoveDriver: false
common:
# Image for CSI PowerScale driver v2.1.0
image: "dellemc/csi-isilon:v2.1.0"
# Image for CSI PowerScale driver v2.2.0
image: "dellemc/csi-isilon:nightly"
imagePullPolicy: IfNotPresent
envs:
# X_CSI_VERBOSE: Indicates what content of the OneFS REST API message should be logged in debug level logs
Expand Down