Skip to content

Commit

Permalink
Remove show more
Browse files Browse the repository at this point in the history
  • Loading branch information
nocturnalastro committed Jun 25, 2024
1 parent 67b7781 commit 7b8c3cd
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 152 deletions.
9 changes: 1 addition & 8 deletions pkg/compare/compare.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ type Options struct {
diffAll bool
ShowManagedFields bool
OutputFormat string
showMore bool

builder *resource.Builder
correlator *MetricsCorrelatorDecorator
Expand Down Expand Up @@ -173,7 +172,6 @@ func NewCmd(f kcmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Comma
cmd.Flags().BoolVarP(&options.diffAll, "all-resources", "A", options.diffAll,
"If present, In live mode will try to match all resources that are from the types mentioned in the reference. "+
"In local mode will try to match all resources passed to the command")
cmd.Flags().BoolVarP(&options.showMore, "show-more", "v", options.showMore, "Will match reference exactly")

cmd.Flags().StringVarP(&options.OutputFormat, "output", "o", "", fmt.Sprintf(`Output format. One of: (%s)`, strings.Join(OutputFormats, ", ")))
kcmdutil.CheckErr(cmd.RegisterFlagCompletionFunc(
Expand Down Expand Up @@ -453,16 +451,11 @@ func (o *Options) Run() error {
return err
}

allowMerge := temp.Config.AllowMerge
if o.showMore {
allowMerge = false
}

obj := InfoObject{
injectedObjFromTemplate: localRef,
clusterObj: clusterCR,
FieldsToOmit: o.ref.FieldsToOmit,
allowMerge: allowMerge,
allowMerge: temp.Config.AllowMerge,
}
diffOutput, err := runDiff(obj, o.IOStreams, o.ShowManagedFields)
if err != nil {
Expand Down
8 changes: 0 additions & 8 deletions pkg/compare/compare_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ type Test struct {
shouldDiffAll bool
outputFormat string
checks Checks
showMore bool
}

func (test *Test) getTestDir() string {
Expand Down Expand Up @@ -349,12 +348,6 @@ error code:2`),
mode: []Mode{DefaultMode},
checks: defaultChecks,
},
{
name: "Show More Flag",
mode: []Mode{DefaultMode},
showMore: true,
checks: defaultChecks,
},
}
tf := cmdtesting.NewTestFactory()
testFlags := flag.NewFlagSet("test", flag.ContinueOnError)
Expand Down Expand Up @@ -435,7 +428,6 @@ func getCommand(t *testing.T, test *Test, modeIndex int, tf *cmdtesting.TestFact
require.NoError(t, cmd.Flags().Set("reference", path.Join(test.getTestDir(), TestRefDirName)))
}
}
require.NoError(t, cmd.Flags().Set("show-more", fmt.Sprintf("%v", test.showMore)))
return cmd
}

Expand Down
2 changes: 0 additions & 2 deletions pkg/compare/testdata/ShowMoreFlag/localerr.golden

This file was deleted.

67 changes: 0 additions & 67 deletions pkg/compare/testdata/ShowMoreFlag/localout.golden

This file was deleted.

9 changes: 0 additions & 9 deletions pkg/compare/testdata/ShowMoreFlag/reference/metadata.yaml

This file was deleted.

8 changes: 0 additions & 8 deletions pkg/compare/testdata/ShowMoreFlag/reference/namespace.yaml

This file was deleted.

25 changes: 0 additions & 25 deletions pkg/compare/testdata/ShowMoreFlag/resources/ns-1.yaml

This file was deleted.

25 changes: 0 additions & 25 deletions pkg/compare/testdata/ShowMoreFlag/resources/ns-2.yaml

This file was deleted.

0 comments on commit 7b8c3cd

Please sign in to comment.