Skip to content

feat(go): add nfs_provision and cifs_provision programs#58

Open
mahatvagarg wants to merge 1 commit into
mainfrom
feat/go-nfs-cifs-provision
Open

feat(go): add nfs_provision and cifs_provision programs#58
mahatvagarg wants to merge 1 commit into
mainfrom
feat/go-nfs-cifs-provision

Conversation

@mahatvagarg

Copy link
Copy Markdown
Collaborator

Summary

Go implementations of nfs-provision and cifs-provision, completing
four-language coverage for both use cases.

Changes

  • go/nfs_provision/main.go — new: create FlexVol + NFS export policy + client-match rule; 6-step idempotent workflow
  • go/cifs_provision/main.go — new: create NTFS FlexVol + CIFS share + ACL; optional workgroup CIFS server creation; 8-step idempotent workflow
  • catalog.yaml — added go variant to nfs-provision and cifs-provision use cases

Checklist

General

  • No secrets, credentials, or API tokens in code or config
  • Updated catalog.yaml and tool README for new/changed examples (see CONTRIBUTING.md)

If touching go/

  • go vet ./... passes (from go/ directory)
  • go build -o /dev/null . passes for both new programs

Test Report

Environment: ONTAP Simulator (vSIM), Go 1.26.4, Windows 11
Platform version: ONTAP 9.14.1 onwards
Style touched: go

Ran both scripts against a vSIM. Volumes, export policy, CIFS share, and ACL
were created on first run. Re-running both scripts a second time skipped all
already-existing resources without errors.

Related issues

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Go implementations for the existing nfs-provision and cifs-provision use cases, bringing Go parity alongside the repository’s other language variants and wiring the new examples into the central example catalog.

Changes:

  • Introduces go/nfs_provision to provision a FlexVol plus NFS export policy and client rule in an idempotent workflow.
  • Introduces go/cifs_provision to provision an NTFS-style FlexVol plus CIFS share and ACL, with optional workgroup CIFS server creation.
  • Extends catalog.yaml to register the new Go variants for both use cases.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
go/nfs_provision/main.go New Go program implementing NFS volume + export policy provisioning workflow
go/cifs_provision/main.go New Go program implementing CIFS volume + share + ACL provisioning workflow
catalog.yaml Adds go variants for nfs-provision and cifs-provision use cases

Comment thread go/cifs_provision/main.go
Comment on lines +45 to +49
"context"
"errors"
"fmt"
"log"
"time"
Comment thread go/cifs_provision/main.go
Comment on lines +222 to +223
sharePath := fmt.Sprintf("%s/%s/%s", pathCIFSShares, svmUUID, shareName)
_, err := client.Get(ctx, sharePath, map[string]string{"fields": "name"})
Comment thread go/cifs_provision/main.go
Comment on lines +248 to +249
aclPath := fmt.Sprintf("%s/%s/%s/acls/%s/windows", pathCIFSShares, svmUUID, shareName, user)
log.Printf("Setting ACL: %s → %s on share '%s'…", user, permission, shareName)
Comment thread go/cifs_provision/main.go
Comment on lines +259 to +260
sharePath := fmt.Sprintf("%s/%s/%s", pathCIFSShares, svmUUID, shareName)
resp, err := client.Get(ctx, sharePath, map[string]string{"fields": "name,path,acls"})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants