Skip to content

cmd: ex: standalone docker garbage collector #16796

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

Merged
merged 1 commit into from
Oct 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions contrib/completions/bash/openshift
Original file line number Diff line number Diff line change
Expand Up @@ -23425,6 +23425,71 @@ _openshift_ex_config()
noun_aliases=()
}

_openshift_ex_dockergc()
{
last_command="openshift_ex_dockergc"
commands=()

flags=()
two_word_flags=()
local_nonpersistent_flags=()
flags_with_completion=()
flags_completion=()

flags+=("--dry-run")
local_nonpersistent_flags+=("--dry-run")
flags+=("--image-gc-high-threshold=")
local_nonpersistent_flags+=("--image-gc-high-threshold=")
flags+=("--image-gc-low-threshold=")
local_nonpersistent_flags+=("--image-gc-low-threshold=")
flags+=("--minimum-ttl-duration=")
local_nonpersistent_flags+=("--minimum-ttl-duration=")
flags+=("--output=")
two_word_flags+=("-o")
local_nonpersistent_flags+=("--output=")
flags+=("--show-all")
flags+=("-a")
local_nonpersistent_flags+=("--show-all")
flags+=("--show-labels")
local_nonpersistent_flags+=("--show-labels")
flags+=("--sort-by=")
local_nonpersistent_flags+=("--sort-by=")
flags+=("--template=")
flags_with_completion+=("--template")
flags_completion+=("_filedir")
local_nonpersistent_flags+=("--template=")
flags+=("--as=")
flags+=("--as-group=")
flags+=("--certificate-authority=")
flags_with_completion+=("--certificate-authority")
flags_completion+=("_filedir")
flags+=("--client-certificate=")
flags_with_completion+=("--client-certificate")
flags_completion+=("_filedir")
flags+=("--client-key=")
flags_with_completion+=("--client-key")
flags_completion+=("_filedir")
flags+=("--cluster=")
flags+=("--config=")
flags_with_completion+=("--config")
flags_completion+=("_filedir")
flags+=("--context=")
flags+=("--insecure-skip-tls-verify")
flags+=("--loglevel=")
flags+=("--logspec=")
flags+=("--match-server-version")
flags+=("--namespace=")
two_word_flags+=("-n")
flags+=("--request-timeout=")
flags+=("--server=")
flags+=("--token=")
flags+=("--user=")

must_have_one_flag=()
must_have_one_noun=()
noun_aliases=()
}

_openshift_ex_ipfailover()
{
last_command="openshift_ex_ipfailover"
Expand Down Expand Up @@ -23705,6 +23770,7 @@ _openshift_ex()
commands=()
commands+=("build-chain")
commands+=("config")
commands+=("dockergc")
commands+=("ipfailover")
commands+=("options")
commands+=("prune-groups")
Expand Down
66 changes: 66 additions & 0 deletions contrib/completions/zsh/openshift
Original file line number Diff line number Diff line change
Expand Up @@ -23574,6 +23574,71 @@ _openshift_ex_config()
noun_aliases=()
}

_openshift_ex_dockergc()
{
last_command="openshift_ex_dockergc"
commands=()

flags=()
two_word_flags=()
local_nonpersistent_flags=()
flags_with_completion=()
flags_completion=()

flags+=("--dry-run")
local_nonpersistent_flags+=("--dry-run")
flags+=("--image-gc-high-threshold=")
local_nonpersistent_flags+=("--image-gc-high-threshold=")
flags+=("--image-gc-low-threshold=")
local_nonpersistent_flags+=("--image-gc-low-threshold=")
flags+=("--minimum-ttl-duration=")
local_nonpersistent_flags+=("--minimum-ttl-duration=")
flags+=("--output=")
two_word_flags+=("-o")
local_nonpersistent_flags+=("--output=")
flags+=("--show-all")
flags+=("-a")
local_nonpersistent_flags+=("--show-all")
flags+=("--show-labels")
local_nonpersistent_flags+=("--show-labels")
flags+=("--sort-by=")
local_nonpersistent_flags+=("--sort-by=")
flags+=("--template=")
flags_with_completion+=("--template")
flags_completion+=("_filedir")
local_nonpersistent_flags+=("--template=")
flags+=("--as=")
flags+=("--as-group=")
flags+=("--certificate-authority=")
flags_with_completion+=("--certificate-authority")
flags_completion+=("_filedir")
flags+=("--client-certificate=")
flags_with_completion+=("--client-certificate")
flags_completion+=("_filedir")
flags+=("--client-key=")
flags_with_completion+=("--client-key")
flags_completion+=("_filedir")
flags+=("--cluster=")
flags+=("--config=")
flags_with_completion+=("--config")
flags_completion+=("_filedir")
flags+=("--context=")
flags+=("--insecure-skip-tls-verify")
flags+=("--loglevel=")
flags+=("--logspec=")
flags+=("--match-server-version")
flags+=("--namespace=")
two_word_flags+=("-n")
flags+=("--request-timeout=")
flags+=("--server=")
flags+=("--token=")
flags+=("--user=")

must_have_one_flag=()
must_have_one_noun=()
noun_aliases=()
}

