Skip to content
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ else
VERSION ?= ${VERSION}
endif

RELEASE = v1.33.1
RELEASE = v1.33.2

GOOS ?= linux
ARCH ?= amd64
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ spec:
path: /etc/kubernetes
containers:
- name: oci-cloud-controller-manager
image: ghcr.io/oracle/cloud-provider-oci:v1.33.1
image: ghcr.io/oracle/cloud-provider-oci:v1.33.2
command: ["/usr/local/bin/oci-cloud-controller-manager"]
args:
- --cloud-config=/etc/oci/cloud-provider.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ spec:
- --lustre-csi-endpoint=unix://var/run/shared-tmpfs/csi-lustre.sock
command:
- /usr/local/bin/oci-csi-controller-driver
image: ghcr.io/oracle/cloud-provider-oci:v1.33.1
image: ghcr.io/oracle/cloud-provider-oci:v1.33.2
imagePullPolicy: IfNotPresent
env:
- name: BLOCK_VOLUME_DRIVER_NAME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ spec:
value: "{{ if .Values.customHandle }}{{ .Values.customHandle }}.{{ end }}fss.csi.oraclecloud.com"
- name: LUSTRE_VOLUME_DRIVER_NAME
value: "{{ if .Values.customHandle }}{{ .Values.customHandle }}.{{ end }}lustre.csi.oraclecloud.com"
image: ghcr.io/oracle/cloud-provider-oci:v1.33.1
image: ghcr.io/oracle/cloud-provider-oci:v1.33.2
securityContext:
privileged: true
volumeMounts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ spec:
env:
- name: LUSTRE_CSI_CONTROLLER_DRIVER_ENABLED
value: "true"
image: ghcr.io/oracle/cloud-provider-oci:v1.33.1
image: ghcr.io/oracle/cloud-provider-oci:v1.33.2
imagePullPolicy: IfNotPresent
volumeMounts:
- name: config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ spec:
value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/host/usr/bin:/host/sbin
- name: LUSTRE_DRIVER_ENABLED
value: "true"
image: ghcr.io/oracle/cloud-provider-oci:v1.33.1
image: ghcr.io/oracle/cloud-provider-oci:v1.33.2
securityContext:
privileged: true
volumeMounts:
Expand Down
4 changes: 2 additions & 2 deletions manifests/flexvolume-driver/oci-flexvolume-driver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ spec:
secretName: oci-flexvolume-driver
containers:
- name: oci-flexvolume-driver
image: ghcr.io/oracle/cloud-provider-oci:v1.33.1
image: ghcr.io/oracle/cloud-provider-oci:v1.33.2
command: ["/usr/local/bin/install.py", "-c", "/tmp/config.yaml"]
securityContext:
privileged: true
Expand Down Expand Up @@ -76,7 +76,7 @@ spec:
type: DirectoryOrCreate
containers:
- name: oci-flexvolume-driver
image: ghcr.io/oracle/cloud-provider-oci:v1.33.1
image: ghcr.io/oracle/cloud-provider-oci:v1.33.2
command: ["/usr/local/bin/install.py"]
securityContext:
privileged: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
secretName: oci-volume-provisioner
containers:
- name: oci-volume-provisioner
image: ghcr.io/oracle/cloud-provider-oci:v1.33.1
image: ghcr.io/oracle/cloud-provider-oci:v1.33.2
command: ["/usr/local/bin/oci-volume-provisioner"]
env:
- name: NODE_NAME
Expand Down
2 changes: 1 addition & 1 deletion manifests/volume-provisioner/oci-volume-provisioner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
secretName: oci-volume-provisioner
containers:
- name: oci-volume-provisioner
image: ghcr.io/oracle/cloud-provider-oci:v1.33.1
image: ghcr.io/oracle/cloud-provider-oci:v1.33.2
command: ["/usr/local/bin/oci-volume-provisioner"]
env:
- name: NODE_NAME
Expand Down
49 changes: 32 additions & 17 deletions pkg/csi-util/lustre_lnet_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ type Parameter map[string]interface{}
/*
ValidateLustreVolumeId takes lustreVolumeId as input and returns if its valid or not along with lnetLabel
Ex. volume handle : 10.112.10.6@tcp1:/fsname
volume handle : <MGS NID>[:<MGS NID>]:/<fsname>

volume handle : <MGS NID>[:<MGS NID>]:/<fsname>
*/
func ValidateLustreVolumeId(lusterVolumeId string) (bool, string) {
const minNumOfParamsFromVolumeHandle = 2
Expand Down Expand Up @@ -79,7 +80,7 @@ func ValidateLustreVolumeId(lusterVolumeId string) (bool, string) {
type LnetConfigurator interface {
GetNetInterfacesInSubnet(subnetCIDR string) ([]NetInterface, error)
IsLustreClientPackagesInstalled(logger *zap.SugaredLogger) bool
GetLnetInfoByLnetLabel(lnetLabel string) (NetInfo, error)
GetLnetInfoByLnetLabel(logger *zap.SugaredLogger, lnetLabel string) (NetInfo, error)
ConfigureLnet(logger *zap.SugaredLogger, ifaces []NetInterface, lnetLabel string, netInfo NetInfo) error
VerifyLnetConfiguration(logger *zap.SugaredLogger, ifaces []NetInterface, lnetLabel string, netInfo NetInfo, err error) error
ExecuteCommandOnWorkerNode(args ...string) (string, error)
Expand All @@ -91,9 +92,9 @@ type LnetService struct {

type OCILnetConfigurator struct{}

func NewLnetService() *LnetService{
func NewLnetService() *LnetService {
return &LnetService{
Configurator: &OCILnetConfigurator{},
Configurator: &OCILnetConfigurator{},
}
}

Expand Down Expand Up @@ -135,7 +136,7 @@ func (ls *LnetService) SetupLnet(logger *zap.SugaredLogger, lustreSubnetCIDR str

//get existing lnet configuration
var netInfo NetInfo
netInfo, err = ls.Configurator.GetLnetInfoByLnetLabel(lnetLabel)
netInfo, err = ls.Configurator.GetLnetInfoByLnetLabel(logger, lnetLabel)
if err != nil {
return err
}
Expand Down Expand Up @@ -191,20 +192,36 @@ func (olc *OCILnetConfigurator) GetNetInterfacesInSubnet(subnetCIDR string) ([]N
return matchingInterfaces, nil
}

func (olc *OCILnetConfigurator) GetLnetInfoByLnetLabel(lnetLabel string) (NetInfo, error) {
var netInfo NetInfo
func (olc *OCILnetConfigurator) GetLnetInfoByLnetLabel(logger *zap.SugaredLogger, lnetLabel string) (NetInfo, error) {
existingConfiguredLnetInfo, err := olc.ExecuteCommandOnWorkerNode(fmt.Sprintf(SHOW_CONFIGURED_LNET, lnetLabel))
if err != nil {
return netInfo, fmt.Errorf("Failed to get existing configured lnet information with error : %v", err)
return parseLnetInfo(logger, existingConfiguredLnetInfo, err)
}

func parseLnetInfo(logger *zap.SugaredLogger, existingConfiguredLnetInfo string, commandErr error) (NetInfo, error) {
var netInfo NetInfo
if commandErr != nil {
if isLnetNetworkDownResponse(existingConfiguredLnetInfo, commandErr) {
logger.With(zap.Error(commandErr)).Info("Expected failure observed while getting existing configured lnet information because lnet network is down. Starting lnet configuration.")
return netInfo, nil
}
return netInfo, fmt.Errorf("Failed to get existing configured lnet information with error : %v", commandErr)
}

err = yaml.Unmarshal([]byte(existingConfiguredLnetInfo), &netInfo)
err := yaml.Unmarshal([]byte(existingConfiguredLnetInfo), &netInfo)
if err != nil {
return netInfo, fmt.Errorf("Failed to parse lnet information with error : %v", err)
}
return netInfo, nil
}

func isLnetNetworkDownResponse(output string, err error) bool {
if err == nil {
return false
}
lnetctlResponse := fmt.Sprintf("%s\n%v", output, err)
return strings.Contains(lnetctlResponse, "Network is down")
}

func (olc *OCILnetConfigurator) ConfigureLnet(logger *zap.SugaredLogger, interfacesInLustreSubnet []NetInterface, lnetLabel string, netInfo NetInfo) error {
logger.Infof("Existing lnet information : %v", netInfo)

Expand Down Expand Up @@ -255,7 +272,7 @@ func (olc *OCILnetConfigurator) ConfigureLnet(logger *zap.SugaredLogger, interfa
func (olc *OCILnetConfigurator) VerifyLnetConfiguration(logger *zap.SugaredLogger, interfacesInLustreSubnet []NetInterface, lnetLabel string, netInfo NetInfo, err error) error {
logger.Infof("Verifying lnet configuration.")
//Get already configured lnet interfaces
netInfo, err = olc.GetLnetInfoByLnetLabel(lnetLabel)
netInfo, err = olc.GetLnetInfoByLnetLabel(logger, lnetLabel)
if err != nil {
return err
}
Expand Down Expand Up @@ -305,7 +322,7 @@ It returns true when active lnet interface is identified else returns false sing
func (ls *LnetService) IsLnetActive(logger *zap.SugaredLogger, lnetLabel string) bool {
logger.Debugf("Trying to check status of lnet")
//Get already configured lnet interfaces
netInfo, err := ls.Configurator.GetLnetInfoByLnetLabel(lnetLabel)
netInfo, err := ls.Configurator.GetLnetInfoByLnetLabel(logger, lnetLabel)
if err != nil {
logger.With(zap.Error(err)).Errorf("Failed to get lnet info for lnet : %v", lnetLabel)
return false
Expand All @@ -331,7 +348,6 @@ func (ls *LnetService) IsLnetActive(logger *zap.SugaredLogger, lnetLabel string)
}

func (olc *OCILnetConfigurator) ExecuteCommandOnWorkerNode(args ...string) (string, error) {

command := exec.Command("chroot-bash", args...)

output, err := command.CombinedOutput()
Expand Down Expand Up @@ -374,15 +390,15 @@ func isValidShellInput(input string) bool {
return false
}
// List of forbidden characters
forbiddenChars := []string{";", "&", "|", "<", ">", "(", ")", "`", "'", "\"","$","!"}
forbiddenChars := []string{";", "&", "|", "<", ">", "(", ")", "`", "'", "\"", "$", "!"}
for _, char := range forbiddenChars {
if strings.Contains(input, char) {
return false
}
}
return true
}
func ValidateLustreParameters(logger *zap.SugaredLogger, lustreParamsJson string) error {
func ValidateLustreParameters(logger *zap.SugaredLogger, lustreParamsJson string) error {
if lustreParamsJson == "" {
logger.Debug("No lustre parameters specified.")
return nil
Expand All @@ -401,7 +417,7 @@ func ValidateLustreParameters(logger *zap.SugaredLogger, lustreParamsJson strin
for key, value := range param {
logger.Infof("Validating lustre param %s=%s", key, fmt.Sprintf("%v", value))
if !isValidShellInput(key) || !isValidShellInput(fmt.Sprintf("%v", value)) {
invalidParams = append(invalidParams, fmt.Sprintf("%v=%v",key, value))
invalidParams = append(invalidParams, fmt.Sprintf("%v=%v", key, value))
}
}
}
Expand All @@ -411,4 +427,3 @@ func ValidateLustreParameters(logger *zap.SugaredLogger, lustreParamsJson strin
logger.Infof("Successfully validated lustre parameters.")
return nil
}

Loading
Loading