Skip to content
Merged
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
8 changes: 4 additions & 4 deletions .ci/helm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ FUNCTION_NAME=$1

function ci::create_cluster() {
echo "Creating a kind cluster ..."
${FUNCTION_MESH_HOME}/hack/kind-cluster-build.sh --name sn-platform-"${CLUSTER_ID}" -c 3 -v 10
${FUNCTION_MESH_HOME}/hack/kind-cluster-build.sh --name sn-platform-"${CLUSTER_ID}" -c 3 -v 10 -k v1.22.15
echo "Successfully created a kind cluster."
}

Expand Down Expand Up @@ -88,10 +88,10 @@ function ci::install_pulsar_charts() {
git clone https://github.com/streamnative/charts.git pulsar-charts
cp ${values} pulsar-charts/charts/pulsar/mini_values.yaml
cd pulsar-charts
cd charts
./scripts/pulsar/prepare_helm_release.sh -n default -k sn-platform -c
helm repo add loki https://grafana.github.io/loki/charts
helm dependency update pulsar
${HELM} install sn-platform --set initialize=true --values ./pulsar/mini_values.yaml ./pulsar --debug
helm dependency update charts/pulsar
${HELM} install sn-platform --set initialize=true --values charts/pulsar/mini_values.yaml charts/pulsar --debug

echo "wait until pulsar init job is completed"
succeeded_num=0
Expand Down
2 changes: 1 addition & 1 deletion .ci/tests/kind.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ kubeadmConfigPatchesJSON6902:
nodes:
# the control plane node (worker) config
- role: control-plane
image: kindest/node:v1.18.20
image: kindest/node:v1.22.15
extraPortMappings:
- containerPort: 31234
hostPort: 31234
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/olm-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ jobs:

- name: InstallKubebuilder
run: |
curl -L https://github.com/kubernetes-sigs/kubebuilder/releases/download/v2.3.1/kubebuilder_2.3.1_linux_amd64.tar.gz | tar -xz -C /tmp/
sudo mv /tmp/kubebuilder_2.3.1_linux_amd64 /usr/local/kubebuilder
export PATH=$PATH:/usr/local/kubebuilder/bin
curl -L -o kubebuilder "https://github.com/kubernetes-sigs/kubebuilder/releases/download/v3.6.0/kubebuilder_linux_amd64"
chmod +x kubebuilder && mv kubebuilder /usr/local/bin/

- name: Install operator-sdk
run: |
Expand All @@ -54,7 +53,7 @@ jobs:
- name: Kubernetes KinD Cluster
uses: container-tools/kind-action@v1
with:
node_image: kindest/node:v1.21.1
node_image: kindest/node:v1.22.15

- name: Build RedHat certificated bundle And Publish to Quay
env:
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.13, 1.14, 1.15, 1.16, 1.17, 1.18]
go-version: [1.17, 1.18]
steps:
- name: clean disk
run: |
Expand All @@ -38,13 +38,12 @@ jobs:

- name: InstallKubebuilder
run: |
curl -L https://github.com/kubernetes-sigs/kubebuilder/releases/download/v2.3.1/kubebuilder_2.3.1_linux_amd64.tar.gz | tar -xz -C /tmp/
sudo mv /tmp/kubebuilder_2.3.1_linux_amd64 /usr/local/kubebuilder
export PATH=$PATH:/usr/local/kubebuilder/bin
curl -L -o kubebuilder "https://github.com/kubernetes-sigs/kubebuilder/releases/download/v3.6.0/kubebuilder_linux_amd64"
chmod +x kubebuilder && mv kubebuilder /usr/local/bin/

- name: InstallTool
run: |
wget -O - -q https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.45.2
wget -O - -q https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.50.1
./bin/golangci-lint --version

- name: validate controller-gen
Expand All @@ -65,7 +64,7 @@ jobs:
go test license_test.go

- name: Run unit test check
run: go test -v ./controllers/spec/...
run: make test

- name: Run envtest for controller
run: go test ./controllers/ -v -ginkgo.v
run: make test-ginkgo
1 change: 0 additions & 1 deletion .github/workflows/release-note.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ on:

jobs:
update_release_draft:

runs-on: ubuntu-latest

steps:
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/test-helm-charts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
python-version: 3.7

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.2.1
uses: helm/chart-testing-action@v2.3.1

- name: Run chart-testing (list-changed)
id: list-changed
Expand All @@ -73,7 +73,7 @@ jobs:
if: steps.list-changed.outputs.changed == 'true'

- name: Create kind cluster
run: hack/kind-cluster-build.sh --name chart-testing -c 3 -v 10 --k8sVersion v1.18.20
run: hack/kind-cluster-build.sh --name chart-testing -c 1 -v 10 --k8sVersion v1.22.15
if: steps.list-changed.outputs.changed == 'true'

- name: Set up GO 1.18
Expand All @@ -83,11 +83,11 @@ jobs:
go-version: 1.18
id: go

- name: setup kubebuilder 2.3.1
- name: setup kubebuilder 3.6.0
if: steps.list-changed.outputs.changed == 'true'
uses: RyanSiu1995/kubebuilder-action@v1.2.1
with:
version: 2.3.1
version: 3.6.0

- name: Install operator-sdk
if: steps.list-changed.outputs.changed == 'true'
Expand All @@ -113,3 +113,7 @@ jobs:
- name: Run chart-testing (install)
run: ct install --config .ci/ct.yaml
if: steps.list-changed.outputs.changed == 'true'

- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: failure()
2 changes: 1 addition & 1 deletion .github/workflows/test-integration-skywalking-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- uses: apache/skywalking-infra-e2e@main
- uses: apache/skywalking-infra-e2e@v1.2.0
with:
e2e-file: ${{matrix.case.e2e}}

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ COPY api/ api/
COPY controllers/ controllers/

# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -ldflags "-X google.golang.org/protobuf/reflect/protoregistry.conflictPolicy=warn" -a -o manager main.go

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
Expand Down
35 changes: 26 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ VERSION ?= 0.7.0
DOCKER_REPO := $(if $(DOCKER_REPO),$(DOCKER_REPO),streamnative)
OPERATOR_IMG ?= ${DOCKER_REPO}/function-mesh:v$(VERSION)
OPERATOR_IMG_LATEST ?= ${DOCKER_REPO}/function-mesh:latest
ENVTEST_K8S_VERSION = 1.22.1

# IMAGE_TAG_BASE defines the docker.io namespace and part of the image name for remote images.
# This variable is used to construct full image tags for bundle and catalog images.
Expand Down Expand Up @@ -36,7 +37,7 @@ BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)
# Image URL to use all building/pushing image targets
IMG ?= ${DOCKER_REPO}/function-mesh-operator:v$(VERSION)
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd:maxDescLen=0,trivialVersions=true,preserveUnknownFields=false"
CRD_OPTIONS ?= "crd:maxDescLen=0"

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand All @@ -47,15 +48,35 @@ endif

BUILD_DATETIME := $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")

## Location to install dependencies to
LOCALBIN ?= $(shell pwd)/bin
$(LOCALBIN):
mkdir -p $(LOCALBIN)

## Tool Binaries
KUSTOMIZE ?= $(LOCALBIN)/kustomize
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest
YQ ?= $(LOCALBIN)/yq
E2E ?= $(LOCALBIN)/e2e

all: manager

# Run tests
test: generate fmt vet manifests
go test ./... -coverprofile cover.out
ENVTEST_ASSETS_DIR=$(shell pwd)/testbin
test: generate fmt vet manifests envtest
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" GOLANG_PROTOBUF_REGISTRATION_CONFLICT=warn go test ./... -coverprofile cover.out

test-ginkgo: generate fmt vet manifests envtest
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" GOLANG_PROTOBUF_REGISTRATION_CONFLICT=warn go test ./controllers/ -v -ginkgo.v

.PHONY: envtest
envtest:
test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest

# Build manager binary
manager: generate fmt vet
$(GO_BUILD) -o bin/function-mesh-controller-manager main.go
$(GO_BUILD) -ldflags "-X google.golang.org/protobuf/reflect/protoregistry.conflictPolicy=warn" -o bin/function-mesh-controller-manager main.go

# Run against the configured Kubernetes cluster in ~/.kube/config
run: generate fmt vet manifests
Expand Down Expand Up @@ -108,19 +129,15 @@ image-push:

# find or download controller-gen
# download controller-gen if necessary
CONTROLLER_GEN=$(shell pwd)/bin/controller-gen
controller-gen:
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.6.2)
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.9.2)

KUSTOMIZE=$(shell pwd)/bin/kustomize
kustomize: ## Download kustomize locally if necessary.
$(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v4@v4.5.5)

YQ=$(shell pwd)/bin/yq
yq: ## Download yq locally if necessary.
$(call go-get-tool,$(YQ),github.com/mikefarah/yq/v4@latest)

E2E=$(shell pwd)/bin/e2e
skywalking-e2e: ## Download e2e locally if necessary.
$(call go-get-tool,$(E2E),github.com/apache/skywalking-infra-e2e/cmd/e2e@v1.2.0)

Expand Down
38 changes: 26 additions & 12 deletions PROJECT
Original file line number Diff line number Diff line change
@@ -1,32 +1,46 @@
domain: functionmesh.io
layout: go.kubebuilder.io/v2
layout:
- go.kubebuilder.io/v3
projectName: function-mesh
repo: github.com/streamnative/function-mesh
resources:
- group: compute
- api:
crdVersion: v1
namespaced: true
controller: true
domain: streamnative.io
domain: functionmesh.io
group: compute
kind: FunctionMesh
path: github.com/streamnative/function-mesh/api/compute/v1alpha1
version: v1alpha1
- group: compute
- api:
crdVersion: v1
namespaced: true
controller: true
domain: streamnative.io
kind: Source
domain: functionmesh.io
group: compute
kind: Function
path: github.com/streamnative/function-mesh/api/compute/v1alpha1
version: v1alpha1
- group: compute
- api:
crdVersion: v1
namespaced: true
controller: true
domain: streamnative.io
kind: Sink
domain: functionmesh.io
group: compute
kind: Source
path: github.com/streamnative/function-mesh/api/compute/v1alpha1
version: v1alpha1
- group: compute
- api:
crdVersion: v1
namespaced: true
controller: true
domain: streamnative.io
kind: Function
domain: functionmesh.io
group: compute
kind: Sink
path: github.com/streamnative/function-mesh/api/compute/v1alpha1
version: v1alpha1
version: "3"

plugins:
go.sdk.operatorframework.io/v2-alpha: {}
Loading