Skip to content
Permalink
Browse files

Validate plugins can be removed without local manifest (#300)

* Validate plugins can be removed without local manifest

This validates the scenario that we can remove/rename plugins in the index
without breaking local user installations (since this is now possible with
the install receipts).

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>

* address comments

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>

* address comments

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
  • Loading branch information...
ahmetb authored and k8s-ci-robot committed Jul 31, 2019
1 parent 38672e5 commit 8d148b5be03eb1a6611378ddd78d412cd3a9b5da
Showing with 25 additions and 1 deletion.
  1. +25 −1 integration_test/uninstall_test.go
@@ -14,7 +14,13 @@

package integrationtest

import "testing"
import (
"os"
"path/filepath"
"testing"

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

func TestKrewUninstall(t *testing.T) {
skipShort(t)
@@ -49,3 +55,21 @@ func TestKrewRemove_AliasSupported(t *testing.T) {
test.Krew("remove", validPlugin).RunOrFailOutput()
test.AssertExecutableNotInPATH("kubectl-" + validPlugin)
}

func TestKrewRemove_ManifestRemovedFromIndex(t *testing.T) {
skipShort(t)

test, cleanup := NewTest(t)
defer cleanup()

test = test.WithIndex()
localManifest := filepath.Join(test.Root(), "index", "plugins", validPlugin+constants.ManifestExtension)
if _, err := os.Stat(localManifest); err != nil {
t.Fatalf("could not read local manifest file at %s: %v", localManifest, err)
}
test.Krew("install", validPlugin).RunOrFail()
if err := os.Remove(localManifest); err != nil {
t.Fatalf("failed to remove local manifest file: %v", err)
}
test.Krew("remove", validPlugin).RunOrFail()
}

0 comments on commit 8d148b5

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