_openshift_ex_ipfailover()
{
last_command="openshift_ex_ipfailover"
Expand Down Expand Up @@ -23854,6 +23919,7 @@ _openshift_ex()
commands=()
commands+=("build-chain")
commands+=("config")
commands+=("dockergc")
commands+=("ipfailover")
commands+=("options")
commands+=("prune-groups")
Expand Down
1 change: 1 addition & 0 deletions docs/man/man1/.files_generated_openshift
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ openshift-ex-build-chain.1
openshift-ex-config-patch.1
openshift-ex-config.1
openshift-ex-diagnostics.1
openshift-ex-dockergc.1
openshift-ex-ipfailover.1
openshift-ex-options.1
openshift-ex-prune-groups.1
Expand Down
3 changes: 3 additions & 0 deletions docs/man/man1/openshift-ex-dockergc.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This file is autogenerated, but we've stopped checking such files into the
repository to reduce the need for rebases. Please run hack/generate-docs.sh to
populate this file.
52 changes: 52 additions & 0 deletions examples/dockergc/dockergc-ds.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
apiVersion: v1
kind: List
items:
- apiVersion: v1
kind: ServiceAccount
metadata:
name: dockergc
# You must grant privileged via: oadm policy add-scc-to-user -z dockergc privileged
# in order for the dockergc to access the docker socket and root directory
- apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: dockergc
labels:
app: dockergc
spec:
template:
metadata:
labels:
app: dockergc
name: dockergc
spec:
serviceAccountName: dockergc
containers:
- image: openshift/origin:latest
args:
- "ex"
- "dockergc"
- "--image-gc-low-threshold=60"
- "--image-gc-high-threshold=80"
- "--minimum-ttl-duration=1h0m0s"
securityContext:
privileged: true
name: dockergc
resources:
requests:
memory: 30Mi
cpu: 50m
volumeMounts:
- name: docker-root
readOnly: true
mountPath: /var/lib/docker
- name: docker-socket
readOnly: false
mountPath: /var/run/docker.sock
volumes:
- name: docker-root
hostPath:
path: /var/lib/docker
- name: docker-socket
hostPath:
path: /var/run/docker.sock
2 changes: 2 additions & 0 deletions pkg/cmd/openshift/openshift.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
"github.com/openshift/origin/pkg/oc/cli/cmd"
"github.com/openshift/origin/pkg/oc/experimental/buildchain"
configcmd "github.com/openshift/origin/pkg/oc/experimental/config"
"github.com/openshift/origin/pkg/oc/experimental/dockergc"
exipfailover "github.com/openshift/origin/pkg/oc/experimental/ipfailover"
)

Expand Down Expand Up @@ -175,6 +176,7 @@ func newExperimentalCommand(name, fullName string) *cobra.Command {

experimental.AddCommand(validate.NewCommandValidate(validate.ValidateRecommendedName, fullName+" "+validate.ValidateRecommendedName, out, errout))
experimental.AddCommand(exipfailover.NewCmdIPFailoverConfig(f, fullName, "ipfailover", out, errout))
experimental.AddCommand(dockergc.NewCmdDockerGCConfig(f, fullName, "dockergc", out, errout))
experimental.AddCommand(buildchain.NewCmdBuildChain(name, fullName+" "+buildchain.BuildChainRecommendedCommandName, f, out))
experimental.AddCommand(configcmd.NewCmdConfig(configcmd.ConfigRecommendedName, fullName+" "+configcmd.ConfigRecommendedName, f, out, errout))
deprecatedDiag := diagnostics.NewCmdDiagnostics(diagnostics.DiagnosticsRecommendedName, fullName+" "+diagnostics.DiagnosticsRecommendedName, out)
Expand Down
Loading