Skip to content

Commit 86cf222

Browse files
Add Ontap AFX support for NAS driver
Signed-off-by: Meghna Singh <[email protected]>
1 parent fec9f70 commit 86cf222

File tree

765 files changed

+723651
-441135
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

765 files changed

+723651
-441135
lines changed

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,3 +470,12 @@ lint-precommit: .git/hooks install-lint
470470

471471
lint-prepush: .git/hooks install-lint .git/hooks/pre-push
472472
@cp hooks/golangci-lint.sh .git/hooks/pre-push
473+
474+
EXCLUDE_PACKAGES := client/clientset client/informers client/listers storage/external_test astrads/api/v1alpha1 ontap/api/azgo ontap/api/rest fake github.com/netapp/trident/mocks/ github.com/netapp/trident/operator/controllers/provisioner github.com/netapp/trident/operator/controllers/provisioner/apis/netapp/v1 github.com/netapp/trident/storage_drivers/astrads/api/v1beta1
475+
476+
test-coverage:
477+
@EXCLUDE_PATTERN=$$(echo $(EXCLUDE_PACKAGES) | sed 's/ /|/g'); \
478+
packages=$$(go list ./... | grep -Ev "$$EXCLUDE_PATTERN"); \
479+
go test -v -short -p 1 -coverprofile=coverage.out $$packages; \
480+
OVERALL_COVERAGE=$$(go tool cover -func=coverage.out | grep total | awk '{print $$3}'); \
481+
echo "Overall coverage: $$OVERALL_COVERAGE"

storage_drivers/ontap/api/abstraction_rest.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,12 @@ func (d OntapAPIREST) VolumeCreate(ctx context.Context, volume Volume) error {
177177
defer Logd(ctx, d.driverName,
178178
d.api.ClientConfig().DebugTraceFlags["method"]).WithFields(fields).Trace("<<<< VolumeCreate")
179179

180-
creationErr := d.api.VolumeCreate(ctx, volume.Name, volume.Aggregates[0], volume.Size, volume.SpaceReserve,
180+
aggregateName := ""
181+
if len(volume.Aggregates) > 0 {
182+
aggregateName = volume.Aggregates[0]
183+
}
184+
185+
creationErr := d.api.VolumeCreate(ctx, volume.Name, aggregateName, volume.Size, volume.SpaceReserve,
181186
volume.SnapshotPolicy, volume.UnixPermissions, volume.ExportPolicy, volume.SecurityStyle,
182187
volume.TieringPolicy, volume.Comment, volume.Qos, volume.Encrypt, volume.SnapshotReserve, volume.DPVolume)
183188
if creationErr != nil {

storage_drivers/ontap/api/ontap_rest.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4623,6 +4623,10 @@ func (c *RestClient) ExportRuleDestroy(
46234623
func ToSliceVolumeAggregatesItems(aggrs []string) []*models.VolumeInlineAggregatesInlineArrayItem {
46244624
var result []*models.VolumeInlineAggregatesInlineArrayItem
46254625
for _, aggregateName := range aggrs {
4626+
// Skip empty aggregate names
4627+
if strings.TrimSpace(aggregateName) == "" {
4628+
continue
4629+
}
46264630
item := &models.VolumeInlineAggregatesInlineArrayItem{
46274631
Name: convert.ToPtr(aggregateName),
46284632
}

storage_drivers/ontap/api/rest/client/application/application_client.go

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

storage_drivers/ontap/api/rest/client/application/consistency_group_collection_get_parameters.go

Lines changed: 816 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

storage_drivers/ontap/api/rest/client/application/consistency_group_delete_collection_parameters.go

Lines changed: 816 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)