From 1af4b9ae776fbf0d78ec11e3e018eb2104f63652 Mon Sep 17 00:00:00 2001 From: Michelle Noorali Date: Mon, 1 Feb 2016 00:07:25 -0500 Subject: [PATCH 1/6] add test targets in makefiles to run local tests --- Makefile | 3 +++ expandybird/Makefile | 2 ++ manager/Makefile | 2 ++ resourcifier/Makefile | 3 +++ 4 files changed, 10 insertions(+) diff --git a/Makefile b/Makefile index ccc9d537b..5d8ee70d2 100644 --- a/Makefile +++ b/Makefile @@ -48,3 +48,6 @@ $(TARGETS) : % : $(addsuffix %,$(SUBDIRS)) $(SUBDIRS_TARGETS) : $(MAKE) -C $(@D) $(@F:.%=%) + +test: + go test -v ./... diff --git a/expandybird/Makefile b/expandybird/Makefile index 77cbec02b..4e4644625 100644 --- a/expandybird/Makefile +++ b/expandybird/Makefile @@ -47,3 +47,5 @@ clean: -docker rmi $(PREFIX)/$(IMAGE):$(TAG) rm -f expandybird +test: + go test -v ./... diff --git a/manager/Makefile b/manager/Makefile index be9da45c3..573c97f95 100644 --- a/manager/Makefile +++ b/manager/Makefile @@ -41,3 +41,5 @@ container: clean: -docker rmi $(PREFIX)/$(IMAGE):$(TAG) +test: + go test -v ./... diff --git a/resourcifier/Makefile b/resourcifier/Makefile index 2a04fecab..a9d75734f 100644 --- a/resourcifier/Makefile +++ b/resourcifier/Makefile @@ -42,3 +42,6 @@ container: clean: -docker rmi $(PREFIX)/$(IMAGE):$(TAG) + +test: + go test -v ./... From 43d838f2800f8e512dc664e525e062e9ddeebec6 Mon Sep 17 00:00:00 2001 From: Seth Goings Date: Mon, 1 Feb 2016 16:58:37 -0700 Subject: [PATCH 2/6] remove duplicate test target @ root add structure for [lint,vet,test-unit] all wrapped up by the test target --- Makefile | 2 -- expandybird/Makefile | 18 ++++++++++++++++-- include.mk | 2 ++ 3 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 include.mk diff --git a/Makefile b/Makefile index 5d8ee70d2..f1dedcaec 100644 --- a/Makefile +++ b/Makefile @@ -49,5 +49,3 @@ $(TARGETS) : % : $(addsuffix %,$(SUBDIRS)) $(SUBDIRS_TARGETS) : $(MAKE) -C $(@D) $(@F:.%=%) -test: - go test -v ./... diff --git a/expandybird/Makefile b/expandybird/Makefile index 4e4644625..398f0b20b 100644 --- a/expandybird/Makefile +++ b/expandybird/Makefile @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +include ../include.mk + .PHONY : all build test push container clean DOCKER_REGISTRY := gcr.io @@ -47,5 +49,17 @@ clean: -docker rmi $(PREFIX)/$(IMAGE):$(TAG) rm -f expandybird -test: - go test -v ./... +.PHONY: test +test: lint vet test-unit + +.PHONY: test-unit +test-unit: + $(GO_TEST) + +.PHONY: lint +lint: + $(GO_LINT) + +.PHONY: vet +vet: + $(GO_VET) diff --git a/include.mk b/include.mk new file mode 100644 index 000000000..d7ad224aa --- /dev/null +++ b/include.mk @@ -0,0 +1,2 @@ +GO_VET := echo using go vet +GO_TEST := go test -v ./... From 14d75f4d21be8838f543951b296cc6138bc7b47b Mon Sep 17 00:00:00 2001 From: Michelle Noorali Date: Wed, 3 Feb 2016 09:12:30 -0800 Subject: [PATCH 3/6] add golint and go vet to test target This commit adds a target called setup-gotools which will download and install golint and go vet. A developer who wants to run tests for an individual component (manager, resourcifier, expandybird) can run `make test` to run golint, vet, and test and in that directory. On first run, a developer will want to run `make setup-gotools` so that they have golint and vet to use locally. There is a `make test` command in each component because running tests from the root directory will result in lots of output. Running tests in individual components will help isolate the tests for the component that is being modified and result in more clear output. --- expandybird/Makefile | 4 ++++ include.mk | 6 ++++-- manager/Makefile | 22 ++++++++++++++++++++-- resourcifier/Makefile | 22 ++++++++++++++++++++-- 4 files changed, 48 insertions(+), 6 deletions(-) diff --git a/expandybird/Makefile b/expandybird/Makefile index 398f0b20b..80108a627 100644 --- a/expandybird/Makefile +++ b/expandybird/Makefile @@ -63,3 +63,7 @@ lint: .PHONY: vet vet: $(GO_VET) + +.PHONY: setup-gotools +setup-gotools: + $(SETUP_GOTOOLS) diff --git a/include.mk b/include.mk index d7ad224aa..932a1e4a7 100644 --- a/include.mk +++ b/include.mk @@ -1,2 +1,4 @@ -GO_VET := echo using go vet -GO_TEST := go test -v ./... +SETUP_GOTOOLS := @echo "Installing golint and vet" && go get -u github.com/golang/lint/golint && go get -u -v golang.org/x/tools/cmd/vet +GO_VET := @echo "Running go vet ..." && go vet ./... +GO_LINT := @echo "Running golint ..." && golint ./... +GO_TEST := @echo "Running tests ..." && go test -v ./... diff --git a/manager/Makefile b/manager/Makefile index 573c97f95..8b0f1d5a3 100644 --- a/manager/Makefile +++ b/manager/Makefile @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +include ../include.mk + .PHONY : all build test push container clean .project DOCKER_REGISTRY := gcr.io @@ -41,5 +43,21 @@ container: clean: -docker rmi $(PREFIX)/$(IMAGE):$(TAG) -test: - go test -v ./... +.PHONY: test +test: lint vet test-unit + +.PHONY: test-unit +test-unit: + $(GO_TEST) + +.PHONY: lint +lint: + $(GO_LINT) + +.PHONY: vet +vet: + $(GO_VET) + +.PHONY: setup-gotools +setup-gotools: + $(SETUP_GOTOOLS) diff --git a/resourcifier/Makefile b/resourcifier/Makefile index a9d75734f..1fb513939 100644 --- a/resourcifier/Makefile +++ b/resourcifier/Makefile @@ -14,6 +14,8 @@ # If you update this image please check the tag value before pushing. +include ../include.mk + .PHONY : all build test push container clean DOCKER_REGISTRY := gcr.io @@ -43,5 +45,21 @@ container: clean: -docker rmi $(PREFIX)/$(IMAGE):$(TAG) -test: - go test -v ./... +.PHONY: test +test: lint vet test-unit + +.PHONY: test-unit +test-unit: + $(GO_TEST) + +.PHONY: lint +lint: + $(GO_LINT) + +.PHONY: vet +vet: + $(GO_VET) + +.PHONY: setup-gotools +setup-gotools: + $(SETUP_GOTOOLS) From ef665993dd5400c17e3ee8ddffe245da92241407 Mon Sep 17 00:00:00 2001 From: Michelle Noorali Date: Wed, 3 Feb 2016 11:13:32 -0800 Subject: [PATCH 4/6] modify travis so it will install golint and govet * before running tests --- .travis.yml | 1 + Makefile | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index 9d9a12b70..8b017fb9f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,4 +9,5 @@ install: - sudo pip install -r expandybird/requirements.txt script: + - make setup-gotools - make test diff --git a/Makefile b/Makefile index f1dedcaec..a165552be 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,10 @@ clean: test: build go test -v $(GO_DEPS) +.PHONY: setup-gotools +setup-gotools: + $(SETUP_GOTOOLS) + push: container container: .project .docker From 46588cd9dd8aba487b2d281f4f92da8dacac4ea0 Mon Sep 17 00:00:00 2001 From: Michelle Noorali Date: Wed, 3 Feb 2016 14:14:49 -0800 Subject: [PATCH 5/6] makefile consolidations --- .travis.yml | 3 +-- Makefile | 7 ++----- expandybird/Makefile | 16 ---------------- include.mk | 25 +++++++++++++++++++++---- manager/Makefile | 16 ---------------- resourcifier/Makefile | 16 ---------------- 6 files changed, 24 insertions(+), 59 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8b017fb9f..69baae606 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,5 +9,4 @@ install: - sudo pip install -r expandybird/requirements.txt script: - - make setup-gotools - - make test + - make setup-gotools test diff --git a/Makefile b/Makefile index a165552be..507ad93a2 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +include include.mk + SUBDIRS := expandybird/. resourcifier/. manager/. TARGETS := all build test push container clean @@ -34,10 +36,6 @@ clean: test: build go test -v $(GO_DEPS) -.PHONY: setup-gotools -setup-gotools: - $(SETUP_GOTOOLS) - push: container container: .project .docker @@ -52,4 +50,3 @@ $(TARGETS) : % : $(addsuffix %,$(SUBDIRS)) $(SUBDIRS_TARGETS) : $(MAKE) -C $(@D) $(@F:.%=%) - diff --git a/expandybird/Makefile b/expandybird/Makefile index 80108a627..6d647bc62 100644 --- a/expandybird/Makefile +++ b/expandybird/Makefile @@ -51,19 +51,3 @@ clean: .PHONY: test test: lint vet test-unit - -.PHONY: test-unit -test-unit: - $(GO_TEST) - -.PHONY: lint -lint: - $(GO_LINT) - -.PHONY: vet -vet: - $(GO_VET) - -.PHONY: setup-gotools -setup-gotools: - $(SETUP_GOTOOLS) diff --git a/include.mk b/include.mk index 932a1e4a7..40c67d14f 100644 --- a/include.mk +++ b/include.mk @@ -1,4 +1,21 @@ -SETUP_GOTOOLS := @echo "Installing golint and vet" && go get -u github.com/golang/lint/golint && go get -u -v golang.org/x/tools/cmd/vet -GO_VET := @echo "Running go vet ..." && go vet ./... -GO_LINT := @echo "Running golint ..." && golint ./... -GO_TEST := @echo "Running tests ..." && go test -v ./... +.PHONY: test-unit +test-unit: + @echo Running tests... + go test -v ./... + +.PHONY: lint +lint: + @echo Running golint... + golint ./... + +.PHONY: vet +vet: + @echo Running go vet... + go vet ./... + +.PHONY: setup-gotools +setup-gotools: + @echo Installing golint + go get -u github.com/golang/lint/golint + @echo Installing vet + go get -u -v golang.org/x/tools/cmd/vet diff --git a/manager/Makefile b/manager/Makefile index 8b0f1d5a3..287c32daa 100644 --- a/manager/Makefile +++ b/manager/Makefile @@ -45,19 +45,3 @@ clean: .PHONY: test test: lint vet test-unit - -.PHONY: test-unit -test-unit: - $(GO_TEST) - -.PHONY: lint -lint: - $(GO_LINT) - -.PHONY: vet -vet: - $(GO_VET) - -.PHONY: setup-gotools -setup-gotools: - $(SETUP_GOTOOLS) diff --git a/resourcifier/Makefile b/resourcifier/Makefile index 1fb513939..41d130df5 100644 --- a/resourcifier/Makefile +++ b/resourcifier/Makefile @@ -47,19 +47,3 @@ clean: .PHONY: test test: lint vet test-unit - -.PHONY: test-unit -test-unit: - $(GO_TEST) - -.PHONY: lint -lint: - $(GO_LINT) - -.PHONY: vet -vet: - $(GO_VET) - -.PHONY: setup-gotools -setup-gotools: - $(SETUP_GOTOOLS) From 92d8d4b587357139785228645e3f7c40da517b21 Mon Sep 17 00:00:00 2001 From: Michelle Noorali Date: Wed, 3 Feb 2016 17:47:36 -0800 Subject: [PATCH 6/6] implement go vet suggestions --- expandybird/Makefile | 6 ------ include.mk | 9 +++++++++ manager/Makefile | 8 +------- manager/manager/manager_test.go | 6 +++--- manager/manager/typeresolver_test.go | 16 ++++++++-------- registry/filebased_credential_provider_test.go | 2 +- registry/inmem_credential_provider.go | 2 +- registry/inmem_credential_provider_test.go | 2 +- registry/registryprovider.go | 8 ++++---- resourcifier/Makefile | 8 +------- resourcifier/configurations.go | 4 ++-- 11 files changed, 31 insertions(+), 40 deletions(-) diff --git a/expandybird/Makefile b/expandybird/Makefile index 6d647bc62..8490e7bf3 100644 --- a/expandybird/Makefile +++ b/expandybird/Makefile @@ -23,12 +23,6 @@ TAG := latest DIR := . -info: - @echo "Build tag: ${TAG}" - @echo "Registry: ${DOCKER_REGISTRY}" - @echo "Project: ${PROJECT}" - @echo "Image: ${IMAGE}" - push: container ifeq ($(DOCKER_REGISTRY),gcr.io) gcloud docker push $(PREFIX)/$(IMAGE):$(TAG) diff --git a/include.mk b/include.mk index 40c67d14f..fba7d5f4e 100644 --- a/include.mk +++ b/include.mk @@ -1,3 +1,10 @@ +.PHONY: info +info: + @echo "Build tag: ${TAG}" + @echo "Registry: ${DOCKER_REGISTRY}" + @echo "Project: ${PROJECT}" + @echo "Image: ${IMAGE}" + .PHONY: test-unit test-unit: @echo Running tests... @@ -7,11 +14,13 @@ test-unit: lint: @echo Running golint... golint ./... + @echo ----------------- .PHONY: vet vet: @echo Running go vet... go vet ./... + @echo ----------------- .PHONY: setup-gotools setup-gotools: diff --git a/manager/Makefile b/manager/Makefile index 287c32daa..2e3a2ad55 100644 --- a/manager/Makefile +++ b/manager/Makefile @@ -14,7 +14,7 @@ include ../include.mk -.PHONY : all build test push container clean .project +.PHONY : all build push container clean .project DOCKER_REGISTRY := gcr.io PREFIX := $(DOCKER_REGISTRY)/$(PROJECT) @@ -24,12 +24,6 @@ TAG := latest ROOT_DIR := $(abspath ./..) DIR = $(ROOT_DIR) -info: - @echo "Build tag: ${TAG}" - @echo "Registry: ${DOCKER_REGISTRY}" - @echo "Project: ${PROJECT}" - @echo "Image: ${IMAGE}" - push: container ifeq ($(DOCKER_REGISTRY),gcr.io) gcloud docker push $(PREFIX)/$(IMAGE):$(TAG) diff --git a/manager/manager/manager_test.go b/manager/manager/manager_test.go index 2c4d0ca15..305f38114 100644 --- a/manager/manager/manager_test.go +++ b/manager/manager/manager_test.go @@ -325,7 +325,7 @@ func TestCreateDeployment(t *testing.T) { d, err := testManager.CreateDeployment(&template) if !reflect.DeepEqual(d, &deployment) || err != nil { t.Fatalf("Expected a different set of response values from invoking CreateDeployment."+ - "Received: %s, %s. Expected: %s, %s.", d, err, &deployment, "nil") + "Received: %v, %s. Expected: %#v, %s.", d, err, &deployment, "nil") } if testRepository.Created[0] != template.Name { @@ -383,7 +383,7 @@ func TestCreateDeploymentCreationFailure(t *testing.T) { if err != errTest || d != nil { t.Fatalf("Expected a different set of response values from invoking CreateDeployment."+ - "Received: %s, %s. Expected: %s, %s.", d, err, "nil", errTest) + "Received: %v, %s. Expected: %s, %s.", d, err, "nil", errTest) } if testRepository.TypeInstancesCleared { @@ -437,7 +437,7 @@ func TestDeleteDeploymentForget(t *testing.T) { d, err := testManager.CreateDeployment(&template) if !reflect.DeepEqual(d, &deployment) || err != nil { t.Fatalf("Expected a different set of response values from invoking CreateDeployment."+ - "Received: %s, %s. Expected: %s, %s.", d, err, &deployment, "nil") + "Received: %v, %s. Expected: %#v, %s.", d, err, &deployment, "nil") } if testRepository.Created[0] != template.Name { diff --git a/manager/manager/typeresolver_test.go b/manager/manager/typeresolver_test.go index 57da1035b..a3bdd6c75 100644 --- a/manager/manager/typeresolver_test.go +++ b/manager/manager/typeresolver_test.go @@ -298,20 +298,20 @@ func TestShortGithubUrl(t *testing.T) { } downloadResponses := map[string]registry.DownloadResponse{ - "https://raw.githubusercontent.com/kubernetes/application-dm-templates/master/common/replicatedservice/v1/replicatedservice.py": registry.DownloadResponse{nil, http.StatusOK, "my-content"}, - "https://raw.githubusercontent.com/kubernetes/application-dm-templates/master/common/replicatedservice/v1/replicatedservice.py.schema": registry.DownloadResponse{nil, http.StatusNotFound, ""}, - "https://raw.githubusercontent.com/kubernetes/application-dm-templates/master/common/replicatedservice/v2/replicatedservice.py": registry.DownloadResponse{nil, http.StatusOK, "my-content-2"}, - "https://raw.githubusercontent.com/kubernetes/application-dm-templates/master/common/replicatedservice/v2/replicatedservice.py.schema": registry.DownloadResponse{nil, http.StatusNotFound, ""}, + "https://raw.githubusercontent.com/kubernetes/application-dm-templates/master/common/replicatedservice/v1/replicatedservice.py": registry.DownloadResponse{Err: nil, Code: http.StatusOK, Body: "my-content"}, + "https://raw.githubusercontent.com/kubernetes/application-dm-templates/master/common/replicatedservice/v1/replicatedservice.py.schema": registry.DownloadResponse{Err: nil, Code: http.StatusNotFound, Body: ""}, + "https://raw.githubusercontent.com/kubernetes/application-dm-templates/master/common/replicatedservice/v2/replicatedservice.py": registry.DownloadResponse{Err: nil, Code: http.StatusOK, Body: "my-content-2"}, + "https://raw.githubusercontent.com/kubernetes/application-dm-templates/master/common/replicatedservice/v2/replicatedservice.py.schema": registry.DownloadResponse{Err: nil, Code: http.StatusNotFound, Body: ""}, } githubUrlMaps := map[registry.Type]registry.TestURLAndError{ - registry.NewTypeOrDie("common", "replicatedservice", "v1"): registry.TestURLAndError{"https://raw.githubusercontent.com/kubernetes/application-dm-templates/master/common/replicatedservice/v1/replicatedservice.py", nil}, - registry.NewTypeOrDie("common", "replicatedservice", "v2"): registry.TestURLAndError{"https://raw.githubusercontent.com/kubernetes/application-dm-templates/master/common/replicatedservice/v2/replicatedservice.py", nil}, + registry.NewTypeOrDie("common", "replicatedservice", "v1"): registry.TestURLAndError{URL: "https://raw.githubusercontent.com/kubernetes/application-dm-templates/master/common/replicatedservice/v1/replicatedservice.py", Err: nil}, + registry.NewTypeOrDie("common", "replicatedservice", "v2"): registry.TestURLAndError{URL: "https://raw.githubusercontent.com/kubernetes/application-dm-templates/master/common/replicatedservice/v2/replicatedservice.py", Err: nil}, } gcsUrlMaps := map[registry.Type]registry.TestURLAndError{ - registry.NewTypeOrDie("common", "replicatedservice", "v1"): registry.TestURLAndError{"https://raw.githubusercontent.com/kubernetes/application-dm-templates/master/common/replicatedservice/v1/replicatedservice.py", nil}, - registry.NewTypeOrDie("common", "replicatedservice", "v2"): registry.TestURLAndError{"https://raw.githubusercontent.com/kubernetes/application-dm-templates/master/common/replicatedservice/v2/replicatedservice.py", nil}, + registry.NewTypeOrDie("common", "replicatedservice", "v1"): registry.TestURLAndError{URL: "https://raw.githubusercontent.com/kubernetes/application-dm-templates/master/common/replicatedservice/v1/replicatedservice.py", Err: nil}, + registry.NewTypeOrDie("common", "replicatedservice", "v2"): registry.TestURLAndError{URL: "https://raw.githubusercontent.com/kubernetes/application-dm-templates/master/common/replicatedservice/v2/replicatedservice.py", Err: nil}, } grp := registry.NewTestGithubRegistryProviderWithDownloads("github.com/kubernetes/application-dm-templates", githubUrlMaps, downloadResponses) diff --git a/registry/filebased_credential_provider_test.go b/registry/filebased_credential_provider_test.go index c1f5980e8..bec6ea542 100644 --- a/registry/filebased_credential_provider_test.go +++ b/registry/filebased_credential_provider_test.go @@ -55,6 +55,6 @@ func TestSetAndGetBasicAuthFilebased(t *testing.T) { } tc := &testCase{"test2", &common.RegistryCredential{ - BasicAuth: common.BasicAuthCredential{"user", "password"}}, nil} + BasicAuth: common.BasicAuthCredential{Username: "user", Password: "password"}}, nil} testGetCredential(t, cp, tc) } diff --git a/registry/inmem_credential_provider.go b/registry/inmem_credential_provider.go index f9938aba2..e21f12600 100644 --- a/registry/inmem_credential_provider.go +++ b/registry/inmem_credential_provider.go @@ -38,6 +38,6 @@ func (fcp *InmemCredentialProvider) GetCredential(name string) (*common.Registry } func (fcp *InmemCredentialProvider) SetCredential(name string, credential *common.RegistryCredential) error { - fcp.credentials[name] = &common.RegistryCredential{credential.APIToken, credential.BasicAuth, credential.ServiceAccount} + fcp.credentials[name] = &common.RegistryCredential{APIToken: credential.APIToken, BasicAuth: credential.BasicAuth, ServiceAccount: credential.ServiceAccount} return nil } diff --git a/registry/inmem_credential_provider_test.go b/registry/inmem_credential_provider_test.go index f1279b08b..6b650eb05 100644 --- a/registry/inmem_credential_provider_test.go +++ b/registry/inmem_credential_provider_test.go @@ -68,6 +68,6 @@ func TestSetAndGetBasicAuth(t *testing.T) { cp := NewInmemCredentialProvider() tc := &testCase{"testcredential", &common.RegistryCredential{ - BasicAuth: common.BasicAuthCredential{"user", "pass"}}, nil} + BasicAuth: common.BasicAuthCredential{Username: "user", Password: "pass"}}, nil} verifySetAndGetCredential(t, cp, tc) } diff --git a/registry/registryprovider.go b/registry/registryprovider.go index c4120834f..48d77451e 100644 --- a/registry/registryprovider.go +++ b/registry/registryprovider.go @@ -74,7 +74,7 @@ func NewRegistryProvider(rs common.RegistryService, grp GithubRegistryProvider, return rp } -func (rp registryProvider) getRegistry(cr common.Registry) (Registry, error) { +func (rp *registryProvider) getRegistry(cr common.Registry) (Registry, error) { switch cr.Type { case common.GithubRegistryType: return rp.grp.GetGithubRegistry(cr) @@ -86,7 +86,7 @@ func (rp registryProvider) getRegistry(cr common.Registry) (Registry, error) { } } -func (rp registryProvider) GetRegistryByShortURL(URL string) (Registry, error) { +func (rp *registryProvider) GetRegistryByShortURL(URL string) (Registry, error) { rp.RLock() defer rp.RUnlock() @@ -111,7 +111,7 @@ func (rp registryProvider) GetRegistryByShortURL(URL string) (Registry, error) { // findRegistryByShortURL trims the scheme from both the supplied URL // and the short URL returned by GetRegistryShortURL. -func (rp registryProvider) findRegistryByShortURL(URL string) Registry { +func (rp *registryProvider) findRegistryByShortURL(URL string) Registry { trimmed := util.TrimURLScheme(URL) for _, r := range rp.registries { if strings.HasPrefix(trimmed, util.TrimURLScheme(r.GetRegistryShortURL())) { @@ -122,7 +122,7 @@ func (rp registryProvider) findRegistryByShortURL(URL string) Registry { return nil } -func (rp registryProvider) GetRegistryByName(registryName string) (Registry, error) { +func (rp *registryProvider) GetRegistryByName(registryName string) (Registry, error) { rp.RLock() defer rp.RUnlock() diff --git a/resourcifier/Makefile b/resourcifier/Makefile index 41d130df5..1b80a7dca 100644 --- a/resourcifier/Makefile +++ b/resourcifier/Makefile @@ -16,7 +16,7 @@ include ../include.mk -.PHONY : all build test push container clean +.PHONY : all build push container clean DOCKER_REGISTRY := gcr.io PREFIX := $(DOCKER_REGISTRY)/$(PROJECT) @@ -26,12 +26,6 @@ TAG := latest ROOT_DIR := $(abspath ./..) DIR = $(ROOT_DIR) -info: - @echo "Build tag: ${TAG}" - @echo "Registry: ${DOCKER_REGISTRY}" - @echo "Project: ${PROJECT}" - @echo "Image: ${IMAGE}" - push: container ifeq ($(DOCKER_REGISTRY),gcr.io) gcloud docker push $(PREFIX)/$(IMAGE):$(TAG) diff --git a/resourcifier/configurations.go b/resourcifier/configurations.go index 7465cdc10..904e5d2b2 100644 --- a/resourcifier/configurations.go +++ b/resourcifier/configurations.go @@ -77,7 +77,7 @@ func listConfigurationsHandlerFunc(w http.ResponseWriter, r *http.Request) { } c := &common.Configuration{ - []*common.Resource{ + Resources: []*common.Resource{ {Type: rtype}, }, } @@ -106,7 +106,7 @@ func getConfigurationHandlerFunc(w http.ResponseWriter, r *http.Request) { } c := &common.Configuration{ - []*common.Resource{ + Resources: []*common.Resource{ {Name: rname, Type: rtype}, }, }