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

refactor: update product image tag and bump operator-go to 0.9.0 #68

Merged
merged 8 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
56 changes: 13 additions & 43 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,55 +23,25 @@ jobs:


golang-lint:
name: Golang Lint
runs-on: ubuntu-22.04
name: golang-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.22'
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Require: The version of golangci-lint to use.
# When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version.
# When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit.
version: v1.54

# Optional: working directory, useful for monorepos
# working-directory: somedir

# Optional: golangci-lint command line arguments.
#
# Note: By default, the `.golangci.yml` file should be at the root of the repository.
# The location of the configuration file can be changed by using `--config=`
# args: --timeout=30m --config=/my/path/.golangci.yml --issues-exit-code=0
args: --timeout=30m

# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true

# Optional: if set to true, then all caching functionality will be completely disabled,
# takes precedence over all other caching options.
# skip-cache: true

# Optional: if set to true, then the action won't cache or restore ~/go/pkg.
# skip-pkg-cache: true

# Optional: if set to true, then the action won't cache or restore ~/.cache/go-build.
# skip-build-cache: true

# Optional: The mode to install golangci-lint. It can be 'binary' or 'goinstall'.
# install-mode: "goinstall"
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.23'
cache: false
- name: golangci-lint
run: |
make lint


golang-test:
name: Golang Test
runs-on: ubuntu-22.04
strategy:
matrix:
go-version: ['1.22']
go-version: ['1.23']
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -94,12 +64,12 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
k8s-version: ['1.26.14', '1.27.11']
k8s-version: ['1.26.15', '1.27.16']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.22'
go-version: '1.23'
cache: false
- name: Create KinD clustet pur
env:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.22 as builder
FROM golang:1.23 as builder
ARG TARGETOS
ARG TARGETARCH

Expand Down
22 changes: 19 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,30 @@ fmt: ## Run go fmt against code.
vet: ## Run go vet against code.
go vet ./...

GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
GOLANGCI_LINT_VERSION ?= v1.60.3
golangci-lint:
@[ -f $(GOLANGCI_LINT) ] || { \
set -e ;\
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) $(GOLANGCI_LINT_VERSION) ;\
}

.PHONY: lint
lint: golangci-lint ## Run golangci-lint linter & yamllint
$(GOLANGCI_LINT) run --timeout 5m

.PHONY: lint-fix
lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
$(GOLANGCI_LINT) run --fix

.PHONY: test
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

##@ Build

.PHONY: build
build: manifests generate fmt vet ## Build manager binary.
build: manifests generate fmt vet lint ## Build manager binary.
go build -o bin/manager cmd/main.go

.PHONY: run
Expand Down Expand Up @@ -200,7 +216,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest

## Tool Versions
KUSTOMIZE_VERSION ?= v5.4.2
CONTROLLER_TOOLS_VERSION ?= v0.15.0
CONTROLLER_TOOLS_VERSION ?= v0.16.2

.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. If wrong version is installed, it will be removed before downloading.
Expand Down Expand Up @@ -367,7 +383,7 @@ kind-delete: kind ## Delete a kind cluster.

# chainsaw

CHAINSAW_VERSION ?= v0.2.6
CHAINSAW_VERSION ?= v0.2.8
CHAINSAW = $(LOCALBIN)/chainsaw

.PHONY: chainsaw
Expand Down
10 changes: 7 additions & 3 deletions api/v1alpha1/image_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ import (
)

const (
DefaultRepository = "quay.io/zncdatadev"
DefaultProductVersion = "2.4.17"
DefaultRepository = "quay.io/zncdatadev"
DefaultProductVersion = "2.4.17"
DefaultPlatformVersion = "0.0.0-dev"
DefaultProductName = "hbase"
)

type ImageSpec struct {
Expand All @@ -18,7 +20,8 @@ type ImageSpec struct {
Repository string `json:"repository,omitempty"`

// +kubebuilder:validation:Optional
StackVersion string `json:"stackVersion,omitempty"`
// +kubebuilder:default="0.0.0-dev"
PlatformVersion string `json:"platformVersion,omitempty"`

// +kubebuilder:validation:Optional
// +kubebuilder:default="2.4.17"
Expand All @@ -29,5 +32,6 @@ type ImageSpec struct {
PullPolicy *corev1.PullPolicy `json:"pullPolicy,omitempty"`

// +kubebuilder:validation:Optional
// +kubebuilder:default="hbase"
PullSecretName string `json:"pullSecretName,omitempty"`
}
Loading
Loading