Skip to content

Commit

Permalink
update generated man pages and completion
Browse files Browse the repository at this point in the history
  • Loading branch information
mfojtik committed Feb 14, 2017
1 parent 738eca0 commit 3d69ad6
Show file tree
Hide file tree
Showing 11 changed files with 78 additions and 17 deletions.
4 changes: 4 additions & 0 deletions contrib/completions/bash/oadm
Original file line number Diff line number Diff line change
Expand Up @@ -4504,6 +4504,8 @@ _oadm_registry()
local_nonpersistent_flags+=("--dry-run")
flags+=("--enforce-quota")
local_nonpersistent_flags+=("--enforce-quota")
flags+=("--fs-group=")
local_nonpersistent_flags+=("--fs-group=")
flags+=("--images=")
local_nonpersistent_flags+=("--images=")
flags+=("--labels=")
Expand All @@ -4525,6 +4527,8 @@ _oadm_registry()
local_nonpersistent_flags+=("--selector=")
flags+=("--service-account=")
local_nonpersistent_flags+=("--service-account=")
flags+=("--supplemental-groups=")
local_nonpersistent_flags+=("--supplemental-groups=")
flags+=("--tls-certificate=")
local_nonpersistent_flags+=("--tls-certificate=")
flags+=("--tls-key=")
Expand Down
4 changes: 4 additions & 0 deletions contrib/completions/bash/oc
Original file line number Diff line number Diff line change
Expand Up @@ -4513,6 +4513,8 @@ _oc_adm_registry()
local_nonpersistent_flags+=("--dry-run")
flags+=("--enforce-quota")
local_nonpersistent_flags+=("--enforce-quota")
flags+=("--fs-group=")
local_nonpersistent_flags+=("--fs-group=")
flags+=("--images=")
local_nonpersistent_flags+=("--images=")
flags+=("--labels=")
Expand All @@ -4534,6 +4536,8 @@ _oc_adm_registry()
local_nonpersistent_flags+=("--selector=")
flags+=("--service-account=")
local_nonpersistent_flags+=("--service-account=")
flags+=("--supplemental-groups=")
local_nonpersistent_flags+=("--supplemental-groups=")
flags+=("--tls-certificate=")
local_nonpersistent_flags+=("--tls-certificate=")
flags+=("--tls-key=")
Expand Down
8 changes: 8 additions & 0 deletions contrib/completions/bash/openshift
Original file line number Diff line number Diff line change
Expand Up @@ -4504,6 +4504,8 @@ _openshift_admin_registry()
local_nonpersistent_flags+=("--dry-run")
flags+=("--enforce-quota")
local_nonpersistent_flags+=("--enforce-quota")
flags+=("--fs-group=")
local_nonpersistent_flags+=("--fs-group=")
flags+=("--images=")
local_nonpersistent_flags+=("--images=")
flags+=("--labels=")
Expand All @@ -4525,6 +4527,8 @@ _openshift_admin_registry()
local_nonpersistent_flags+=("--selector=")
flags+=("--service-account=")
local_nonpersistent_flags+=("--service-account=")
flags+=("--supplemental-groups=")
local_nonpersistent_flags+=("--supplemental-groups=")
flags+=("--tls-certificate=")
local_nonpersistent_flags+=("--tls-certificate=")
flags+=("--tls-key=")
Expand Down Expand Up @@ -9422,6 +9426,8 @@ _openshift_cli_adm_registry()
local_nonpersistent_flags+=("--dry-run")
flags+=("--enforce-quota")
local_nonpersistent_flags+=("--enforce-quota")
flags+=("--fs-group=")
local_nonpersistent_flags+=("--fs-group=")
flags+=("--images=")
local_nonpersistent_flags+=("--images=")
flags+=("--labels=")
Expand All @@ -9443,6 +9449,8 @@ _openshift_cli_adm_registry()
local_nonpersistent_flags+=("--selector=")
flags+=("--service-account=")
local_nonpersistent_flags+=("--service-account=")
flags+=("--supplemental-groups=")
local_nonpersistent_flags+=("--supplemental-groups=")
flags+=("--tls-certificate=")
local_nonpersistent_flags+=("--tls-certificate=")
flags+=("--tls-key=")
Expand Down
4 changes: 4 additions & 0 deletions contrib/completions/zsh/oadm
Original file line number Diff line number Diff line change
Expand Up @@ -4652,6 +4652,8 @@ _oadm_registry()
local_nonpersistent_flags+=("--dry-run")
flags+=("--enforce-quota")
local_nonpersistent_flags+=("--enforce-quota")
flags+=("--fs-group=")
local_nonpersistent_flags+=("--fs-group=")
flags+=("--images=")
local_nonpersistent_flags+=("--images=")
flags+=("--labels=")
Expand All @@ -4673,6 +4675,8 @@ _oadm_registry()
local_nonpersistent_flags+=("--selector=")
flags+=("--service-account=")
local_nonpersistent_flags+=("--service-account=")
flags+=("--supplemental-groups=")
local_nonpersistent_flags+=("--supplemental-groups=")
flags+=("--tls-certificate=")
local_nonpersistent_flags+=("--tls-certificate=")
flags+=("--tls-key=")
Expand Down
4 changes: 4 additions & 0 deletions contrib/completions/zsh/oc
Original file line number Diff line number Diff line change
Expand Up @@ -4661,6 +4661,8 @@ _oc_adm_registry()
local_nonpersistent_flags+=("--dry-run")
flags+=("--enforce-quota")
local_nonpersistent_flags+=("--enforce-quota")
flags+=("--fs-group=")
local_nonpersistent_flags+=("--fs-group=")
flags+=("--images=")
local_nonpersistent_flags+=("--images=")
flags+=("--labels=")
Expand All @@ -4682,6 +4684,8 @@ _oc_adm_registry()
local_nonpersistent_flags+=("--selector=")
flags+=("--service-account=")
local_nonpersistent_flags+=("--service-account=")
flags+=("--supplemental-groups=")
local_nonpersistent_flags+=("--supplemental-groups=")
flags+=("--tls-certificate=")
local_nonpersistent_flags+=("--tls-certificate=")
flags+=("--tls-key=")
Expand Down
8 changes: 8 additions & 0 deletions contrib/completions/zsh/openshift
Original file line number Diff line number Diff line change
Expand Up @@ -4652,6 +4652,8 @@ _openshift_admin_registry()
local_nonpersistent_flags+=("--dry-run")
flags+=("--enforce-quota")
local_nonpersistent_flags+=("--enforce-quota")
flags+=("--fs-group=")
local_nonpersistent_flags+=("--fs-group=")
flags+=("--images=")
local_nonpersistent_flags+=("--images=")
flags+=("--labels=")
Expand All @@ -4673,6 +4675,8 @@ _openshift_admin_registry()
local_nonpersistent_flags+=("--selector=")
flags+=("--service-account=")
local_nonpersistent_flags+=("--service-account=")
flags+=("--supplemental-groups=")
local_nonpersistent_flags+=("--supplemental-groups=")
flags+=("--tls-certificate=")
local_nonpersistent_flags+=("--tls-certificate=")
flags+=("--tls-key=")
Expand Down Expand Up @@ -9570,6 +9574,8 @@ _openshift_cli_adm_registry()
local_nonpersistent_flags+=("--dry-run")
flags+=("--enforce-quota")
local_nonpersistent_flags+=("--enforce-quota")
flags+=("--fs-group=")
local_nonpersistent_flags+=("--fs-group=")
flags+=("--images=")
local_nonpersistent_flags+=("--images=")
flags+=("--labels=")
Expand All @@ -9591,6 +9597,8 @@ _openshift_cli_adm_registry()
local_nonpersistent_flags+=("--selector=")
flags+=("--service-account=")
local_nonpersistent_flags+=("--service-account=")
flags+=("--supplemental-groups=")
local_nonpersistent_flags+=("--supplemental-groups=")
flags+=("--tls-certificate=")
local_nonpersistent_flags+=("--tls-certificate=")
flags+=("--tls-key=")
Expand Down
8 changes: 8 additions & 0 deletions docs/man/man1/oadm-registry.1
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ NOTE: This command is intended to simplify the tasks of setting up a Docker regi
\fB\-\-enforce\-quota\fP=false
If true, the registry will refuse to write blobs if they exceed quota limits

