Skip to content

Commit

Permalink
Add oc ignition convert3
Browse files Browse the repository at this point in the history
The transition to Ignition Spec 3 with 4.6 creates a
discontinuity. Some users want to update their bootimages,
e.g. for a cluster originally provisioned as 4.4 but upgraded
in place to 4.6, it should be possible to directly use RHCOS 4.6
bootimages for new workers.

In some cases in fact, this could be required for things like
adding a node with newer hardware.

The main stumbling block here is the pointer ignition config
which is generated by `openshift-install`.  Since the idea is
`openshift-install` should in theory be disposable after a cluster
is provisioned, let's add this to `oc` which admins will need anyways.
Vendor and use
https://github.com/coreos/ign-converter
the same as the MCO uses.

xref openshift/enhancements#492 (comment)
xref https://bugzilla.redhat.com/show_bug.cgi?id=1884750
  • Loading branch information
cgwalters committed Oct 29, 2020
1 parent 6576713 commit 6b63fc3
Show file tree
Hide file tree
Showing 228 changed files with 23,476 additions and 0 deletions.
128 changes: 128 additions & 0 deletions contrib/completions/bash/oc
Original file line number Diff line number Diff line change
Expand Up @@ -13373,6 +13373,133 @@ _oc_idle()
noun_aliases=()
}

