Skip to content

Commit

Permalink
CLOUDP-76451: Remove unique from rolling index creation (#516)
Browse files Browse the repository at this point in the history
  • Loading branch information
gssbzn committed Nov 6, 2020
1 parent 54dd8a3 commit 2cb7033
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
12 changes: 2 additions & 10 deletions internal/cli/atlas/clusters/indexes_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ type IndexesCreateOpts struct {
db string
collection string
keys []string
unique bool
sparse bool
background bool
store store.IndexCreator
}

Expand Down Expand Up @@ -73,10 +71,8 @@ func (opts *IndexesCreateOpts) newIndex() (*atlas.IndexConfiguration, error) {

func (opts *IndexesCreateOpts) newIndexOptions() *atlas.IndexOptions {
return &atlas.IndexOptions{
Background: opts.background,
Unique: opts.unique,
Sparse: opts.sparse,
Name: opts.name,
Sparse: opts.sparse,
Name: opts.name,
}
}

Expand Down Expand Up @@ -118,9 +114,7 @@ func IndexesCreateBuilder() *cobra.Command {
cmd.Flags().StringVar(&opts.db, flag.Database, "", usage.Database)
cmd.Flags().StringVar(&opts.collection, flag.Collection, "", usage.Collection)
cmd.Flags().StringSliceVar(&opts.keys, flag.Key, []string{}, usage.Key)
cmd.Flags().BoolVar(&opts.unique, flag.Unique, false, usage.Unique)
cmd.Flags().BoolVar(&opts.sparse, flag.Sparse, false, usage.Sparse)
cmd.Flags().BoolVar(&opts.background, flag.Background, false, usage.Background)

cmd.Flags().StringVar(&opts.ProjectID, flag.ProjectID, "", usage.ProjectID)

Expand All @@ -129,7 +123,5 @@ func IndexesCreateBuilder() *cobra.Command {
_ = cmd.MarkFlagRequired(flag.Collection)
_ = cmd.MarkFlagRequired(flag.Key)

_ = cmd.Flags().MarkHidden(flag.Background) // Deprecated

return cmd
}
12 changes: 2 additions & 10 deletions internal/cli/opsmanager/clusters/indexes_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ type IndexesCreateOpts struct {
numericOrdering bool
normalization bool
backwards bool
unique bool
sparse bool
background bool
keys []string
store store.AutomationPatcher
}
Expand Down Expand Up @@ -104,10 +102,8 @@ func (opts *IndexesCreateOpts) newIndex() (*opsmngr.IndexConfig, error) {

func (opts *IndexesCreateOpts) newIndexOptions() *atlas.IndexOptions {
return &atlas.IndexOptions{
Background: opts.background,
Unique: opts.unique,
Sparse: opts.sparse,
Name: opts.name,
Sparse: opts.sparse,
Name: opts.name,
}
}

Expand Down Expand Up @@ -175,9 +171,7 @@ func IndexesCreateBuilder() *cobra.Command {
cmd.Flags().BoolVar(&opts.normalization, flag.Normalization, false, usage.Normalization)
cmd.Flags().BoolVar(&opts.backwards, flag.Backwards, false, usage.Backwards)
cmd.Flags().IntVar(&opts.strength, flag.Strength, 0, usage.Strength)
cmd.Flags().BoolVar(&opts.unique, flag.Unique, false, usage.Unique)
cmd.Flags().BoolVar(&opts.sparse, flag.Sparse, false, usage.Sparse)
cmd.Flags().BoolVar(&opts.background, flag.Background, false, usage.Background)

cmd.Flags().StringVar(&opts.ProjectID, flag.ProjectID, "", usage.ProjectID)

Expand All @@ -186,7 +180,5 @@ func IndexesCreateBuilder() *cobra.Command {
_ = cmd.MarkFlagRequired(flag.CollectionName)
_ = cmd.MarkFlagRequired(flag.Key)

_ = cmd.Flags().MarkHidden(flag.Background) // Deprecated

return cmd
}

0 comments on commit 2cb7033

Please sign in to comment.