Skip to content

Commit

Permalink
Add a migration framework for mutable resources
Browse files Browse the repository at this point in the history
Implement a migration framework and an image reference migrator:

    oadm migrate image-references registry1.com/*=registry2.com/* --confirm

Reuse resource builder to manage output
  • Loading branch information
smarterclayton committed Jun 9, 2016
1 parent dbaf253 commit a803f03
Show file tree
Hide file tree
Showing 16 changed files with 1,077 additions and 6 deletions.
93 changes: 93 additions & 0 deletions contrib/completions/bash/oadm
Original file line number Diff line number Diff line change
Expand Up @@ -1921,6 +1921,98 @@ _oadm_prune()
must_have_one_noun=()
}

_oadm_migrate_image-references()
{
last_command="oadm_migrate_image-references"
commands=()

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

flags+=("--all-namespaces")
flags+=("--confirm")
flags+=("--filename=")
flags_with_completion+=("--filename")
flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
two_word_flags+=("-f")
flags_with_completion+=("-f")
flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
flags+=("--include=")
flags+=("--api-version=")
flags+=("--as=")
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+=("--google-json-key=")
flags+=("--insecure-skip-tls-verify")
flags+=("--log-flush-frequency=")
flags+=("--match-server-version")
flags+=("--namespace=")
two_word_flags+=("-n")
flags+=("--server=")
flags+=("--token=")
flags+=("--user=")

must_have_one_flag=()
must_have_one_flag+=("--filename=")
must_have_one_flag+=("-f")
must_have_one_noun=()
}

_oadm_migrate()
{
last_command="oadm_migrate"
commands=()
commands+=("image-references")

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

flags+=("--api-version=")
flags+=("--as=")
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+=("--google-json-key=")
flags+=("--insecure-skip-tls-verify")
flags+=("--log-flush-frequency=")
flags+=("--match-server-version")
flags+=("--namespace=")
two_word_flags+=("-n")
flags+=("--server=")
flags+=("--token=")
flags+=("--user=")

must_have_one_flag=()
must_have_one_noun=()
}

_oadm_config_view()
{
last_command="oadm_config_view"
Expand Down Expand Up @@ -3262,6 +3354,7 @@ _oadm()
commands+=("diagnostics")
commands+=("manage-node")
commands+=("prune")
commands+=("migrate")
commands+=("config")
commands+=("create-kubeconfig")
commands+=("create-api-client-config")
Expand Down
93 changes: 93 additions & 0 deletions contrib/completions/bash/oc
Original file line number Diff line number Diff line change
Expand Up @@ -5009,6 +5009,98 @@ _oc_adm_prune()
must_have_one_noun=()
}

_oc_adm_migrate_image-references()
{
last_command="oc_adm_migrate_image-references"
commands=()

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

flags+=("--all-namespaces")
flags+=("--confirm")
flags+=("--filename=")
flags_with_completion+=("--filename")
flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
two_word_flags+=("-f")
flags_with_completion+=("-f")
flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
flags+=("--include=")
flags+=("--api-version=")
flags+=("--as=")
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+=("--google-json-key=")
flags+=("--insecure-skip-tls-verify")
flags+=("--log-flush-frequency=")
flags+=("--match-server-version")
flags+=("--namespace=")
two_word_flags+=("-n")
flags+=("--server=")
flags+=("--token=")
flags+=("--user=")

must_have_one_flag=()
must_have_one_flag+=("--filename=")
must_have_one_flag+=("-f")
must_have_one_noun=()
}

_oc_adm_migrate()
{
last_command="oc_adm_migrate"
commands=()
commands+=("image-references")

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

flags+=("--api-version=")
flags+=("--as=")
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+=("--google-json-key=")
flags+=("--insecure-skip-tls-verify")
flags+=("--log-flush-frequency=")
flags+=("--match-server-version")
flags+=("--namespace=")
two_word_flags+=("-n")
flags+=("--server=")
flags+=("--token=")
flags+=("--user=")

must_have_one_flag=()
must_have_one_noun=()
}

_oc_adm_config_view()
{
last_command="oc_adm_config_view"
Expand Down Expand Up @@ -6350,6 +6442,7 @@ _oc_adm()
commands+=("diagnostics")
commands+=("manage-node")
commands+=("prune")
commands+=("migrate")
commands+=("config")
commands+=("create-kubeconfig")
commands+=("create-api-client-config")
Expand Down
Loading

0 comments on commit a803f03

Please sign in to comment.