Skip to content

Commit

Permalink
Merge pull request #1747 from vrothberg/RUN-1935
Browse files Browse the repository at this point in the history
parse: support `no-dereference` mount option
  • Loading branch information
openshift-merge-bot[bot] committed Nov 21, 2023
2 parents 37f046e + 21345b4 commit d54dcfe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/parse/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

// ValidateVolumeOpts validates a volume's options
func ValidateVolumeOpts(options []string) ([]string, error) {
var foundRootPropagation, foundRWRO, foundLabelChange, bindType, foundExec, foundDev, foundSuid, foundChown, foundUpperDir, foundWorkDir, foundCopy int
var foundRootPropagation, foundRWRO, foundLabelChange, bindType, foundExec, foundDev, foundSuid, foundChown, foundUpperDir, foundWorkDir, foundCopy, foundCopySymlink int
finalOpts := make([]string, 0, len(options))
for _, opt := range options {
// support advanced options like upperdir=/path, workdir=/path
Expand Down Expand Up @@ -93,6 +93,11 @@ func ValidateVolumeOpts(options []string) ([]string, error) {
if foundCopy > 1 {
return nil, fmt.Errorf("invalid options %q, can only specify 1 'copy' or 'nocopy' option", strings.Join(options, ", "))
}
case "no-dereference":
foundCopySymlink++
if foundCopySymlink > 1 {
return nil, fmt.Errorf("invalid options %q, can only specify 1 'no-dereference' option", strings.Join(options, ", "))
}
default:
return nil, fmt.Errorf("invalid option type %q", opt)
}
Expand Down

0 comments on commit d54dcfe

Please sign in to comment.