Skip to content

Commit

Permalink
Merge pull request #14 from dell/release-1.6.0
Browse files Browse the repository at this point in the history
csi-powerscale v1.6.0 release
  • Loading branch information
bpjain2004 authored Jun 21, 2021
2 parents 964a54c + 78925b2 commit f776ed0
Show file tree
Hide file tree
Showing 39 changed files with 836 additions and 382 deletions.
1 change: 1 addition & 0 deletions .trivyignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CVE-2019-1010022
9 changes: 6 additions & 3 deletions Dockerfile.podman
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ RUN CGO_ENABLED=0 \
FROM $BASEIMAGE AS driver
# install necessary packages
# alphabetical order for easier maintenance
RUN microdnf install -y \
RUN microdnf update -y && \
microdnf install -y \
e4fsprogs \
libaio \
libuuid \
Expand All @@ -32,14 +33,16 @@ ENTRYPOINT ["/csi-isilon"]
# will break image build if CRITICAL issues found
# will print out all HIGH issues found
FROM driver as cvescan
COPY ./.trivyignore .
# run trivy and clean up all traces after
RUN microdnf install -y --enablerepo=ubi-8-baseos tar && \
microdnf clean all && \
curl https://raw.githubusercontent.com/aquasecurity/trivy/master/contrib/install.sh | sh && \
trivy fs -s CRITICAL --exit-code 1 / && \
trivy fs -s HIGH / && \
trivy image --reset && \
rm ./bin/trivy
rm ./bin/trivy && \
rm ./.trivyignore

# final stage
# simple stage to use the driver image as the resultant image
Expand All @@ -49,7 +52,7 @@ LABEL vendor="Dell Inc." \
name="csi-isilon" \
summary="CSI Driver for Dell EMC PowerScale" \
description="CSI Driver for provisioning persistent storage from Dell EMC PowerScale" \
version="1.5.0" \
version="1.6.0" \
license="Apache-2.0"

