Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Diamond import of base folders #1316

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 54 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,37 +1,75 @@
BIN_NAME=kustomize
KUSTOMIZE_NAME := kustomize
PLUGINATOR_NAME := pluginator

BINDIR := bin
TOOLS_DIR := internal/tools
TOOLS_BIN_DIR := $(TOOLS_DIR)/bin

# Binaries.
GOLANGCI_LINT := $(TOOLS_BIN_DIR)/golangci-lint
MDRIP := $(TOOLS_BIN_DIR)/mdrip
PLUGINATOR := $(TOOLS_BIN_DIR)/pluginator

COVER_FILE=coverage.out

export GO111MODULE=on

## --------------------------------------
## Tooling Binaries
## --------------------------------------

$(GOLANGCI_LINT): $(TOOLS_DIR)/go.mod # Build golangci-lint from tools folder.
cd $(TOOLS_DIR); go build -o ./bin/golangci-lint github.com/golangci/golangci-lint/cmd/golangci-lint

$(MDRIP): $(TOOLS_DIR)/go.mod # Build mdrip from tools folder.
cd $(TOOLS_DIR); go build -o ./bin/mdrip github.com/monopole/mdrip

$(PLUGINATOR): $(TOOLS_DIR)/go.mod # Build pluginator from tools folder.
cd $(TOOLS_DIR); go build -o ./bin/pluginator sigs.k8s.io/kustomize/pluginator

## --------------------------------------
## Testing
## --------------------------------------

all: test build

.PHONY: test
test: generate-code test-lint test-go

.PHONY: test-go
test-go:
go test -v ./...

test-lint:
golangci-lint run ./...

generate-code:
./plugin/generateBuiltins.sh $(GOPATH)

build:
go build -o $(BIN_NAME) cmd/kustomize/main.go

install:
go install $(PWD)/cmd/kustomize
.PHONY: test-lint
test-lint: $(GOLANGCI_LINT)
$(GOLANGCI_LINT) run ./...

.PHONY: cover
cover:
# The plugin directory eludes coverage, and is therefore omitted
go test ./pkg/... ./k8sdeps/... ./internal/... -coverprofile=$(COVER_FILE) && \
go tool cover -html=$(COVER_FILE)


.PHONY: generate-code
generate-code: $(PLUGINATOR)
./plugin/generateBuiltins.sh $(GOPATH)

## --------------------------------------
## Binaries
## --------------------------------------

.PHONY: build
build:
cd pluginator && go build -o $(PLUGINATOR_NAME) .
cd kustomize && go build -o $(KUSTOMIZE_NAME) ./main.go

.PHONY: install
install:
cd pluginator && go install $(PWD)/pluginator
cd kustomize && go install $(PWD)/kustomize

.PHONY: clean
clean:
go clean
rm -f $(BIN_NAME)
cd kustomize && go clean && rm -f $(KUSTOMIZE_NAME)
rm -f $(COVER_FILE)

.PHONY: test build install clean generate-code test-go test-lint cover
22 changes: 10 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,18 @@ go 1.13

require (
github.com/evanphx/json-patch v4.5.0+incompatible
github.com/go-openapi/spec v0.19.2
github.com/golangci/golangci-lint v1.19.1
github.com/gorilla/mux v1.7.3 // indirect
github.com/gorilla/sessions v1.2.0 // indirect
github.com/monopole/mdrip v1.0.0
github.com/go-openapi/spec v0.19.3
github.com/golang/protobuf v1.3.2 // indirect
github.com/pkg/errors v0.8.1
github.com/spf13/pflag v1.0.5
golang.org/x/net v0.0.0-20191011234655-491137f69257 // indirect
golang.org/x/tools v0.0.0-20191014141550-5fa5b1782b2c // indirect
gopkg.in/yaml.v2 v2.2.2
k8s.io/api v0.0.0-20190313235455-40a48860b5ab
k8s.io/apimachinery v0.0.0-20190313205120-d7deff9243b1
github.com/stretchr/testify v1.4.0 // indirect
golang.org/x/net v0.0.0-20190923162816-aa69164e4478 // indirect
golang.org/x/sys v0.0.0-20190922100055-0a153f010e69 // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/yaml.v2 v2.2.4
k8s.io/api v0.0.0-20191005115622-2e41325d9e4b
k8s.io/apimachinery v0.0.0-20191006235458-f9f2f3f8ab02
k8s.io/client-go v11.0.0+incompatible
k8s.io/kube-openapi v0.0.0-20190603182131-db7b694dc208
sigs.k8s.io/kustomize/pluginator v1.0.0
k8s.io/kube-openapi v0.0.0-20190918143330-0270cf2f1c1d
sigs.k8s.io/yaml v1.1.0
)
387 changes: 49 additions & 338 deletions go.sum

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions internal/tools/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module sigs.k8s.io/kustomize/internal/tools

go 1.13

require (
github.com/golangci/golangci-lint v1.19.1
github.com/monopole/mdrip v1.0.0
sigs.k8s.io/kustomize/pluginator v1.1.0 // indirect
)
425 changes: 425 additions & 0 deletions internal/tools/go.sum

Large diffs are not rendered by default.

297 changes: 48 additions & 249 deletions kustomize/go.sum

Large diffs are not rendered by default.

Loading