Skip to content
Permalink
Browse files

Move implementation details to internal (#422)

  • Loading branch information
ferhatelmas authored and k8s-ci-robot committed Dec 4, 2019
1 parent 26e7328 commit ab1c7f71ecb71d69fadc9a4ad75ad3c53f79f5fa
Showing with 57 additions and 56 deletions.
  1. +1 βˆ’1 cmd/generate-plugin-overview/generate-plugin-overview.go
  2. +1 βˆ’0 cmd/generate-plugin-overview/go.sum
  3. +2 βˆ’2 cmd/krew/cmd/info.go
  4. +3 βˆ’3 cmd/krew/cmd/install.go
  5. +1 βˆ’1 cmd/krew/cmd/list.go
  6. +5 βˆ’5 cmd/krew/cmd/root.go
  7. +2 βˆ’2 cmd/krew/cmd/search.go
  8. +1 βˆ’1 cmd/krew/cmd/system.go
  9. +1 βˆ’1 cmd/krew/cmd/uninstall.go
  10. +1 βˆ’1 cmd/krew/cmd/update.go
  11. +2 βˆ’2 cmd/krew/cmd/upgrade.go
  12. +1 βˆ’1 cmd/krew/cmd/version.go
  13. +2 βˆ’2 cmd/validate-krew-manifest/main.go
  14. +1 βˆ’1 cmd/validate-krew-manifest/main_test.go
  15. +1 βˆ’1 integration_test/system_test.go
  16. +1 βˆ’1 integration_test/testutil_test.go
  17. 0 {pkg β†’ internal}/download/downloader.go
  18. +1 βˆ’1 {pkg β†’ internal}/download/downloader_test.go
  19. 0 {pkg β†’ internal}/download/fetch.go
  20. 0 {pkg β†’ internal}/download/testdata/bash-ascii-file
  21. 0 {pkg β†’ internal}/download/testdata/bash-utf8-file
  22. 0 {pkg β†’ internal}/download/testdata/null-file
  23. BIN {pkg β†’ internal}/download/testdata/test-with-directory.zip
  24. BIN {pkg β†’ internal}/download/testdata/test-with-nesting-with-directory-entries.tar.gz
  25. BIN {pkg β†’ internal}/download/testdata/test-with-nesting-without-directory-entries.tar.gz
  26. BIN {pkg β†’ internal}/download/testdata/test-without-directory.tar.gz
  27. BIN {pkg β†’ internal}/download/testdata/test-without-directory.zip
  28. 0 {pkg β†’ internal}/download/verifier.go
  29. 0 {pkg β†’ internal}/download/verifier_test.go
  30. 0 {pkg β†’ internal}/environment/environment.go
  31. +1 βˆ’1 {pkg β†’ internal}/environment/environment_test.go
  32. 0 {pkg β†’ internal}/gitutil/git.go
  33. +1 βˆ’1 {pkg β†’ internal}/index/indexscanner/scanner.go
  34. 0 {pkg β†’ internal}/index/indexscanner/scanner_test.go
  35. 0 {pkg β†’ internal}/index/indexscanner/testdata/testindex/dontscan.yaml
  36. 0 {pkg β†’ internal}/index/indexscanner/testdata/testindex/plugins/badplugin.yaml
  37. 0 {pkg β†’ internal}/index/indexscanner/testdata/testindex/plugins/badplugin2.yaml
  38. 0 {pkg β†’ internal}/index/indexscanner/testdata/testindex/plugins/bar.yaml
  39. 0 {pkg β†’ internal}/index/indexscanner/testdata/testindex/plugins/foo.yaml
  40. 0 {pkg β†’ internal}/index/indexscanner/testdata/testindex/plugins/notyaml.txt
  41. 0 {pkg β†’ internal}/index/indexscanner/testdata/testindex/plugins/wrongname.yaml
  42. +1 βˆ’1 {pkg β†’ internal}/index/validation/validate.go
  43. +1 βˆ’1 {pkg β†’ internal}/index/validation/validate_test.go
  44. +2 βˆ’2 {pkg β†’ internal}/info/info.go
  45. +2 βˆ’2 {pkg β†’ internal}/info/info_test.go
  46. +4 βˆ’4 {pkg β†’ internal}/installation/install.go
  47. +2 βˆ’2 {pkg β†’ internal}/installation/install_test.go
  48. +1 βˆ’1 {pkg β†’ internal}/installation/move.go
  49. +1 βˆ’1 {pkg β†’ internal}/installation/move_test.go
  50. 0 {pkg β†’ internal}/installation/platform.go
  51. +1 βˆ’1 {pkg β†’ internal}/installation/platform_test.go
  52. +1 βˆ’1 {pkg β†’ internal}/installation/receipt/receipt.go
  53. +2 βˆ’2 {pkg β†’ internal}/installation/receipt/receipt_test.go
  54. 0 {pkg β†’ internal}/installation/semver/version.go
  55. 0 {pkg β†’ internal}/installation/semver/version_test.go
  56. 0 {pkg β†’ internal}/installation/testdata/bin/kubectl-foo
  57. 0 {pkg β†’ internal}/installation/testdata/index/foo/AAAnotplugin/.gitkeep
  58. 0 {pkg β†’ internal}/installation/testdata/index/foo/deadbeef/.gitkeep
  59. 0 {pkg β†’ internal}/installation/testdata/index/foo/deadbeef/kubectl-foo
  60. 0 {pkg β†’ internal}/installation/testdata/plugin-foo/kubectl-foo
  61. 0 {pkg β†’ internal}/installation/testdata/testdir_A/.secret
  62. 0 {pkg β†’ internal}/installation/testdata/testdir_A/notsecret
  63. 0 {pkg β†’ internal}/installation/testdata/testdir_B/.gitkeep
  64. +3 βˆ’3 {pkg β†’ internal}/installation/upgrade.go
  65. +1 βˆ’1 {pkg β†’ internal}/installation/util.go
  66. 0 {pkg β†’ internal}/installation/util_test.go
  67. 0 {pkg β†’ internal}/pathutil/pathutil.go
  68. 0 {pkg β†’ internal}/pathutil/pathutil_test.go
  69. +3 βˆ’3 {pkg β†’ internal}/receiptsmigration/migration.go
  70. +3 βˆ’3 {pkg β†’ internal}/receiptsmigration/migration_test.go
  71. 0 {pkg β†’ internal}/receiptsmigration/oldenvironment/environment.go
  72. 0 {pkg β†’ internal}/receiptsmigration/oldenvironment/environment_test.go
  73. 0 {pkg β†’ internal}/testutil/plugin.go
  74. 0 {pkg β†’ internal}/testutil/tempdir.go
  75. 0 {pkg β†’ internal}/version/version.go
  76. 0 {pkg β†’ internal}/version/version_test.go
@@ -24,8 +24,8 @@ import (
"regexp"
"strings"

"sigs.k8s.io/krew/internal/index/indexscanner"
"sigs.k8s.io/krew/pkg/index"
"sigs.k8s.io/krew/pkg/index/indexscanner"
)

const (
@@ -122,6 +122,7 @@ sigs.k8s.io/krew v0.2.2-0.20190724210953-8867a94acd6d h1:ftkzey0SeGithDvmwEsUnlD
sigs.k8s.io/krew v0.2.2-0.20190724210953-8867a94acd6d/go.mod h1:wsheYhp5znrUApov8QcNjBCwXu85fIGjRJvjSkE8pI8=
sigs.k8s.io/krew v0.3.2 h1:FKBD9xy9GtO5A8FeVk/cbgG6vzPbUg4SwUziZj/TGoU=
sigs.k8s.io/krew v0.3.2/go.mod h1:G0cvdJtBb0gHBQZtCBumtllvhU6H+ggDr2oLznaLglc=
sigs.k8s.io/krew v0.3.3 h1:cHv2oReJmFmR0CnT9Fs1c9JCAOC6OBpdq4xKEJis+2E=
sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI=
sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs=
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
@@ -25,9 +25,9 @@ import (
"github.com/pkg/errors"
"github.com/spf13/cobra"

"sigs.k8s.io/krew/internal/info"
"sigs.k8s.io/krew/internal/installation"
"sigs.k8s.io/krew/pkg/index"
"sigs.k8s.io/krew/pkg/info"
"sigs.k8s.io/krew/pkg/installation"
)

// infoCmd represents the info command
@@ -24,10 +24,10 @@ import (
"k8s.io/klog"

"sigs.k8s.io/krew/cmd/krew/cmd/internal"
"sigs.k8s.io/krew/internal/index/indexscanner"
"sigs.k8s.io/krew/internal/index/validation"
"sigs.k8s.io/krew/internal/installation"
"sigs.k8s.io/krew/pkg/index"
"sigs.k8s.io/krew/pkg/index/indexscanner"
"sigs.k8s.io/krew/pkg/index/validation"
"sigs.k8s.io/krew/pkg/installation"
)

func init() {
@@ -25,7 +25,7 @@ import (
"github.com/pkg/errors"
"github.com/spf13/cobra"

"sigs.k8s.io/krew/pkg/installation"
"sigs.k8s.io/krew/internal/installation"
)

func init() {
@@ -25,12 +25,12 @@ import (
"github.com/spf13/pflag"
"k8s.io/klog"

"sigs.k8s.io/krew/internal/environment"
"sigs.k8s.io/krew/internal/gitutil"
"sigs.k8s.io/krew/internal/installation"
"sigs.k8s.io/krew/internal/installation/receipt"
"sigs.k8s.io/krew/internal/receiptsmigration"
"sigs.k8s.io/krew/pkg/constants"
"sigs.k8s.io/krew/pkg/environment"
"sigs.k8s.io/krew/pkg/gitutil"
"sigs.k8s.io/krew/pkg/installation"
"sigs.k8s.io/krew/pkg/installation/receipt"
"sigs.k8s.io/krew/pkg/receiptsmigration"
)

var (
@@ -23,9 +23,9 @@ import (
"github.com/sahilm/fuzzy"
"github.com/spf13/cobra"

"sigs.k8s.io/krew/internal/index/indexscanner"
"sigs.k8s.io/krew/internal/installation"
"sigs.k8s.io/krew/pkg/index"
"sigs.k8s.io/krew/pkg/index/indexscanner"
"sigs.k8s.io/krew/pkg/installation"
)

// searchCmd represents the search command
@@ -17,7 +17,7 @@ package cmd
import (
"github.com/spf13/cobra"

"sigs.k8s.io/krew/pkg/receiptsmigration"
"sigs.k8s.io/krew/internal/receiptsmigration"
)

// todo(corneliusweig) remove migration code with v0.4
@@ -22,7 +22,7 @@ import (
"github.com/spf13/cobra"
"k8s.io/klog"

"sigs.k8s.io/krew/pkg/installation"
"sigs.k8s.io/krew/internal/installation"
)

// uninstallCmd represents the uninstall command
@@ -22,8 +22,8 @@ import (
"github.com/spf13/cobra"
"k8s.io/klog"

"sigs.k8s.io/krew/internal/gitutil"
"sigs.k8s.io/krew/pkg/constants"
"sigs.k8s.io/krew/pkg/gitutil"
)

// updateCmd represents the update command
@@ -23,8 +23,8 @@ import (
"k8s.io/klog"

"sigs.k8s.io/krew/cmd/krew/cmd/internal"
"sigs.k8s.io/krew/pkg/index/indexscanner"
"sigs.k8s.io/krew/pkg/installation"
"sigs.k8s.io/krew/internal/index/indexscanner"
"sigs.k8s.io/krew/internal/installation"
)

func init() {
@@ -19,8 +19,8 @@ import (

"github.com/spf13/cobra"

"sigs.k8s.io/krew/internal/version"
"sigs.k8s.io/krew/pkg/constants"
"sigs.k8s.io/krew/pkg/version"
)

// versionCmd represents the version command
@@ -30,10 +30,10 @@ import (
"k8s.io/apimachinery/pkg/labels"
"k8s.io/klog"

"sigs.k8s.io/krew/internal/index/indexscanner"
"sigs.k8s.io/krew/internal/index/validation"
"sigs.k8s.io/krew/pkg/constants"
"sigs.k8s.io/krew/pkg/index"
"sigs.k8s.io/krew/pkg/index/indexscanner"
"sigs.k8s.io/krew/pkg/index/validation"
)

var flManifest string
@@ -23,8 +23,8 @@ import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/yaml"

"sigs.k8s.io/krew/internal/testutil"
"sigs.k8s.io/krew/pkg/index"
"sigs.k8s.io/krew/pkg/testutil"
)

func TestValidateManifestFile(t *testing.T) {
@@ -21,7 +21,7 @@ import (
"path/filepath"
"testing"

"sigs.k8s.io/krew/pkg/testutil"
"sigs.k8s.io/krew/internal/testutil"
)

func TestKrewSystem(t *testing.T) {
@@ -30,8 +30,8 @@ import (

"github.com/pkg/errors"

"sigs.k8s.io/krew/internal/testutil"
"sigs.k8s.io/krew/pkg/constants"
"sigs.k8s.io/krew/pkg/testutil"
)

const (
File renamed without changes.
@@ -29,7 +29,7 @@ import (

"github.com/pkg/errors"

"sigs.k8s.io/krew/pkg/testutil"
"sigs.k8s.io/krew/internal/testutil"
)

func testdataPath() string {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -22,7 +22,7 @@ import (

"k8s.io/client-go/util/homedir"

"sigs.k8s.io/krew/pkg/testutil"
"sigs.k8s.io/krew/internal/testutil"
)

func TestMustGetKrewPaths_resolvesToHomeDir(t *testing.T) {
File renamed without changes.
@@ -25,9 +25,9 @@ import (
"k8s.io/klog"
"sigs.k8s.io/yaml"

"sigs.k8s.io/krew/internal/index/validation"
"sigs.k8s.io/krew/pkg/constants"
"sigs.k8s.io/krew/pkg/index"
"sigs.k8s.io/krew/pkg/index/validation"
)

func findPluginManifestFiles(indexDir string) ([]string, error) {
File renamed without changes.
@@ -22,9 +22,9 @@ import (
"github.com/pkg/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"sigs.k8s.io/krew/internal/installation/semver"
"sigs.k8s.io/krew/pkg/constants"
"sigs.k8s.io/krew/pkg/index"
"sigs.k8s.io/krew/pkg/installation/semver"
)

const (
@@ -19,9 +19,9 @@ import (

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"sigs.k8s.io/krew/internal/testutil"
"sigs.k8s.io/krew/pkg/constants"
"sigs.k8s.io/krew/pkg/index"
"sigs.k8s.io/krew/pkg/testutil"
)

func Test_IsSafePluginName(t *testing.T) {
@@ -20,9 +20,9 @@ import (
"github.com/pkg/errors"
"k8s.io/klog"

"sigs.k8s.io/krew/pkg/environment"
"sigs.k8s.io/krew/internal/environment"
"sigs.k8s.io/krew/internal/index/indexscanner"
"sigs.k8s.io/krew/pkg/index"
"sigs.k8s.io/krew/pkg/index/indexscanner"
)

// LoadManifestFromReceiptOrIndex tries to load a plugin manifest from the
@@ -22,8 +22,8 @@ import (
"github.com/google/go-cmp/cmp"
"sigs.k8s.io/yaml"

"sigs.k8s.io/krew/pkg/environment"
"sigs.k8s.io/krew/pkg/testutil"
"sigs.k8s.io/krew/internal/environment"
"sigs.k8s.io/krew/internal/testutil"
)

func TestLoadManifestFromReceiptOrIndex(t *testing.T) {
@@ -24,12 +24,12 @@ import (
"github.com/pkg/errors"
"k8s.io/klog"

"sigs.k8s.io/krew/internal/download"
"sigs.k8s.io/krew/internal/environment"
"sigs.k8s.io/krew/internal/installation/receipt"
"sigs.k8s.io/krew/internal/pathutil"
"sigs.k8s.io/krew/pkg/constants"
"sigs.k8s.io/krew/pkg/download"
"sigs.k8s.io/krew/pkg/environment"
"sigs.k8s.io/krew/pkg/index"
"sigs.k8s.io/krew/pkg/installation/receipt"
"sigs.k8s.io/krew/pkg/pathutil"
)

// InstallOpts specifies options for plugin installation operation.
@@ -27,9 +27,9 @@ import (

"github.com/google/go-cmp/cmp"

"sigs.k8s.io/krew/pkg/environment"
"sigs.k8s.io/krew/internal/environment"
"sigs.k8s.io/krew/internal/testutil"
"sigs.k8s.io/krew/pkg/index"
"sigs.k8s.io/krew/pkg/testutil"
)

func Test_moveTargets(t *testing.T) {
@@ -24,8 +24,8 @@ import (
"github.com/pkg/errors"
"k8s.io/klog"

"sigs.k8s.io/krew/internal/pathutil"
"sigs.k8s.io/krew/pkg/index"
"sigs.k8s.io/krew/pkg/pathutil"
)

type move struct {
@@ -21,8 +21,8 @@ import (
"reflect"
"testing"

"sigs.k8s.io/krew/internal/testutil"
"sigs.k8s.io/krew/pkg/index"
"sigs.k8s.io/krew/pkg/testutil"
)

func Test_findMoveTargets(t *testing.T) {
File renamed without changes.
@@ -21,8 +21,8 @@ import (

"github.com/google/go-cmp/cmp"

"sigs.k8s.io/krew/internal/testutil"
"sigs.k8s.io/krew/pkg/index"
"sigs.k8s.io/krew/pkg/testutil"
)

func Test_osArch(t *testing.T) {
@@ -20,8 +20,8 @@ import (
"github.com/pkg/errors"
"sigs.k8s.io/yaml"

"sigs.k8s.io/krew/internal/index/indexscanner"
"sigs.k8s.io/krew/pkg/index"
"sigs.k8s.io/krew/pkg/index/indexscanner"
)

// Store saves the given plugin at the destination.
@@ -20,8 +20,8 @@ import (

"github.com/google/go-cmp/cmp"

"sigs.k8s.io/krew/pkg/index/indexscanner"
"sigs.k8s.io/krew/pkg/testutil"
"sigs.k8s.io/krew/internal/index/indexscanner"
"sigs.k8s.io/krew/internal/testutil"
)

func TestStore(t *testing.T) {
File renamed without changes.
File renamed without changes.
@@ -21,11 +21,11 @@ import (
"github.com/pkg/errors"
"k8s.io/klog"

"sigs.k8s.io/krew/internal/environment"
"sigs.k8s.io/krew/internal/installation/receipt"
"sigs.k8s.io/krew/internal/installation/semver"
"sigs.k8s.io/krew/pkg/constants"
"sigs.k8s.io/krew/pkg/environment"
"sigs.k8s.io/krew/pkg/index"
"sigs.k8s.io/krew/pkg/installation/receipt"
"sigs.k8s.io/krew/pkg/installation/semver"
)

// Upgrade will reinstall and delete the old plugin. The operation tries
@@ -20,8 +20,8 @@ import (
"github.com/pkg/errors"
"k8s.io/klog"

"sigs.k8s.io/krew/internal/installation/receipt"
"sigs.k8s.io/krew/pkg/constants"
"sigs.k8s.io/krew/pkg/installation/receipt"
)

// ListInstalledPlugins returns a list of all install plugins in a
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -27,10 +27,10 @@ import (
"github.com/pkg/errors"
"k8s.io/klog"

"sigs.k8s.io/krew/internal/environment"
"sigs.k8s.io/krew/internal/index/validation"
"sigs.k8s.io/krew/internal/receiptsmigration/oldenvironment"
"sigs.k8s.io/krew/pkg/constants"
"sigs.k8s.io/krew/pkg/environment"
"sigs.k8s.io/krew/pkg/index/validation"
"sigs.k8s.io/krew/pkg/receiptsmigration/oldenvironment"
)

const (
@@ -26,9 +26,9 @@ import (

"github.com/google/go-cmp/cmp"

"sigs.k8s.io/krew/pkg/environment"
"sigs.k8s.io/krew/pkg/receiptsmigration/oldenvironment"
"sigs.k8s.io/krew/pkg/testutil"
"sigs.k8s.io/krew/internal/environment"
"sigs.k8s.io/krew/internal/receiptsmigration/oldenvironment"
"sigs.k8s.io/krew/internal/testutil"
)

func TestIsMigrated(t *testing.T) {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit ab1c7f7

Please sign in to comment.
You can’t perform that action at this time.