diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index d216d469..43dbe9ee 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -27,7 +27,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: - go-version: '>=1.21.3' + go-version: '>=1.25.0' - name: build run: make build testing: @@ -49,7 +49,7 @@ jobs: key: ${{ runner.os }}-binaries-${{ hashFiles('**/go.sum') }} - uses: actions/setup-go@v4 with: - go-version: '>=1.21.3' + go-version: '>=1.25.0' - name: run tests run: make test diff --git a/Makefile b/Makefile index 60821102..aeef082e 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ IMG ?= controller:latest BUILDER_IMAGE ?= "" # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. -ENVTEST_K8S_VERSION = 1.26.0 +ENVTEST_K8S_VERSION = 1.29.0 # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) ifeq (,$(shell go env GOBIN)) @@ -77,7 +77,7 @@ lint: golangci-lint ## Run linters .PHONY: test test: ginkgo manifests generate lint envtest generate-mocks ## Run all tests. go test ./pkg/... - KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" $(GINKGO) -r --output-interceptor-mode=none + KUBEBUILDER_ASSETS="$$($(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" $(GINKGO) -r --output-interceptor-mode=none .PHONY: test-unit test-unit: ginkgo manifests generate lint generate-mocks ## Run unit tests. @@ -86,7 +86,7 @@ test-unit: ginkgo manifests generate lint generate-mocks ## Run unit tests. .PHONY: test-integration ## Run integration tests. test-integration: ginkgo manifests generate lint envtest generate-mocks ## Run integration tests. - KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" $(GINKGO) -r --label-filter "integration" --output-interceptor-mode=none + KUBEBUILDER_ASSETS="$$($(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" $(GINKGO) -r --label-filter "integration" --output-interceptor-mode=none .PHONY: kind-create kind-create: kind ## Create kind cluster @@ -214,11 +214,10 @@ gopls: # $(shell go version) GOBIN=$(LOCALBIN) go install golang.org/x/tools/gopls@latest - .PHONY: envtest envtest: $(ENVTEST) ## Download setup-envtest locally if necessary. $(ENVTEST): $(LOCALBIN) - test -s $(ENVTEST) || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest + test -s $(ENVTEST) || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest .PHONY: golangci-lint golangci-lint: ## Download golangci-lint locally if necessary. diff --git a/pkg/ocp/sources.go b/pkg/ocp/sources.go index 15296c4e..351cfcdc 100644 --- a/pkg/ocp/sources.go +++ b/pkg/ocp/sources.go @@ -78,9 +78,9 @@ type SourceConfig struct { // GitConfig represents the git source control configuration for a source. type GitConfig struct { Repo string `json:"repo"` - Reference string `json:"reference"` + Reference string `json:"reference,omitempty"` Commit string `json:"commit,omitempty"` - Path string `json:"path"` + Path string `json:"path,omitempty"` IncludedFiles []string `json:"included_files,omitempty"` ExcludedFiles []string `json:"excluded_files,omitempty"` CredentialID string `json:"credentials,omitempty"` @@ -89,7 +89,7 @@ type GitConfig struct { // Datasource represents a datasource for a source. type Datasource struct { Name string `json:"name" yaml:"name"` - Path string `json:"path" yaml:"path"` + Path string `json:"path,omitempty" yaml:"path,omitempty"` Type string `json:"type" yaml:"type"` TransformQuery string `json:"transform_query,omitempty" yaml:"transform_query,omitempty"` Config map[string]interface{} `json:"config,omitempty" yaml:"config,omitempty"`