Skip to content

Commit

Permalink
add make target
Browse files Browse the repository at this point in the history
  • Loading branch information
Skarlso committed Jan 25, 2024
1 parent d82acc5 commit 1e875b3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ vet: ## Run go vet against code.
test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover.out

.PHONY: lint
lint: golangci-lint ## Run golangci-lint.
$(GOLANGCI_LINT) run

##@ Build

.PHONY: build
Expand Down Expand Up @@ -139,10 +143,12 @@ $(LOCALBIN):
KUSTOMIZE ?= $(LOCALBIN)/kustomize
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest
GOLANGCI_LINT ?= $(LOCALBIN)/golangci-lint

## Tool Versions
KUSTOMIZE_VERSION ?= v5.0.0
CONTROLLER_TOOLS_VERSION ?= v0.11.3
GOLANGCI_LINT_VERSION ?= v1.55.2

KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
Expand All @@ -164,3 +170,8 @@ $(CONTROLLER_GEN): $(LOCALBIN)
envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
$(ENVTEST): $(LOCALBIN)
test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest

.PHONY: golangci-lint
golangci-lint: $(GOLANGCI_LINT)
$(GOLANGCI_LINT): $(LOCALBIN)
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s $(GOLANGCI_LINT_VERSION)
3 changes: 1 addition & 2 deletions pkg/source/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,7 @@ func (s *Source) getLatestVersion(ctx context.Context, obj *v1alpha1.Bootstrap)
return m.Tag, err
}

// fetch fetches the content
// TODO: this needs to add autodecompress and auto untar in case the content is tar.gz.
// fetch fetches the content.
func (s *Source) fetch(ctx context.Context, version, dir string, obj *v1alpha1.Bootstrap) error {
baseURL := obj.Spec.Source.GitHub.BaseURL
if baseURL == "" {
Expand Down

0 comments on commit 1e875b3

Please sign in to comment.