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

run kind targets on the new repo #10

Merged
merged 4 commits into from
May 31, 2024
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
58 changes: 58 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,61 @@ jobs:
fail_ci_if_error: true
verbose: true

kubernetes-integration-tests:
runs-on: ubuntu-latest
strategy:
matrix:
go: ['1.21']
env:
BPFMAN_AGENT_IMG: quay.io/bpfman/bpfman-agent:int-test
BPFMAN_OPERATOR_IMG: quay.io/bpfman/bpfman-operator:int-test
XDP_PASS_PRIVATE_IMAGE_CREDS: ${{ secrets.XDP_PASS_PRIVATE_IMAGE_CREDS }}
steps:
- name: Check disk space
run: df -h

- name: Free up space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo rm -rf /usr/local/lib/android

- name: Check disk space again
run: df -h

- name: set up go 1.x
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}

- name: cache go modules
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-build-codegen-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-build-codegen-
- name: checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: build images
run: make build-images

- name: run integration tests
run: make test-integration

- name: Check disk space
run: df -h

## Upload diagnostics if integration test step failed.
- name: upload diagnostics
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: kubernetes-integration-test-diag
path: /tmp/ktf-diag*
if-no-files-found: ignore
2 changes: 1 addition & 1 deletion Containerfile.bpfman-agent
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.21 as bpfman-agent-build
FROM golang:1.22 as bpfman-agent-build
ARG TARGETOS
ARG TARGETARCH

Expand Down
2 changes: 1 addition & 1 deletion Containerfile.bpfman-operator
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.21 as bpfman-operator-build
FROM golang:1.22 as bpfman-operator-build
ARG TARGETOS
ARG TARGETARCH

Expand Down
39 changes: 22 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ KIND_CLUSTER_NAME ?= bpfman-deployment

# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.25.0
K8S_CODEGEN_VERSION = v0.25.0
K8S_CODEGEN_VERSION = v0.30.1

.DEFAULT_GOAL := help

Expand Down Expand Up @@ -197,8 +197,9 @@ generate: manifests generate-register generate-deepcopy generate-typed-clients g
.PHONY: generate-register
generate-register: register-gen ## Generate register code see all `zz_generated.register.go` files.
$(REGISTER_GEN) \
--input-dirs "${PKG}/apis/v1alpha1" \
--output-package "${PKG}/apis/" \
"${PKG}/apis/v1alpha1" \
--output-file zz_generated.register.go \
--go-header-file ./hack/boilerplate.go.txt \
${COMMON_FLAGS}

.PHONY: generate-deepcopy
Expand All @@ -208,28 +209,29 @@ generate-deepcopy: ## Generate code containing DeepCopy, DeepCopyInto, and DeepC
.PHONY: generate-typed-clients
generate-typed-clients: client-gen ## Generate typed client code
$(CLIENT_GEN) \
--clientset-name "versioned" \
--clientset-name "clientset" \
--input-base "" \
--input "${PKG}/apis/v1alpha1" \
--output-package "${PKG}/pkg/client/clientset" \
--output-pkg "${PKG}/pkg/client" \
--output-dir "./pkg/client" \
${COMMON_FLAGS}


.PHONY: generate-typed-listers
generate-typed-listers: lister-gen ## Generate typed listers code
$(LISTER_GEN) \
--input-dirs "${PKG}/apis/v1alpha1" \
--output-package "${PKG}/pkg/client/listers" \
$(LISTER_GEN) "${PKG}/apis/v1alpha1" \
--output-pkg "${PKG}/pkg/client" \
--output-dir "./pkg/client" \
${COMMON_FLAGS}


.PHONY: generate-typed-informers
generate-typed-informers: informer-gen ## Generate typed informers code
$(INFORMER_GEN) \
--input-dirs "${PKG}/apis/v1alpha1" \
--versioned-clientset-package "${PKG}/pkg/client/clientset/versioned" \
--listers-package "${PKG}/pkg/client/listers" \
--output-package "${PKG}/pkg/client/informers" \
$(INFORMER_GEN) "${PKG}/apis/v1alpha1" \
--versioned-clientset-package "${PKG}/pkg/client/clientset" \
--listers-package "${PKG}/pkg/client" \
--output-pkg "${PKG}/pkg/client" \
--output-dir "./pkg/client" \
${COMMON_FLAGS}

.PHONY: vendors
Expand Down Expand Up @@ -302,14 +304,13 @@ build-images: ## Build bpfman, bpfman-agent, and bpfman-operator images.
docker build -t ${BPFMAN_AGENT_IMG} -f Containerfile.bpfman-agent ./

.PHONY: push-images
push-images: ## Push bpfman, bpfman-agent, bpfman-operator images.
push-images: ## Push bpfman-agent, bpfman-operator images.
docker push ${BPFMAN_OPERATOR_IMG}
docker push ${BPFMAN_AGENT_IMG}
docker push ${BPFMAN_IMG}

.PHONY: load-images-kind
load-images-kind: ## Load bpfman, bpfman-agent, and bpfman-operator images into the running local kind devel cluster.
kind load docker-image ${BPFMAN_IMG} ${BPFMAN_OPERATOR_IMG} ${BPFMAN_AGENT_IMG} --name ${KIND_CLUSTER_NAME}
load-images-kind: ## Load bpfman-agent, and bpfman-operator images into the running local kind devel cluster.
kind load docker-image ${BPFMAN_OPERATOR_IMG} ${BPFMAN_AGENT_IMG} --name ${KIND_CLUSTER_NAME}

.PHONY: bundle-build
bundle-build: ## Build the bundle image.
Expand Down Expand Up @@ -361,6 +362,10 @@ uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified
setup-kind: ## Setup Kind cluster
kind delete cluster --name ${KIND_CLUSTER_NAME} && kind create cluster --config hack/kind-config.yaml --name ${KIND_CLUSTER_NAME}