.PP
\fB\-\-fs\-group\fP=""
Specify fsGroup which is an ID's that grants group access to registry block storage

.PP
\fB\-\-images\fP="openshift/origin\-${component}:${version}"
The image to base this registry on \- ${component} will be replaced with \-\-type
Expand Down Expand Up @@ -85,6 +89,10 @@ NOTE: This command is intended to simplify the tasks of setting up a Docker regi
\fB\-\-service\-account\fP="registry"
Name of the service account to use to run the registry pod.

.PP
\fB\-\-supplemental\-groups\fP=[]
Specify supplemental groups which is an array of ID's that grants group access to registry shared storage

.PP
\fB\-\-tls\-certificate\fP=""
An optional path to a PEM encoded certificate (which may contain the private key) for serving over TLS
Expand Down
8 changes: 8 additions & 0 deletions docs/man/man1/oc-adm-registry.1
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ NOTE: This command is intended to simplify the tasks of setting up a Docker regi
\fB\-\-enforce\-quota\fP=false
If true, the registry will refuse to write blobs if they exceed quota limits

.PP
\fB\-\-fs\-group\fP=""
Specify fsGroup which is an ID's that grants group access to registry block storage

.PP
\fB\-\-images\fP="openshift/origin\-${component}:${version}"
The image to base this registry on \- ${component} will be replaced with \-\-type
Expand Down Expand Up @@ -85,6 +89,10 @@ NOTE: This command is intended to simplify the tasks of setting up a Docker regi
\fB\-\-service\-account\fP="registry"
Name of the service account to use to run the registry pod.

