Skip to content

Commit

Permalink
Merge pull request #710 from ecordell/mirror-followups
Browse files Browse the repository at this point in the history
Bug 1917522: Mark filter-by-os deprecated in oc adm catalog mirror
  • Loading branch information
openshift-merge-robot authored Jan 19, 2021
2 parents 4d52be6 + 1694d81 commit 6f8f260
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
4 changes: 0 additions & 4 deletions contrib/completions/bash/oc
Original file line number Diff line number Diff line change
Expand Up @@ -706,10 +706,6 @@ _oc_adm_catalog_mirror()
local_nonpersistent_flags+=("--dir=")
flags+=("--dry-run")
local_nonpersistent_flags+=("--dry-run")
flags+=("--filter-by-os=")
two_word_flags+=("--filter-by-os")
local_nonpersistent_flags+=("--filter-by-os")
local_nonpersistent_flags+=("--filter-by-os=")
flags+=("--from-dir=")
two_word_flags+=("--from-dir")
local_nonpersistent_flags+=("--from-dir")
Expand Down
4 changes: 0 additions & 4 deletions contrib/completions/zsh/oc
Original file line number Diff line number Diff line change
Expand Up @@ -806,10 +806,6 @@ _oc_adm_catalog_mirror()
local_nonpersistent_flags+=("--dir=")
flags+=("--dry-run")
local_nonpersistent_flags+=("--dry-run")
flags+=("--filter-by-os=")
two_word_flags+=("--filter-by-os")
local_nonpersistent_flags+=("--filter-by-os")
local_nonpersistent_flags+=("--filter-by-os=")
flags+=("--from-dir=")
two_word_flags+=("--from-dir")
local_nonpersistent_flags+=("--from-dir")
Expand Down
6 changes: 3 additions & 3 deletions pkg/cli/admin/catalog/mirror.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"io/ioutil"
"os"
"path/filepath"
"regexp"
"strings"
"text/tabwriter"
"time"
Expand Down Expand Up @@ -135,6 +134,7 @@ func NewMirrorCatalog(f kcmdutil.Factory, streams genericclioptions.IOStreams) *
// the old flag name is kept for backwards-compatibility.
// if both old and new are specified, the value of the flag coming later will be used.
flags.StringVar(&o.FilterOptions.FilterByOS, "filter-by-os", o.FilterOptions.FilterByOS, "Use --index-filter-by-os instead. A regular expression to control which index image is picked when multiple variants are available. Images will be passed as '<platform>/<architecture>[/<variant>]'. This does not apply to images referenced by the index.")
_ = flags.MarkDeprecated("filter-by-os", "use --index-filter-by-os instead")

flags.StringVar(&o.ManifestDir, "to-manifests", "", "Local path to store manifests.")
flags.StringVar(&o.DatabasePath, "path", "", "Specify an in-container to local path mapping for the database.")
Expand All @@ -154,10 +154,10 @@ func (o *MirrorCatalogOptions) Complete(cmd *cobra.Command, args []string) error
src := args[0]
dest := args[1]

// default to linux/arm64 for index image, which we generally expect to exist
// default to linux/amd64 for index image, which we generally expect to exist
pattern := o.FilterOptions.FilterByOS
if len(pattern) == 0 {
o.FilterOptions.FilterByOS = regexp.QuoteMeta(fmt.Sprintf("%s/%s", "linux", "amd64"))
o.FilterOptions.FilterByOS = "linux/amd64"
}
if err := o.FilterOptions.Validate(); err != nil {
return err
Expand Down

0 comments on commit 6f8f260

Please sign in to comment.