_oc_ignition_convert3()
{
last_command="oc_ignition_convert3"

command_aliases=()

commands=()

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

flags+=("--in=")
two_word_flags+=("--in")
flags_with_completion+=("--in")
flags_completion+=("_filedir")
local_nonpersistent_flags+=("--in=")
flags+=("--out=")
two_word_flags+=("--out")
flags_with_completion+=("--out")
flags_completion+=("_filedir")
local_nonpersistent_flags+=("--out=")
flags+=("--as=")
two_word_flags+=("--as")
flags+=("--as-group=")
two_word_flags+=("--as-group")
flags+=("--cache-dir=")
two_word_flags+=("--cache-dir")
flags+=("--certificate-authority=")
two_word_flags+=("--certificate-authority")
flags+=("--client-certificate=")
two_word_flags+=("--client-certificate")
flags+=("--client-key=")
two_word_flags+=("--client-key")
flags+=("--cluster=")
two_word_flags+=("--cluster")
flags+=("--context=")
two_word_flags+=("--context")
flags+=("--insecure-skip-tls-verify")
flags+=("--kubeconfig=")
two_word_flags+=("--kubeconfig")
flags+=("--match-server-version")
flags+=("--namespace=")
two_word_flags+=("--namespace")
flags_with_completion+=("--namespace")
flags_completion+=("__oc_get_namespaces")
two_word_flags+=("-n")
flags_with_completion+=("-n")
flags_completion+=("__oc_get_namespaces")
flags+=("--request-timeout=")
two_word_flags+=("--request-timeout")
flags+=("--server=")
two_word_flags+=("--server")
two_word_flags+=("-s")
flags+=("--tls-server-name=")
two_word_flags+=("--tls-server-name")
flags+=("--token=")
two_word_flags+=("--token")
flags+=("--user=")
two_word_flags+=("--user")

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

_oc_ignition()
{
last_command="oc_ignition"

command_aliases=()

commands=()
commands+=("convert3")

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

flags+=("--as=")
two_word_flags+=("--as")
flags+=("--as-group=")
two_word_flags+=("--as-group")
flags+=("--cache-dir=")
two_word_flags+=("--cache-dir")
flags+=("--certificate-authority=")
two_word_flags+=("--certificate-authority")
flags+=("--client-certificate=")
two_word_flags+=("--client-certificate")
flags+=("--client-key=")
two_word_flags+=("--client-key")
flags+=("--cluster=")
two_word_flags+=("--cluster")
flags+=("--context=")
two_word_flags+=("--context")
flags+=("--insecure-skip-tls-verify")
flags+=("--kubeconfig=")
two_word_flags+=("--kubeconfig")
flags+=("--match-server-version")
flags+=("--namespace=")
two_word_flags+=("--namespace")
flags_with_completion+=("--namespace")
flags_completion+=("__oc_get_namespaces")
two_word_flags+=("-n")
flags_with_completion+=("-n")
flags_completion+=("__oc_get_namespaces")
flags+=("--request-timeout=")
two_word_flags+=("--request-timeout")
flags+=("--server=")
two_word_flags+=("--server")
two_word_flags+=("-s")
flags+=("--tls-server-name=")
two_word_flags+=("--tls-server-name")
flags+=("--token=")
two_word_flags+=("--token")
flags+=("--user=")
two_word_flags+=("--user")

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

_oc_image_append()
{
last_command="oc_image_append"
Expand Down Expand Up @@ -20655,6 +20782,7 @@ _oc_root_command()
commands+=("extract")
commands+=("get")
commands+=("idle")
commands+=("ignition")
commands+=("image")
commands+=("import-image")
commands+=("kustomize")
Expand Down
128 changes: 128 additions & 0 deletions contrib/completions/zsh/oc
Original file line number Diff line number Diff line change
Expand Up @@ -13473,6 +13473,133 @@ _oc_idle()
noun_aliases=()
}

_oc_ignition_convert3()
{
last_command="oc_ignition_convert3"

command_aliases=()

commands=()

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

flags+=("--in=")
two_word_flags+=("--in")
flags_with_completion+=("--in")
flags_completion+=("_filedir")
local_nonpersistent_flags+=("--in=")
flags+=("--out=")
two_word_flags+=("--out")
flags_with_completion+=("--out")
flags_completion+=("_filedir")
local_nonpersistent_flags+=("--out=")
flags+=("--as=")
two_word_flags+=("--as")
flags+=("--as-group=")
two_word_flags+=("--as-group")
flags+=("--cache-dir=")
two_word_flags+=("--cache-dir")
flags+=("--certificate-authority=")
two_word_flags+=("--certificate-authority")
flags+=("--client-certificate=")
two_word_flags+=("--client-certificate")
flags+=("--client-key=")
two_word_flags+=("--client-key")
flags+=("--cluster=")
two_word_flags+=("--cluster")
flags+=("--context=")
two_word_flags+=("--context")
flags+=("--insecure-skip-tls-verify")
flags+=("--kubeconfig=")
two_word_flags+=("--kubeconfig")
flags+=("--match-server-version")
flags+=("--namespace=")
two_word_flags+=("--namespace")
flags_with_completion+=("--namespace")
flags_completion+=("__oc_get_namespaces")
two_word_flags+=("-n")
flags_with_completion+=("-n")
flags_completion+=("__oc_get_namespaces")
flags+=("--request-timeout=")
two_word_flags+=("--request-timeout")
flags+=("--server=")
two_word_flags+=("--server")
two_word_flags+=("-s")
flags+=("--tls-server-name=")
two_word_flags+=("--tls-server-name")
flags+=("--token=")
two_word_flags+=("--token")
flags+=("--user=")
two_word_flags+=("--user")

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

_oc_ignition()
{
last_command="oc_ignition"

command_aliases=()

commands=()
commands+=("convert3")

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

flags+=("--as=")
two_word_flags+=("--as")
flags+=("--as-group=")
two_word_flags+=("--as-group")
flags+=("--cache-dir=")
two_word_flags+=("--cache-dir")
flags+=("--certificate-authority=")
two_word_flags+=("--certificate-authority")
flags+=("--client-certificate=")
two_word_flags+=("--client-certificate")
flags+=("--client-key=")
two_word_flags+=("--client-key")
flags+=("--cluster=")
two_word_flags+=("--cluster")
flags+=("--context=")
two_word_flags+=("--context")
flags+=("--insecure-skip-tls-verify")
flags+=("--kubeconfig=")
two_word_flags+=("--kubeconfig")
flags+=("--match-server-version")
flags+=("--namespace=")
two_word_flags+=("--namespace")
flags_with_completion+=("--namespace")
flags_completion+=("__oc_get_namespaces")
two_word_flags+=("-n")
flags_with_completion+=("-n")
flags_completion+=("__oc_get_namespaces")
flags+=("--request-timeout=")
two_word_flags+=("--request-timeout")
flags+=("--server=")
two_word_flags+=("--server")
two_word_flags+=("-s")
flags+=("--tls-server-name=")
two_word_flags+=("--tls-server-name")
flags+=("--token=")
two_word_flags+=("--token")
flags+=("--user=")
two_word_flags+=("--user")

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

_oc_image_append()
{
last_command="oc_image_append"
Expand Down Expand Up @@ -20755,6 +20882,7 @@ _oc_root_command()
commands+=("extract")
commands+=("get")
commands+=("idle")
commands+=("ignition")
commands+=("image")
commands+=("import-image")
commands+=("kustomize")
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ require (
github.com/bugsnag/panicwrap v1.2.0 // indirect
github.com/containers/image v0.0.0-00010101000000-000000000000
github.com/containers/storage v0.0.0-20190726081758-912de200380a // indirect
github.com/coreos/ign-converter v0.0.0-20200918193805-44d462f1c700
github.com/coreos/ignition v0.35.0
github.com/davecgh/go-spew v1.1.1
github.com/docker/distribution v2.7.1+incompatible
github.com/docker/docker v1.4.2-0.20200309214505-aa6a9891b09c
Expand Down
Loading

0 comments on commit 6b63fc3

Please sign in to comment.