Skip to content

Commit

Permalink
Add migrate command for legacy HPAs
Browse files Browse the repository at this point in the history
There are current broken HPAs floating around that either use the legacy
oapi DeploymentConfig defintion (`v1.DeploymentConfig`) or the incorrect
API group, due to the webconsole (all scalables, but with the group as
`extensions/v1beta1`).  This introduces a migrate command that corrects
the ScaleTargetRef of those HPAs to have correct API groups that are
usable by generic scale clients.
  • Loading branch information
DirectXMan12 committed Feb 28, 2018
1 parent f2b6cd1 commit 1df1296
Show file tree
Hide file tree
Showing 9 changed files with 493 additions and 0 deletions.
86 changes: 86 additions & 0 deletions contrib/completions/bash/oc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

86 changes: 86 additions & 0 deletions contrib/completions/zsh/oc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/man/man1/.files_generated_oc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions docs/man/man1/oc-adm-migrate-legacy-hpa.1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pkg/oc/admin/admin.go
Expand Up @@ -21,6 +21,7 @@ import (
migrateauthorization "github.com/openshift/origin/pkg/oc/admin/migrate/authorization"
migrateetcd "github.com/openshift/origin/pkg/oc/admin/migrate/etcd"
migrateimages "github.com/openshift/origin/pkg/oc/admin/migrate/images"
migratehpa "github.com/openshift/origin/pkg/oc/admin/migrate/legacyhpa"
migratestorage "github.com/openshift/origin/pkg/oc/admin/migrate/storage"
"github.com/openshift/origin/pkg/oc/admin/network"
"github.com/openshift/origin/pkg/oc/admin/node"
Expand Down Expand Up @@ -97,6 +98,7 @@ func NewCommandAdmin(name, fullName string, in io.Reader, out io.Writer, errout
migratestorage.NewCmdMigrateAPIStorage("storage", fullName+" "+migrate.MigrateRecommendedName+" storage", f, in, out, errout),
migrateauthorization.NewCmdMigrateAuthorization("authorization", fullName+" "+migrate.MigrateRecommendedName+" authorization", f, in, out, errout),
migrateetcd.NewCmdMigrateTTLs("etcd-ttl", fullName+" "+migrate.MigrateRecommendedName+" etcd-ttl", f, in, out, errout),
migratehpa.NewCmdMigrateLegacyHPA("legacy-hpa", fullName+" "+migrate.MigrateRecommendedName+" legacy-hpa", f, in, out, errout),
),
top.NewCommandTop(top.TopRecommendedName, fullName+" "+top.TopRecommendedName, f, out, errout),
image.NewCmdVerifyImageSignature(name, fullName+" "+image.VerifyRecommendedName, f, out, errout),
Expand Down

0 comments on commit 1df1296

Please sign in to comment.