-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Allow modifying NFS Export with valid zero values #186
Open
rounak-adhikary
wants to merge
1
commit into
main
Choose a base branch
from
usr/rounak/nfs-export
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,7 +66,8 @@ type NFSExportCreate struct { | |
type NFSExportModify struct { | ||
// An optional description for the host. | ||
// The description should not be more than 256 UTF-8 characters long and should not have any unprintable characters. | ||
Description string `json:"description,omitempty"` | ||
// Empty string is a valid description value, so omitempty should not be used. | ||
Description string `json:"description"` | ||
|
||
// Read-Write | ||
// Hosts to add to the current read_write_hosts list. Hosts can be entered by Hostname, IP addresses | ||
|
@@ -103,23 +104,30 @@ type NFSExportModify struct { | |
// NFS enforced security type for users accessing an NFS Export. | ||
MinSecurity string `json:"min_security,omitempty"` | ||
// Hosts with no access to the NFS export or its snapshots. | ||
NoAccessHosts []string `json:"no_access_hosts,omitempty"` | ||
// Empty list is a valid value, so omitempty should not be used. | ||
NoAccessHosts []string `json:"no_access_hosts"` | ||
// Hosts with read-only access to the NFS export and its snapshots. | ||
ReadOnlyHosts []string `json:"read_only_hosts,omitempty"` | ||
// Empty list is a valid value, so omitempty should not be used. | ||
ReadOnlyHosts []string `json:"read_only_hosts"` | ||
// Hosts with read-only and read-only for root user access to the NFS Export and its snapshots. | ||
ReadOnlyRootHosts []string `json:"read_only_root_hosts,omitempty"` | ||
// Empty list is a valid value, so omitempty should not be used. | ||
ReadOnlyRootHosts []string `json:"read_only_root_hosts"` | ||
// Hosts with read and write access to the NFS export and its snapshots. | ||
ReadWriteHosts []string `json:"read_write_hosts,omitempty"` | ||
// Empty list is a valid value, so omitempty should not be used. | ||
ReadWriteHosts []string `json:"read_write_hosts"` | ||
// Hosts with read and write and read and write for root user access to the NFS Export and its snapshots. | ||
ReadWriteRootHosts []string `json:"read_write_root_hosts,omitempty"` | ||
// Empty list is a valid value, so omitempty should not be used. | ||
ReadWriteRootHosts []string `json:"read_write_root_hosts"` | ||
// Specifies the user ID of the anonymous account. | ||
AnonymousUID int32 `json:"anonymous_UID,omitempty"` | ||
// Zero ID is a valid value, so omitempty should not be used. | ||
AnonymousUID int32 `json:"anonymous_UID"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure if one can unset AnonymousUID and GID. If that is not allowed, let's not remove 'omitempty'. |
||
// Specifies the group ID of the anonymous account. | ||
AnonymousGID int32 `json:"anonymous_GID,omitempty"` | ||
// Zero ID is a valid value, so omitempty should not be used. | ||
AnonymousGID int32 `json:"anonymous_GID"` | ||
// If set, do not allow access to set SUID. Otherwise, allow access. | ||
IsNoSUID bool `json:"is_no_SUID"` | ||
// (*Applies to NFS shares of VMware NFS storage resources.*) Default owner of the NFS Export associated with the datastore. Required if secure NFS enabled. For NFSv3 or NFSv4 without Kerberos, the default owner is root. Was added in version 3.0.0.0. | ||
NFSOwnerUsername string `json:"nfs_owner_usernamestring,omitempty"` | ||
NFSOwnerUsername string `json:"nfs_owner_username,omitempty"` | ||
} | ||
|
||
// NFSServerCreate details about creation of new NFS server | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
For all the hosts list, there are 'add' and 'remove' lists in NFSExportModify. Could you check if you can make use of those fields to add or remove a host from the list during modify operation.?
Removing omitempty for these lists have an effect on other Client library users.