Skip to content

Commit

Permalink
[ISSUE-1018] Custom Storage Group Feature (#997)
Browse files Browse the repository at this point in the history
* add StorageGroup property in proto message

Signed-off-by: Shi, Crane <[email protected]>

* generate types.pb.go from types.proto

Signed-off-by: Shi, Crane <[email protected]>

* make non-lvg volume creation consistent with storage group label

Signed-off-by: Shi, Crane <[email protected]>

* set storageGroup to volume CR

Signed-off-by: Shi, Crane <[email protected]>

* support syncing storage group label to LVG CR if necessary

Signed-off-by: Shi, Crane <[email protected]>

* fix

Signed-off-by: Shi, Crane <[email protected]>

* fix UT

Signed-off-by: Shi, Crane <[email protected]>

* remove setting storageGroup property in volume CR eventually

Signed-off-by: Shi, Crane <[email protected]>

* sync driveCR's storage-group label to AC

Signed-off-by: Shi, Crane <[email protected]>

* fix UT

Signed-off-by: Shi, Crane <[email protected]>

* fix UT

Signed-off-by: Shi, Crane <[email protected]>

* rename and extract the storagegroup label key as constants

Signed-off-by: Shi, Crane <[email protected]>

* sync the storage-group label removal from drives to ACs

Signed-off-by: Shi, Crane <[email protected]>

* remove sync storage-group label from drive to AC in capacitycontroller

Signed-off-by: Shi, Crane <[email protected]>

* Revert "remove sync storage-group label from drive to AC in capacitycontroller"

This reverts commit 7d57051.

Signed-off-by: Shi, Crane <[email protected]>

* Add StorageGroup Schema Definition and generated files

Signed-off-by: Shi, Crane <[email protected]>

* refine StorageGroup definition

Signed-off-by: Shi, Crane <[email protected]>

* Add storagegroup controller

Signed-off-by: Shi, Crane <[email protected]>

* Add storagegroup crd to scheme

Signed-off-by: Shi, Crane <[email protected]>

* handling of storagegroup creation

Signed-off-by: Shi, Crane <[email protected]>

* remove sync storage-group label from drive to AC in capacitycontroller

Signed-off-by: Shi, Crane <[email protected]>

* fix

Signed-off-by: Shi, Crane <[email protected]>

* add debug log

Signed-off-by: Shi, Crane <[email protected]>

* support storage-group deletion

Signed-off-by: Shi, Crane <[email protected]>

* Handle invalidField and make MatchFields ANDed

Signed-off-by: Shi, Crane <[email protected]>

* support NumberDrivesPerNode in DriveSelector

Signed-off-by: Shi, Crane <[email protected]>

* fix & add log for noDriveSelected and invalidField

Signed-off-by: Shi, Crane <[email protected]>

* refine log

Signed-off-by: Shi, Crane <[email protected]>

* fix issue in noDriveSelected and numberDrivesPerNode support

Signed-off-by: Shi, Crane <[email protected]>

* refine log

Signed-off-by: Shi, Crane <[email protected]>

* fix matchFields issue on bool type

Signed-off-by: Shi, Crane <[email protected]>

* fix the issue that drive with non-lvg volume may be selected

Signed-off-by: Shi, Crane <[email protected]>

* fix golint

Signed-off-by: Shi, Crane <[email protected]>

* fix golint

Signed-off-by: Shi, Crane <[email protected]>

* refine handleStorageGroupCreation

Signed-off-by: Shi, Crane <[email protected]>

* refine handleStorageGroupCreation

Signed-off-by: Shi, Crane <[email protected]>

* refine to fix golint error

Signed-off-by: Shi, Crane <[email protected]>

* fix golint

Signed-off-by: Shi, Crane <[email protected]>

* refine log

Signed-off-by: Shi, Crane <[email protected]>

* Change storagegroup print column

Signed-off-by: Shi, Crane <[email protected]>

* support manual storage-group labeling on drive again

Signed-off-by: Shi, Crane <[email protected]>

* only watch storagegroup delete event in storagegroup controller

Signed-off-by: Shi, Crane <[email protected]>

* Refactor func to add/rm sg label and enhance manual sg labeling

Signed-off-by: Shi, Crane <[email protected]>

* support to get ac for drive with lvg in drive sg label sync

Signed-off-by: Shi, Crane <[email protected]>

* now also include drive del event for storagegroup controller

Signed-off-by: Shi, Crane <[email protected]>

* fix log error

Signed-off-by: Shi, Crane <[email protected]>

* fix that no del event of sg is caught

Signed-off-by: Shi, Crane <[email protected]>

* refine log & add initial draft of func syncDriveOnAllStorageGroups

Signed-off-by: Shi, Crane <[email protected]>

* support simple status tracking of storagegroup

Signed-off-by: Shi, Crane <[email protected]>

* add support of storage group label sync on new drive creation

Signed-off-by: Shi, Crane <[email protected]>

* fix lint error

Signed-off-by: Shi, Crane <[email protected]>

* fix lint error

Signed-off-by: Shi, Crane <[email protected]>

* service procedure only supports storage group whose numDrivesPerNode is 0

Signed-off-by: Shi, Crane <[email protected]>

* fix sg nil annotation panic error

Signed-off-by: Shi, Crane <[email protected]>

* service procedure support of storage group whose numDrivesPerNode>0

Signed-off-by: Shi, Crane <[email protected]>

* fix go lint error

Signed-off-by: Shi, Crane <[email protected]>

* fix issue in reconcile of sg with numberDrivesPerNode>0

Signed-off-by: Shi, Crane <[email protected]>

* refine logic for reconcile of sg with numDrivesPerNode>0

Signed-off-by: Shi, Crane <[email protected]>

* sg label restore on drive selected by sg with numDrviesPerNode>0

Signed-off-by: Shi, Crane <[email protected]>

* refine the logic to sync drive label on sg with numDrivesPerNode>0

Signed-off-by: Shi, Crane <[email protected]>

* Revert syncing storage group label to LVG CR if necessary

Signed-off-by: Shi, Crane <[email protected]>

* fix error in log

Signed-off-by: Shi, Crane <[email protected]>

* add more log for adding sg label to drive

Signed-off-by: Shi, Crane <[email protected]>

* refine log

Signed-off-by: Shi, Crane <[email protected]>

* refine code comment and increase UT coverage

Signed-off-by: Shi, Crane <[email protected]>

* try increase UT coverage

Signed-off-by: Shi, Crane <[email protected]>

* resolve review comments

Signed-off-by: Shi, Crane <[email protected]>

* refine storagegroupcontroller updateEventFilter & nil labels case handle

Signed-off-by: Shi, Crane <[email protected]>

* try fix golint

Signed-off-by: Shi, Crane <[email protected]>

* try to fix golint

Signed-off-by: Shi, Crane <[email protected]>

* fix devkit base image tag to 15.4 to resolve devkit image build failure

Signed-off-by: Shi, Crane <[email protected]>

* nil map can still work for map entry read

Signed-off-by: Shi, Crane <[email protected]>

* refine error handling and error log

Signed-off-by: Shi, Crane <[email protected]>

* add comments to main function

Signed-off-by: Shi, Crane <[email protected]>

* refine error messages for labeling and label removal in sg handling

Signed-off-by: Shi, Crane <[email protected]>

* removal some deprecated bool flags

Signed-off-by: Shi, Crane <[email protected]>

* sync storage group label to LVG CR if necessary

Signed-off-by: Shi, Crane <[email protected]>

* refine sg ctrl's drive update event predicate to include drive removal

Signed-off-by: Shi, Crane <[email protected]>

* still only focus on drive sg label update event

Signed-off-by: Shi, Crane <[email protected]>

---------

Signed-off-by: Shi, Crane <[email protected]>
  • Loading branch information
CraneShiEMC authored Jun 27, 2023
1 parent 23a99e1 commit 1a54002
Show file tree
Hide file tree
Showing 20 changed files with 1,017 additions and 71 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ generate-deepcopy:
controller-gen object paths=api/v1/drivecrd/drive_types.go paths=api/v1/drivecrd/groupversion_info.go output:dir=api/v1/drivecrd
controller-gen object paths=api/v1/lvgcrd/logicalvolumegroup_types.go paths=api/v1/lvgcrd/groupversion_info.go output:dir=api/v1/lvgcrd
controller-gen object paths=api/v1/nodecrd/node_types.go paths=api/v1/nodecrd/groupversion_info.go output:dir=api/v1/nodecrd
controller-gen object paths=api/v1/storagegroupcrd/storagegroup_types.go paths=api/v1/storagegroupcrd/groupversion_info.go output:dir=api/v1/storagegroupcrd

generate-baremetal-crds: install-controller-gen
controller-gen $(CRD_OPTIONS) paths=api/v1/availablecapacitycrd/availablecapacity_types.go paths=api/v1/availablecapacitycrd/groupversion_info.go output:crd:dir=$(CSI_CHART_CRDS_PATH)
Expand All @@ -120,6 +121,7 @@ generate-baremetal-crds: install-controller-gen
controller-gen $(CRD_OPTIONS) paths=api/v1/drivecrd/drive_types.go paths=api/v1/drivecrd/groupversion_info.go output:crd:dir=$(CSI_CHART_CRDS_PATH)
controller-gen $(CRD_OPTIONS) paths=api/v1/lvgcrd/logicalvolumegroup_types.go paths=api/v1/lvgcrd/groupversion_info.go output:crd:dir=$(CSI_CHART_CRDS_PATH)
controller-gen $(CRD_OPTIONS) paths=api/v1/nodecrd/node_types.go paths=api/v1/nodecrd/groupversion_info.go output:crd:dir=$(CSI_CHART_CRDS_PATH)
controller-gen $(CRD_OPTIONS) paths=api/v1/storagegroupcrd/storagegroup_types.go paths=api/v1/storagegroupcrd/groupversion_info.go output:crd:dir=$(CSI_CHART_CRDS_PATH)

generate-api: compile-proto generate-baremetal-crds generate-deepcopy

Expand Down
220 changes: 166 additions & 54 deletions api/generated/v1/types.pb.go

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions api/v1/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,7 @@ const (
// CSI Drive taint-like label key and value
DriveTaintKey = "drive.csi-baremetal.dell.com/taint"
DriveTaintValue = "NoSchedule"

// CSI StorageGroup label key
StorageGroupLabelKey = "drive.csi-baremetal.dell.com/storage-group"
)
38 changes: 38 additions & 0 deletions api/v1/storagegroupcrd/groupversion_info.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
Copyright © 2020 Dell Inc. or its subsidiaries. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Package sgcrd contains API Schema definitions for the StorageGroup v1 API group
// +groupName=csi-baremetal.dell.com
// +versionName=v1
package sgcrd

import (
"k8s.io/apimachinery/pkg/runtime/schema"
crScheme "sigs.k8s.io/controller-runtime/pkg/scheme"

v1 "github.com/dell/csi-baremetal/api/v1"
)

var (
// GroupVersionStorageGroup is group version used to register these objects
GroupVersionStorageGroup = schema.GroupVersion{Group: v1.CSICRsGroupVersion, Version: v1.Version}

// SchemeBuilderStorageGroup is used to add go types to the GroupVersionKind scheme
SchemeBuilderStorageGroup = &crScheme.Builder{GroupVersion: GroupVersionStorageGroup}

// AddToSchemeStorageGroup adds the types in this group-version to the given scheme.
AddToSchemeStorageGroup = SchemeBuilderStorageGroup.AddToScheme
)
58 changes: 58 additions & 0 deletions api/v1/storagegroupcrd/storagegroup_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
Copyright © 2020 Dell Inc. or its subsidiaries. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package sgcrd

import (
api "github.com/dell/csi-baremetal/api/generated/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// +kubebuilder:object:root=true

// StorageGroup is the Schema for the StorageGroups API
// +kubebuilder:resource:scope=Cluster,shortName={sg,sgs}
// +kubebuilder:printcolumn:name="DRIVES_PER_NODE",type="string",JSONPath=".spec.driveSelector.numberDrivesPerNode",description="numberDrivesPerNode of StorageGroup's DriveSelector"
// +kubebuilder:printcolumn:name="TYPE",type="string",JSONPath=".spec.driveSelector.matchFields.Type",description="Drive Type of StorageGroup's DriveSelector"
// +kubebuilder:printcolumn:name="SLOT",type="string",JSONPath=".spec.driveSelector.matchFields.Slot",description="Drive Slot of StorageGroup's DriveSelector"
// +kubebuilder:printcolumn:name="PATH",type="string",JSONPath=".spec.driveSelector.matchFields.Path",description="Drive Path of StorageGroup's DriveSelector"
// +kubebuilder:printcolumn:name="SYSTEM",type="string",JSONPath=".spec.driveSelector.matchFields.IsSystem",description="Whether StorageGroup's DriveSelector to Select System Drive"
type StorageGroup struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec api.StorageGroupSpec `json:"spec,omitempty"`
}

// +kubebuilder:object:root=true

// StorageGroupList contains a list of StorageGroup
//+kubebuilder:object:generate=true
type StorageGroupList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []StorageGroup `json:"items"`
}

