Skip to content

Commit

Permalink
init e2e setup kind cluster
Browse files Browse the repository at this point in the history
Signed-off-by: ii2day <[email protected]>
  • Loading branch information
ii2day committed Feb 19, 2024
1 parent 3c63de6 commit b7d22fb
Show file tree
Hide file tree
Showing 27 changed files with 601 additions and 169 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/auto-pr-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ jobs:
with:
ref: ${{ needs.prepare.outputs.ref }}
ipfamily: dual
install_cilium: true
e2e_labels: ${{ needs.prepare.outputs.e2e_labels }}
kind_node_image: ${{ needs.prepare.outputs.kindNodeImage }}
secrets: inherit
Expand All @@ -240,6 +241,7 @@ jobs:
with:
ref: ${{ needs.prepare.outputs.ref }}
ipfamily: ipv4
install_cilium: true
e2e_labels: ${{ needs.prepare.outputs.e2e_labels }}
kind_node_image: ${{ needs.prepare.outputs.kindNodeImage }}
secrets: inherit
Expand All @@ -251,6 +253,7 @@ jobs:
with:
ref: ${{ needs.prepare.outputs.ref }}
ipfamily: ipv6
install_cilium: true
e2e_labels: ${{ needs.prepare.outputs.e2e_labels }}
kind_node_image: ${{ needs.prepare.outputs.kindNodeImage }}
secrets: inherit
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/call-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ on:
kind_node_image:
required: false
type: string
install_cilium:
required: false
type: string

jobs:
e2e_against_commit:
Expand Down Expand Up @@ -115,9 +118,9 @@ jobs:
max_attempts: 3
shell: bash
command: |
make e2e_init -e E2E_KIND_CLUSTER_NAME=${{ env.RUN_KIND_CLUSTER_NAME }} \
-e PROJECT_IMAGE_VERSION=${{ inputs.ref }} \
make e2e_init -e PROJECT_IMAGE_VERSION=${{ inputs.ref }} \
-e E2E_IP_FAMILY=${{ inputs.ipfamily }} \
-e INSTALL_CILIUM=${{ inputs.install_cilium }} \
-e PYROSCOPE_LOCAL_PORT='' \
-e E2E_KIND_NODE_IMAGE=${{ inputs.kind_node_image }}
Expand Down
2 changes: 1 addition & 1 deletion .github/yamllint-conf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ yaml-files:
ignore: |
vendor/
.github/
test/yaml/
test/yamls/
charts/
rules:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ unitestreport.json
e2ereport.json

.DS_Store

.idea/
.vscode/
*.plist

Expand Down
8 changes: 8 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# config for golangci-lint
run:
# Timeout for analysis, e.g. 30s, 5m.
# Default: 1m
timeout: 5m

# skip-dirs:
# - vendor
9 changes: 3 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -353,19 +353,16 @@ unitest_tests:

.PHONY: e2e
e2e:
make -C test check_images_ready
make -C test e2e

.PHONY: e2e_init
e2e_init:
make -C test check_images_ready
make -C test init_kind_env
make -C test deploy_project
make -C test install_example_app
make -C test kind-init


.PHONY: e2e_run
e2e_run:
make -C test e2e_test
echo "skip run e2e"

.PHONY: e2e_clean
e2e_clean:
Expand Down
12 changes: 7 additions & 5 deletions Makefile.defs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ GO_VERSION := 1.21.7
REGISTER ?= ghcr.io
GIT_REPO ?= koffloader-io/koffloader



#======================

SHELL := /bin/bash
Expand All @@ -18,10 +16,14 @@ INSTALL = install

PREFIX?=/usr
BINDIR?=$(PREFIX)/bin
TARGETARCH ?= amd64

DESTDIR_BIN ?= $(ROOT_DIR)/output/$(TARGETARCH)/bin
DESTDIR_BASH_COMPLETION ?= $(ROOT_DIR)/output/$(TARGETARCH)/bash-completion
ARCH = $(shell uname -m)
ifeq ($(ARCH),x86_64)
ARCH=amd64
endif

DESTDIR_BIN ?= $(ROOT_DIR)/output/$(ARCH)/bin
DESTDIR_BASH_COMPLETION ?= $(ROOT_DIR)/output/$(ARCH)/bash-completion

CHART_DIR := $(ROOT_DIR)/charts
DESTDIR_CHART ?= $(ROOT_DIR)/output/chart
Expand Down
1 change: 1 addition & 0 deletions pkg/lock/lock_debug_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package lock_test

import (
. "github.com/onsi/ginkgo/v2"

"github.com/koffloader-io/koffloader/pkg/lock"
)

Expand Down
4 changes: 3 additions & 1 deletion pkg/lock/lock_fast_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
package lock_test

import (
"time"

. "github.com/onsi/ginkgo/v2"

"github.com/koffloader-io/koffloader/pkg/lock"
"time"
)

var _ = Describe("LockFast", Label("unitest"), func() {
Expand Down
12 changes: 7 additions & 5 deletions pkg/utils/cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ import (
"crypto/x509/pkix"
"encoding/pem"
"fmt"
"github.com/koffloader-io/koffloader/pkg/types"
"github.com/pkg/errors"
"k8s.io/client-go/util/cert"
"k8s.io/client-go/util/keyutil"
netutils "k8s.io/utils/net"
"math/big"
"net"
"os"
"time"

"github.com/pkg/errors"
"k8s.io/client-go/util/cert"
"k8s.io/client-go/util/keyutil"
netutils "k8s.io/utils/net"

"github.com/koffloader-io/koffloader/pkg/types"
)

const (
Expand Down
3 changes: 2 additions & 1 deletion pkg/utils/net.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ package utils

import (
"fmt"
"github.com/pkg/errors"
"net"
"strings"

"github.com/pkg/errors"
)

func ListHostAllInterfaces() ([]string, error) {
Expand Down
4 changes: 3 additions & 1 deletion pkg/utils/net_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ package utils_test

import (
"fmt"
"net"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"github.com/koffloader-io/koffloader/pkg/utils"
"net"
)

var _ = Describe("net", func() {
Expand Down
Loading

0 comments on commit b7d22fb

Please sign in to comment.