.PP
\fB\-\-supplemental\-groups\fP=[]
Specify supplemental groups which is an array of ID's that grants group access to registry shared storage

.PP
\fB\-\-tls\-certificate\fP=""
An optional path to a PEM encoded certificate (which may contain the private key) for serving over TLS
Expand Down
8 changes: 8 additions & 0 deletions docs/man/man1/openshift-admin-registry.1
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ NOTE: This command is intended to simplify the tasks of setting up a Docker regi
\fB\-\-enforce\-quota\fP=false
If true, the registry will refuse to write blobs if they exceed quota limits

.PP
\fB\-\-fs\-group\fP=""
Specify fsGroup which is an ID's that grants group access to registry block storage

.PP
\fB\-\-images\fP="openshift/origin\-${component}:${version}"
The image to base this registry on \- ${component} will be replaced with \-\-type
Expand Down Expand Up @@ -85,6 +89,10 @@ NOTE: This command is intended to simplify the tasks of setting up a Docker regi
\fB\-\-service\-account\fP="registry"
Name of the service account to use to run the registry pod.

.PP
\fB\-\-supplemental\-groups\fP=[]
Specify supplemental groups which is an array of ID's that grants group access to registry shared storage

.PP
\fB\-\-tls\-certificate\fP=""
An optional path to a PEM encoded certificate (which may contain the private key) for serving over TLS
Expand Down
8 changes: 8 additions & 0 deletions docs/man/man1/openshift-cli-adm-registry.1
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ NOTE: This command is intended to simplify the tasks of setting up a Docker regi
\fB\-\-enforce\-quota\fP=false
If true, the registry will refuse to write blobs if they exceed quota limits

.PP
\fB\-\-fs\-group\fP=""
Specify fsGroup which is an ID's that grants group access to registry block storage

.PP
\fB\-\-images\fP="openshift/origin\-${component}:${version}"
The image to base this registry on \- ${component} will be replaced with \-\-type
Expand Down Expand Up @@ -85,6 +89,10 @@ NOTE: This command is intended to simplify the tasks of setting up a Docker regi
\fB\-\-service\-account\fP="registry"
Name of the service account to use to run the registry pod.

.PP
\fB\-\-supplemental\-groups\fP=[]
Specify supplemental groups which is an array of ID's that grants group access to registry shared storage