func init() {
SchemeBuilderStorageGroup.Register(&StorageGroup{}, &StorageGroupList{})
}

func (in *StorageGroup) DeepCopyInto(out *StorageGroup) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec
}
60 changes: 60 additions & 0 deletions api/v1/storagegroupcrd/zz_generated.deepcopy.go

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

11 changes: 11 additions & 0 deletions api/v1/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ message Volume {
string Usage = 13;
// inline volumes are not support anymore. need to remove field in the next version
bool Ephemeral = 14;
string StorageGroup = 15;
}

message AvailableCapacity {
Expand Down Expand Up @@ -80,6 +81,7 @@ message CapacityRequest {
string Name = 1;
string StorageClass = 2;
int64 Size = 3;
string StorageGroup = 4;
}

message LogicalVolumeGroup {
Expand All @@ -97,3 +99,12 @@ message Node {
// key - address type, value - address, align with NodeAddress struct from k8s.io/api/core/v1
map<string, string> Addresses = 2;
}

message StorageGroupSpec {
DriveSelector driveSelector = 1;
}

message DriveSelector {
int32 numberDrivesPerNode = 1;
map<string, string> matchFields = 2;
}
12 changes: 12 additions & 0 deletions cmd/controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import (
accrd "github.com/dell/csi-baremetal/api/v1/availablecapacitycrd"
"github.com/dell/csi-baremetal/api/v1/drivecrd"
"github.com/dell/csi-baremetal/api/v1/lvgcrd"
sgcrd "github.com/dell/csi-baremetal/api/v1/storagegroupcrd"
"github.com/dell/csi-baremetal/api/v1/volumecrd"
"github.com/dell/csi-baremetal/pkg/base"
"github.com/dell/csi-baremetal/pkg/base/featureconfig"
Expand All @@ -51,6 +52,7 @@ import (
"github.com/dell/csi-baremetal/pkg/controller"
"github.com/dell/csi-baremetal/pkg/controller/capacitycontroller"
"github.com/dell/csi-baremetal/pkg/crcontrollers/reservation"
"github.com/dell/csi-baremetal/pkg/crcontrollers/storagegroup"
"github.com/dell/csi-baremetal/pkg/metrics"
)

Expand Down Expand Up @@ -168,6 +170,10 @@ func createManager(ctx context.Context, client *k8s.KubeClient, log *logrus.Logg
return nil, err
}

if err := sgcrd.AddToSchemeStorageGroup(scheme); err != nil {
return nil, err
}

mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
Namespace: *namespace,
Expand Down Expand Up @@ -196,5 +202,11 @@ func createManager(ctx context.Context, client *k8s.KubeClient, log *logrus.Logg
if err = capacityController.SetupWithManager(mgr); err != nil {
return nil, err
}

storageGroupController := storagegroup.NewController(client, kubeCache, log)
if err = storageGroupController.SetupWithManager(mgr); err != nil {
return nil, err
}

return mgr, nil
}
2 changes: 1 addition & 1 deletion devkit/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN apt update \
&& /kind/kind-build.sh /kind


FROM opensuse/leap:latest
FROM opensuse/leap:15.4

ARG arg_docker_ver
ARG arg_go_ver
Expand Down
2 changes: 1 addition & 1 deletion pkg/base/capacityplanner/node_capacity.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func (nc *nodeCapacity) selectACForVolume(vol *genV1.Volume) *accrd.AvailableCap
}

for _, ac := range nc.acsOrder[vol.StorageClass] {
if requiredSize <= nc.acs[ac].Spec.Size {
if requiredSize <= nc.acs[ac].Spec.Size && nc.acs[ac].Labels[v1.StorageGroupLabelKey] == vol.StorageGroup {
// check if AC is reserved
reservation, ok := nc.reservedACs[ac]

Expand Down
19 changes: 17 additions & 2 deletions pkg/base/k8s/kubeclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import (
"github.com/dell/csi-baremetal/api/v1/drivecrd"
"github.com/dell/csi-baremetal/api/v1/lvgcrd"
"github.com/dell/csi-baremetal/api/v1/nodecrd"
sgcrd "github.com/dell/csi-baremetal/api/v1/storagegroupcrd"
"github.com/dell/csi-baremetal/api/v1/volumecrd"
"github.com/dell/csi-baremetal/pkg/base"
checkErr "github.com/dell/csi-baremetal/pkg/base/error"
Expand Down Expand Up @@ -227,15 +228,15 @@ func (k *KubeClient) ConstructACRCR(name string, apiACR api.AvailableCapacityRes
// ConstructLVGCR constructs LogicalVolumeGroup custom resource from api.LogicalVolumeGroup struct
// Receives a name for k8s ObjectMeta and an instance of api.LogicalVolumeGroup struct
// Returns an instance of LogicalVolumeGroup CR struct
func (k *KubeClient) ConstructLVGCR(name string, apiLVG api.LogicalVolumeGroup) *lvgcrd.LogicalVolumeGroup {
func (k *KubeClient) ConstructLVGCR(name, storageGroup string, apiLVG api.LogicalVolumeGroup) *lvgcrd.LogicalVolumeGroup {
return &lvgcrd.LogicalVolumeGroup{
TypeMeta: apisV1.TypeMeta{
Kind: crdV1.LVGKind,
APIVersion: crdV1.APIV1Version,
},
ObjectMeta: apisV1.ObjectMeta{
Name: name,
Labels: constructDefaultAppMap(),
Labels: constructLVGCRLabels(storageGroup),
},
Spec: apiLVG,
}
Expand Down Expand Up @@ -409,6 +410,12 @@ func PrepareScheme() (*runtime.Scheme, error) {
return nil, err
}

// register csi storagegroup crd
err := sgcrd.AddToSchemeStorageGroup(scheme)
if err != nil {
return nil, err
}

return scheme, nil
}

Expand All @@ -420,3 +427,11 @@ func constructDefaultAppMap() (labels map[string]string) {
}
return
}

func constructLVGCRLabels(storageGroup string) (labels map[string]string) {
labels = constructDefaultAppMap()
if storageGroup != "" {
labels[crdV1.StorageGroupLabelKey] = storageGroup
}
return labels
}
15 changes: 14 additions & 1 deletion pkg/base/k8s/kubeclient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const (
testID = "someID"
testNode1Name = "node1"
testDriveLocation1 = "drive"
testStorageGroup = "test-group"
)

var (
Expand Down Expand Up @@ -496,7 +497,7 @@ var _ = Describe("Constructor methods", func() {
})
Context("ConstructLVGCR", func() {
It("Should return right LogicalVolumeGroup CR", func() {
constructedCR := k8sclient.ConstructLVGCR(testLVGName, testApiLVG)
constructedCR := k8sclient.ConstructLVGCR(testLVGName, "", testApiLVG)
Expect(constructedCR.TypeMeta.Kind).To(Equal(testLVGCR.TypeMeta.Kind))
Expect(constructedCR.TypeMeta.APIVersion).To(Equal(testLVGCR.TypeMeta.APIVersion))
Expect(constructedCR.ObjectMeta.Name).To(Equal(testLVGCR.ObjectMeta.Name))
Expand All @@ -505,6 +506,18 @@ var _ = Describe("Constructor methods", func() {
Expect(constructedCR.Labels).To(Equal(constructDefaultAppMap()))
})
})
Context("ConstructLVGCR with storage group", func() {
It("Should return right LogicalVolumeGroup CR with storage group", func() {
constructedCR := k8sclient.ConstructLVGCR(testLVGName, testStorageGroup, testApiLVG)
Expect(constructedCR.TypeMeta.Kind).To(Equal(testLVGCR.TypeMeta.Kind))
Expect(constructedCR.TypeMeta.APIVersion).To(Equal(testLVGCR.TypeMeta.APIVersion))
Expect(constructedCR.ObjectMeta.Name).To(Equal(testLVGCR.ObjectMeta.Name))
Expect(constructedCR.ObjectMeta.Namespace).To(Equal(testLVGCR.ObjectMeta.Namespace))
Expect(constructedCR.Labels[apiV1.StorageGroupLabelKey]).To(Equal(testStorageGroup))
Expect(constructedCR.Spec).To(Equal(testLVGCR.Spec))
Expect(constructedCR.Labels).To(Equal(constructLVGCRLabels(testStorageGroup)))
})
})
})

// remove all crds (volume and ac)
Expand Down
6 changes: 3 additions & 3 deletions pkg/common/ac_operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (

// AvailableCapacityOperations is the interface for interact with AvailableCapacity CRs from Controller
type AvailableCapacityOperations interface {
RecreateACToLVGSC(ctx context.Context, sc string, acs ...accrd.AvailableCapacity) *accrd.AvailableCapacity
RecreateACToLVGSC(ctx context.Context, sc, sg string, acs ...accrd.AvailableCapacity) *accrd.AvailableCapacity
}

// ACOperationsImpl is the basic implementation of AvailableCapacityOperations interface
Expand All @@ -56,7 +56,7 @@ func NewACOperationsImpl(k8sClient *k8s.KubeClient, l *logrus.Logger) *ACOperati
// Concerts first AC to LVG SC and set size of remaining to 0
// Receives newSC as string (e.g. HDDLVG) and AvailableCapacities where LVG should be based
// Returns created AC or nil
func (a *ACOperationsImpl) RecreateACToLVGSC(ctx context.Context, newSC string,
func (a *ACOperationsImpl) RecreateACToLVGSC(ctx context.Context, newSC, storageGroup string,
acs ...accrd.AvailableCapacity) *accrd.AvailableCapacity {
ll := a.log.WithFields(logrus.Fields{
"method": "RecreateACToLVGSC",
Expand Down Expand Up @@ -90,7 +90,7 @@ func (a *ACOperationsImpl) RecreateACToLVGSC(ctx context.Context, newSC string,
)

// create LVG CR based on ACs
lvg := a.k8sClient.ConstructLVGCR(name, apiLVG)
lvg := a.k8sClient.ConstructLVGCR(name, storageGroup, apiLVG)
if err = a.k8sClient.CreateCR(ctx, name, lvg); err != nil {
ll.Errorf("Unable to create LVG CR: %v", err)
return nil
Expand Down
Loading

0 comments on commit 1a54002

Please sign in to comment.