.PHONY: destroy-kind
destroy-kind: ## Destroy Kind cluster
kind delete cluster --name ${KIND_CLUSTER_NAME}

## Default deploy target is KIND based with its CSI driver initialized.
.PHONY: deploy
deploy: manifests kustomize ## Deploy bpfman-operator to the K8s cluster specified in ~/.kube/config with the csi driver initialized.
Expand Down
2 changes: 1 addition & 1 deletion apis/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion apis/v1alpha1/zz_generated.register.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cmd/bpfman-agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

func init() {
utilruntime.Must(clientgoscheme.AddToScheme(scheme))
utilruntime.Must(bpfmaniov1alpha1.AddToScheme(scheme))
utilruntime.Must(bpfmaniov1alpha1.Install(scheme))

Check warning on line 55 in cmd/bpfman-agent/main.go

View check run for this annotation

Codecov / codecov/patch

cmd/bpfman-agent/main.go#L55

Added line #L55 was not covered by tests
utilruntime.Must(v1.AddToScheme(scheme))
//+kubebuilder:scaffold:scheme
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/bpfman-operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

func init() {
utilruntime.Must(clientgoscheme.AddToScheme(scheme))
utilruntime.Must(bpfmaniov1alpha1.AddToScheme(scheme))
utilruntime.Must(bpfmaniov1alpha1.Install(scheme))

Check warning on line 48 in cmd/bpfman-operator/main.go

View check run for this annotation

Codecov / codecov/patch

cmd/bpfman-operator/main.go#L48

Added line #L48 was not covered by tests
//+kubebuilder:scaffold:scheme
}

Expand Down
4 changes: 4 additions & 0 deletions config/crd/bases/bpfman.io_fentryprograms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,13 @@ spec:
items:
type: string
type: array
x-kubernetes-list-type: atomic
required:
- key
- operator
type: object
type: array
x-kubernetes-list-type: atomic
matchLabels:
additionalProperties:
type: string
Expand Down Expand Up @@ -196,11 +198,13 @@ spec:
items:
type: string
type: array
x-kubernetes-list-type: atomic
required:
- key
- operator
type: object
type: array
x-kubernetes-list-type: atomic
matchLabels:
additionalProperties:
type: string
Expand Down
4 changes: 4 additions & 0 deletions config/crd/bases/bpfman.io_fexitprograms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,13 @@ spec:
items:
type: string
type: array
x-kubernetes-list-type: atomic
required:
- key
- operator
type: object
type: array
x-kubernetes-list-type: atomic
matchLabels:
additionalProperties:
type: string
Expand Down Expand Up @@ -196,11 +198,13 @@ spec:
items:
type: string
type: array
x-kubernetes-list-type: atomic
required:
- key
- operator
type: object
type: array
x-kubernetes-list-type: atomic
matchLabels:
additionalProperties:
type: string
Expand Down
4 changes: 4 additions & 0 deletions config/crd/bases/bpfman.io_kprobeprograms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,13 @@ spec:
items:
type: string
type: array
x-kubernetes-list-type: atomic
required:
- key
- operator
type: object
type: array
x-kubernetes-list-type: atomic
matchLabels:
additionalProperties:
type: string
Expand Down Expand Up @@ -204,11 +206,13 @@ spec:
items:
type: string
type: array
x-kubernetes-list-type: atomic
required:
- key
- operator
type: object
type: array
x-kubernetes-list-type: atomic
matchLabels:
additionalProperties:
type: string
Expand Down
4 changes: 4 additions & 0 deletions config/crd/bases/bpfman.io_tcprograms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,13 @@ spec:
items:
type: string
type: array
x-kubernetes-list-type: atomic
required:
- key
- operator
type: object
type: array
x-kubernetes-list-type: atomic
matchLabels:
additionalProperties:
type: string
Expand Down Expand Up @@ -230,11 +232,13 @@ spec:
items:
type: string
type: array
x-kubernetes-list-type: atomic
required:
- key
- operator
type: object
type: array
x-kubernetes-list-type: atomic
matchLabels:
additionalProperties:
type: string
Expand Down
4 changes: 4 additions & 0 deletions config/crd/bases/bpfman.io_tracepointprograms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,13 @@ spec:
items:
type: string
type: array
x-kubernetes-list-type: atomic
required:
- key
- operator
type: object
type: array
x-kubernetes-list-type: atomic
matchLabels:
additionalProperties:
type: string
Expand Down Expand Up @@ -200,11 +202,13 @@ spec:
items:
type: string
type: array
x-kubernetes-list-type: atomic
required:
- key
- operator
type: object
type: array
x-kubernetes-list-type: atomic
matchLabels:
additionalProperties:
type: string
Expand Down
6 changes: 6 additions & 0 deletions config/crd/bases/bpfman.io_uprobeprograms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,13 @@ spec:
items:
type: string
type: array
x-kubernetes-list-type: atomic
required:
- key
- operator
type: object
type: array
x-kubernetes-list-type: atomic
matchLabels:
additionalProperties:
type: string
Expand Down Expand Up @@ -234,11 +236,13 @@ spec:
items:
type: string
type: array
x-kubernetes-list-type: atomic
required:
- key
- operator
type: object
type: array
x-kubernetes-list-type: atomic
matchLabels:
additionalProperties:
type: string
Expand Down Expand Up @@ -281,11 +285,13 @@ spec:
items:
type: string
type: array
x-kubernetes-list-type: atomic
required:
- key
- operator
type: object
type: array
x-kubernetes-list-type: atomic
matchLabels:
additionalProperties:
type: string
Expand Down
Loading
Loading