COPY ./licenses /licenses
21 changes: 2 additions & 19 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
# Release Notes - CSI PowerScale v1.5.0
# Release Notes - CSI PowerScale v1.6.0
[![Go Report Card](https://goreportcard.com/badge/github.com/dell/csi-isilon)](https://goreportcard.com/report/github.com/dell/csi-isilon)
[![License](https://img.shields.io/github/license/dell/csi-isilon)](https://github.com/dell/csi-isilon/blob/master/LICENSE)
[![Docker](https://img.shields.io/docker/pulls/dellemc/csi-isilon.svg?logo=docker)](https://hub.docker.com/r/dellemc/csi-isilon)

## New Features/Changes
- Added support for Kubernetes v1.20
- Added support for OpenShift 4.7 with RHEL and CoreOS worker nodes
- Added support for Red Hat Enterprise Linux (RHEL) 8.x
- Added multi-cluster support through single instance of driver installation
- Added support for custom networks for NFS I/O traffic
- SSH permissions are no longer required. You can safely revoke the privilege ISI_PRIV_LOGIN_SSH for the CSI driver user

## Fixed Issues
- There are no Fixed issues in this release.

## Known Issues
| Issue | Resolution or workaround, if known |
| ----- | ---------------------------------- |
| Creating snapshot fails if the parameter IsiPath in volume snapshot class and related storage class are not the same. The driver uses the incorrect IsiPath parameter and tries to locate the source volume due to the inconsistency. | Ensure IsiPath in VolumeSnapshotClass yaml and related storageClass yaml are the same. |
| While deleting a volume, if there are files or folders created on the volume that are owned by different users. If the Isilon credentials used are for a nonprivileged Isilon user, the delete volume action fails. It is due to the limitation in Linux permission control. | To perform the delete volume action, the user account must be assigned a role that has the privilege ISI_PRIV_IFS_RESTORE. The user account must have the following set of privileges to ensure that all the CSI Isilon driver capabilities work properly:<br> * ISI_PRIV_LOGIN_PAPI<br> * ISI_PRIV_NFS<br> * ISI_PRIV_QUOTA<br> * ISI_PRIV_SNAPSHOT<br> * ISI_PRIV_IFS_RESTORE<br> * ISI_PRIV_NS_IFS_ACCESS<br> In some cases, ISI_PRIV_BACKUP is also required, for example, when files owned by other users have mode bits set to 700. |
| If hostname is mapped to loopback IP in /etc/hosts file, and pods are created using 1.3.0.1 release, after upgrade to 1.4.0 there is a possibility of "localhost" as stale entry in export | We recommend you not to map hostname to loopback IP in /etc/hosts file |
| If the length of the nodeID exceeds 128 characters, driver fails to update CSINode object and installation fails. This is due to a limitation set by CSI spec which doesn't allow nodeID to be greater than 128 characters. | The CSI PowerScale driver uses the hostname for building the nodeID which is set in CSINode resource object, hence we recommend not having very long hostnames in order to avoid this issue. This current limitation of 128 characters is likely to be relaxed in future kubernetes versions as per this issue in the community: https://github.com/kubernetes-sigs/gcp-compute-persistent-disk-csi-driver/issues/581
For Release notes, please refer https://dell.github.io/storage-plugin-docs/docs/release/powerscale/
5 changes: 5 additions & 0 deletions common/constants/consts.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package constants

import "github.com/sirupsen/logrus"

/*
Copyright (c) 2019 Dell Inc, or its subsidiaries.
Expand Down Expand Up @@ -56,4 +58,7 @@ const (

//IsilonConfigFile isilon-creds file with credential info of isilon clusters
IsilonConfigFile = "/isilon-configs/config"

//DefaultLogLevel for csi logs
DefaultLogLevel = logrus.DebugLevel
)
3 changes: 3 additions & 0 deletions common/constants/envvars.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,7 @@ const (

// EnvIsilonConfigFile specifies the filepath containing Isilon cluster's config details
EnvIsilonConfigFile = "X_CSI_ISILON_CONFIG_PATH"

// EnvMaxVolumesPerNode specifies maximum number of volumes that controller can publish to the node.
EnvMaxVolumesPerNode = "X_CSI_MAX_VOLUMES_PER_NODE"
)
55 changes: 29 additions & 26 deletions common/utils/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ package utils
import (
"context"
"fmt"
"github.com/dell/gocsi"
"github.com/dell/csi-isilon/common/constants"
"github.com/sirupsen/logrus"
"os"
"reflect"
"runtime"
"strconv"
Expand Down Expand Up @@ -111,29 +110,22 @@ func GetLogger() *logrus.Logger {
once.Do(func() {
singletonLog = logrus.New()
fmt.Println("csi-powerscale logger initiated. This should be called only once.")
var debug bool
debugStr := os.Getenv(gocsi.EnvVarDebug)
debug, _ = strconv.ParseBool(debugStr)
if debug {
singletonLog.Level = logrus.DebugLevel
singletonLog.SetReportCaller(true)
singletonLog.Formatter = &Formatter{
CallerPrettyfier: func(f *runtime.Frame) (string, string) {
filename1 := strings.Split(f.File, "dell/csi-powerscale")
if len(filename1) > 1 {
return fmt.Sprintf("%s()", f.Function), fmt.Sprintf("dell/csi-powerscale%s:%d", filename1[1], f.Line)
}

filename2 := strings.Split(f.File, "dell/goisilon")
if len(filename2) > 1 {
return fmt.Sprintf("%s()", f.Function), fmt.Sprintf("dell/goisilon%s:%d", filename2[1], f.Line)
}

return fmt.Sprintf("%s()", f.Function), fmt.Sprintf("%s:%d", f.File, f.Line)
},
}
} else {
singletonLog.Formatter = &Formatter{}
singletonLog.Level = constants.DefaultLogLevel
singletonLog.SetReportCaller(true)
singletonLog.Formatter = &Formatter{
CallerPrettyfier: func(f *runtime.Frame) (string, string) {
filename1 := strings.Split(f.File, "dell/csi-powerscale")
if len(filename1) > 1 {
return fmt.Sprintf("%s()", f.Function), fmt.Sprintf("dell/csi-powerscale%s:%d", filename1[1], f.Line)
}

filename2 := strings.Split(f.File, "dell/goisilon")
if len(filename2) > 1 {
return fmt.Sprintf("%s()", f.Function), fmt.Sprintf("dell/goisilon%s:%d", filename2[1], f.Line)
}

return fmt.Sprintf("%s()", f.Function), fmt.Sprintf("%s:%d", f.File, f.Line)
},
}
})

Expand All @@ -146,5 +138,16 @@ func GetRunIDLogger(ctx context.Context) *logrus.Entry {
if ctx.Value(PowerScaleLogger) != nil && reflect.TypeOf(tempLog) == reflect.TypeOf(&logrus.Entry{}) {
return ctx.Value(PowerScaleLogger).(*logrus.Entry)
}
return nil

return GetLogger().WithFields(logrus.Fields{})
}

// ParseLogLevel returns the logrus.Level of input log level string
func ParseLogLevel(lvl string) (logrus.Level, error) {
return logrus.ParseLevel(lvl)
}

// UpdateLogLevel updates the log level
func UpdateLogLevel(lvl logrus.Level) {
singletonLog.Level = lvl
}
69 changes: 19 additions & 50 deletions common/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"context"
"errors"
"fmt"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
"net"
"os"
"path"
Expand All @@ -29,57 +29,15 @@ import (
"strings"

"github.com/Showmax/go-fqdn"
gournal "github.com/akutz/gournal"
"github.com/container-storage-interface/spec/lib/go/csi"
"github.com/dell/csi-isilon/common/constants"
csictx "github.com/dell/gocsi/context"
isi "github.com/dell/goisilon"
"github.com/google/uuid"
log "github.com/sirupsen/logrus"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)

// ConfigureLogger sets log level for the logger
func ConfigureLogger(debugEnabled bool) context.Context {

clientCtx := context.Background()

if debugEnabled {

//logrus
log.SetLevel(log.DebugLevel)

//gournal
clientCtx = context.WithValue(
clientCtx,
gournal.LevelKey(),
gournal.DebugLevel)

gournal.DefaultLevel = gournal.DebugLevel

log.Infof("log level for logrus and gournal configured to DEBUG")

return clientCtx

}

// logrus
log.SetLevel(log.InfoLevel)

// gournal
clientCtx = context.WithValue(
clientCtx,
gournal.LevelKey(),
gournal.InfoLevel)

gournal.DefaultLevel = gournal.InfoLevel

log.Infof("log level for logrus and gournal configured to INFO")

return clientCtx
}

// ParseBooleanFromContext parses an environment variable into a boolean value. If an error is encountered, default is set to false, and error is logged
func ParseBooleanFromContext(ctx context.Context, key string) bool {
log := GetRunIDLogger(ctx)
Expand All @@ -96,18 +54,16 @@ func ParseBooleanFromContext(ctx context.Context, key string) bool {
}

// ParseArrayFromContext parses an environment variable into an array of string
func ParseArrayFromContext(ctx context.Context, key string) []string {
log := GetRunIDLogger(ctx)
func ParseArrayFromContext(ctx context.Context, key string) ([]string, error) {
var values []string

if val, ok := csictx.LookupEnv(ctx, key); ok {
err := yaml.Unmarshal([]byte(val), &values)
if err != nil {
log.Errorf("invalid array value for '%s'", key)
return values
return values, fmt.Errorf("invalid array value for '%s'", key)
}
}
return values
return values, nil
}

// ParseUintFromContext parses an environment variable into a uint value. If an error is encountered, default is set to 0, and error is logged
Expand All @@ -125,9 +81,21 @@ func ParseUintFromContext(ctx context.Context, key string) uint {
return 0
}

// ParseInt64FromContext parses an environment variable into an int64 value.
func ParseInt64FromContext(ctx context.Context, key string) (int64, error) {
if val, ok := csictx.LookupEnv(ctx, key); ok {
i, err := strconv.ParseInt(val, 10, 64)
if err != nil {
return 0, fmt.Errorf("invalid int64 value '%v' specified for '%s'", val, key)
}
return i, nil
}
return 0, nil
}

// RemoveExistingCSISockFile When the sock file that the gRPC server is going to be listening on already exists, error will be thrown saying the address is already in use, thus remove it first
func RemoveExistingCSISockFile() error {

log := GetLogger()
protoAddr := os.Getenv(constants.EnvCSIEndpoint)

log.Debugf("check if sock file '%s' has already been created", protoAddr)
Expand Down Expand Up @@ -160,6 +128,7 @@ func RemoveExistingCSISockFile() error {
// GetNewUUID generates a UUID
func GetNewUUID() (string, error) {

log := GetLogger()
id, err := uuid.NewUUID()
if err != nil {
log.Errorf("error generating UUID : '%s'", err)
Expand Down Expand Up @@ -263,7 +232,7 @@ func GetFQDNByIP(ctx context.Context, ip string) (string, error) {
log := GetRunIDLogger(ctx)
names, err := net.LookupAddr(ip)
if err != nil {
log.Errorf("error getting FQDN: '%s'", err)
log.Debugf("error getting FQDN: '%s'", err)
return "", err
}
// The first one is FQDN
Expand Down
4 changes: 2 additions & 2 deletions csi-utils/csiutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ package csi_utils
import (
"errors"
"fmt"
log "github.com/sirupsen/logrus"
"github.com/dell/csi-isilon/common/utils"
"net"
)

// GetNFSClientIP is used to fetch IP address from networks on which NFS traffic is allowed
func GetNFSClientIP(allowedNetworks []string) (string, error) {
var nodeIP string

log := utils.GetLogger()
addrs, err := net.InterfaceAddrs()
if err != nil {
log.Errorf("Encountered error while fetching system IP addresses: %+v\n", err.Error())
Expand Down
4 changes: 2 additions & 2 deletions dell-csi-helm-installer/verify-csi-isilon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#
# verify-csi-isilon method
function verify-csi-isilon() {
verify_k8s_versions "1.18" "1.20"
verify_openshift_versions "4.5" "4.6"
verify_k8s_versions "1.19" "1.21"
verify_openshift_versions "4.6" "4.7"
verify_namespace "${NS}"
verify_required_secrets "${RELEASE}-creds"
verify_optional_secrets "${RELEASE}-certs"
Expand Down
32 changes: 15 additions & 17 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,23 @@ module github.com/dell/csi-isilon
require (
github.com/Showmax/go-fqdn v1.0.0
github.com/akutz/gournal v0.5.0
github.com/container-storage-interface/spec v1.2.0
github.com/cucumber/gherkin-go/v9 v9.2.0
github.com/container-storage-interface/spec v1.3.0
github.com/cucumber/godog v0.10.0
github.com/cucumber/messages-go/v10 v10.0.3
github.com/dell/gocsi v1.2.3
github.com/dell/gofsutil v1.5.0
github.com/dell/gocsi v1.3.0
github.com/dell/gofsutil v1.6.0
github.com/dell/goisilon v1.4.0
github.com/fsnotify/fsnotify v1.4.7
github.com/golang/protobuf v1.4.2
github.com/google/uuid v1.1.1
github.com/gorilla/mux v1.7.3
github.com/kubernetes-csi/csi-lib-utils v0.7.0
github.com/sirupsen/logrus v1.6.0
github.com/fsnotify/fsnotify v1.4.9
github.com/golang/protobuf v1.4.3
github.com/google/uuid v1.2.0
github.com/gorilla/mux v1.8.0
github.com/kubernetes-csi/csi-lib-utils v0.9.1
github.com/sirupsen/logrus v1.8.1
github.com/stretchr/testify v1.6.1
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553
google.golang.org/grpc v1.27.0
gopkg.in/yaml.v2 v2.2.8
k8s.io/apimachinery v0.18.6
k8s.io/client-go v0.18.6
golang.org/x/net v0.0.0-20200707034311-ab3426394381
google.golang.org/grpc v1.29.0
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
k8s.io/apimachinery v0.19.0
k8s.io/client-go v0.19.0
)

go 1.15
go 1.16
Loading

0 comments on commit f776ed0

Please sign in to comment.