feat(go): add nfs_provision and cifs_provision programs - #58
Conversation
There was a problem hiding this comment.
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_provisionto provision a FlexVol plus NFS export policy and client rule in an idempotent workflow. - Introduces
go/cifs_provisionto provision an NTFS-style FlexVol plus CIFS share and ACL, with optional workgroup CIFS server creation. - Extends
catalog.yamlto 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 |
| "context" | ||
| "errors" | ||
| "fmt" | ||
| "log" | ||
| "time" |
| sharePath := fmt.Sprintf("%s/%s/%s", pathCIFSShares, svmUUID, shareName) | ||
| _, err := client.Get(ctx, sharePath, map[string]string{"fields": "name"}) |
| 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) |
| sharePath := fmt.Sprintf("%s/%s/%s", pathCIFSShares, svmUUID, shareName) | ||
| resp, err := client.Get(ctx, sharePath, map[string]string{"fields": "name,path,acls"}) |
|
Test Report looks present - thanks. Reviewers will verify the captured output and idempotency evidence. |
A CI check failed — here is how to fix itWorkflow: Validate Examples · Run #49 · Failed jobs: 2 Go — vet & build-checkGo — vet & build-check failed — open the run logs to see the cause. Ansible — syntax & lint
make ansible-lintSee docs/troubleshooting.md for common Ansible errors. Push a fix and CI re-runs automatically; this comment updates with the next failure (or stays put if the same check fails again). Stuck? Comment on the PR and a maintainer will help — typical response time is 1 business day. Auto-generated · explain-failure.yml |
Summary
Go implementations of
nfs-provisionandcifs-provision, completingfour-language coverage for both use cases.
Changes
go/nfs_provision/main.go— new: create FlexVol + NFS export policy + client-match rule; 6-step idempotent workflowgo/cifs_provision/main.go— new: create NTFS FlexVol + CIFS share + ACL; optional workgroup CIFS server creation; 8-step idempotent workflowcatalog.yaml— addedgovariant tonfs-provisionandcifs-provisionuse casesChecklist
General
catalog.yamland tool README for new/changed examples (see CONTRIBUTING.md)If touching
go/go vet ./...passes (fromgo/directory)go build -o /dev/null .passes for both new programsTest 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