.PP
\fB\-\-tls\-certificate\fP=""
An optional path to a PEM encoded certificate (which may contain the private key) for serving over TLS
Expand Down
31 changes: 14 additions & 17 deletions pkg/cmd/admin/registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ type RegistryConfig struct {
DaemonSet bool
EnforceQuota bool

// SupplementalGroupRange is list of int64, however cobra does not have appropriate func
// SupplementalGroups is list of int64, however cobra does not have appropriate func
// for that type list.
SupplementalGroupRange []string
FSGroup string
SupplementalGroups []string
FSGroup string

ServingCertPath string
ServingKeyPath string
Expand Down Expand Up @@ -186,8 +186,8 @@ func NewCmdRegistry(f *clientcmd.Factory, parentName, name string, out, errout i
cmd.Flags().StringVar(&cfg.Selector, "selector", cfg.Selector, "Selector used to filter nodes on deployment. Used to run registries on a specific set of nodes.")
cmd.Flags().StringVar(&cfg.ServingCertPath, "tls-certificate", cfg.ServingCertPath, "An optional path to a PEM encoded certificate (which may contain the private key) for serving over TLS")
cmd.Flags().StringVar(&cfg.ServingKeyPath, "tls-key", cfg.ServingKeyPath, "An optional path to a PEM encoded private key for serving over TLS")
cmd.Flags().StringSliceVar(&cfg.SupplementalGroupRange, "supplemental-groups", cfg.SupplementalGroupRange, "Specify supplemental groups which is an array of ID's that grants group access to registry shared storage")
cmd.Flags().StringVar(&cfg.FSGroup, "fs-group", "", "Specify fsGroup which is an ID's that grants group access to registry block storage")
cmd.Flags().StringSliceVar(&cfg.SupplementalGroups, "supplemental-groups", cfg.SupplementalGroups, "Specify supplemental groups which is an array of ID's that grants group access to registry shared storage")
cmd.Flags().StringVar(&cfg.FSGroup, "fs-group", "", "Specify fsGroup which is an ID that grants group access to registry block storage")
cmd.Flags().BoolVar(&cfg.DaemonSet, "daemonset", cfg.DaemonSet, "If true, use a daemonset instead of a deployment config.")
cmd.Flags().BoolVar(&cfg.EnforceQuota, "enforce-quota", cfg.EnforceQuota, "If true, the registry will refuse to write blobs if they exceed quota limits")

Expand Down Expand Up @@ -232,19 +232,19 @@ func (opts *RegistryOptions) Complete(f *clientcmd.Factory, cmd *cobra.Command,
}

if len(opts.Config.FSGroup) > 0 {
if val, err := strconv.ParseInt(opts.Config.FSGroup, 10, 64); err != nil || val == 0 {
if val, err := strconv.ParseInt(opts.Config.FSGroup, 10, 64); err != nil {
return kcmdutil.UsageError(cmd, "invalid group ID %q specified for fsGroup (%v)", opts.Config.FSGroup, err)
}
}

if len(opts.Config.SupplementalGroupRange) > 0 {
for _, v := range opts.Config.SupplementalGroupRange {
if len(opts.Config.SupplementalGroups) > 0 {
for _, v := range opts.Config.SupplementalGroups {
if val, err := strconv.ParseInt(v, 10, 64); err != nil || val == 0 {
return kcmdutil.UsageError(cmd, "invalid group ID %q specified for supplemental group (%v)", v, err)
}
}
}
if len(opts.Config.SupplementalGroupRange) > 0 && len(opts.Config.FSGroup) > 0 {
if len(opts.Config.SupplementalGroups) > 0 && len(opts.Config.FSGroup) > 0 {
return kcmdutil.UsageError(cmd, "fsGroup and supplemental groups cannot be specified both at the same time")
}

Expand Down Expand Up @@ -571,16 +571,13 @@ func generateSecretsConfig(

func generateSecurityContext(conf *RegistryConfig) *kapi.PodSecurityContext {
result := &kapi.PodSecurityContext{}
if len(conf.SupplementalGroupRange) > 0 {
if len(conf.SupplementalGroups) > 0 {
result.SupplementalGroups = []int64{}
for _, val := range conf.SupplementalGroupRange {
groupID, err := strconv.ParseInt(val, 10, 64)
if err != nil {
// Don't need to report the error here as invalid values will be denied in
// Complete().
continue
for _, val := range conf.SupplementalGroups {
// The errors are handled by Complete()
if groupID, err := strconv.ParseInt(val, 10, 64); err == nil {
result.SupplementalGroups = append(result.SupplementalGroups, groupID)
}
result.SupplementalGroups = append(result.SupplementalGroups, groupID)
}
}
if len(conf.FSGroup) > 0 {
Expand Down

0 comments on commit 3d69ad6

Please sign in to comment.