|
|
|
@ -130,6 +130,30 @@ func TestConfigMapList(t *testing.T) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestConfigMapQuery(t *testing.T) {
|
|
|
|
|
cfgmaps := newTestFixtureCfgMaps(t, []*rspb.Release{
|
|
|
|
|
releaseStub("key-1", 1, "default", rspb.StatusUninstalled),
|
|
|
|
|
releaseStub("key-2", 1, "default", rspb.StatusUninstalled),
|
|
|
|
|
releaseStub("key-3", 1, "default", rspb.StatusDeployed),
|
|
|
|
|
releaseStub("key-4", 1, "default", rspb.StatusDeployed),
|
|
|
|
|
releaseStub("key-5", 1, "default", rspb.StatusSuperseded),
|
|
|
|
|
releaseStub("key-6", 1, "default", rspb.StatusSuperseded),
|
|
|
|
|
}...)
|
|
|
|
|
|
|
|
|
|
rls, err := cfgmaps.Query(map[string]string{"status": "deployed"})
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Errorf("Failed to query: %s", err)
|
|
|
|
|
}
|
|
|
|
|
if len(rls) != 2 {
|
|
|
|
|
t.Errorf("Expected 2 results, got %d", len(rls))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_, err = cfgmaps.Query(map[string]string{"name": "notExist"})
|
|
|
|
|
if err != ErrReleaseNotFound {
|
|
|
|
|
t.Errorf("Expected {%v}, got {%v}", ErrReleaseNotFound, err)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestConfigMapCreate(t *testing.T) {
|
|
|
|
|
cfgmaps := newTestFixtureCfgMaps(t)
|
|
|
|
|
|
|
|
|
|