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

Enable ko and pyspelling tools #11

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.dic
21 changes: 21 additions & 0 deletions .spellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
# SPDX-license-identifier: Apache-2.0
##############################################################################
# Copyright (c) 2023
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

matrix:
- name: markdown
dictionary:
wordlists:
- .wordlist.txt
pipeline:
- pyspelling.filters.markdown:
sources:
- '**/*.md'
aspell:
ignore-case: true
78 changes: 78 additions & 0 deletions .wordlist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
adee
ae
AMF
apiextensions
auth
bec
cdb
CGO
clusterrole
clusterrolebinding
cmd
CNI
config
coverprofile
CRD
crds
customresourcedefinition
daemonset
df
dhcp
distroless
Dockerfile
dockerignore
ds
ebfaef
eca
ef
envtest
fb
fbdf
fc
fcf
fmt
gc
gcr
githubusercontent
GOARCH
GOBIN
golang
GOOS
headerFile
https
ipvlan
kube
kubebuilder
kubectl
kubernetes
kustomize
ljs
loopback
macvlan
Makefile
multus
namespace
Nephio
nonroot
portmap
pre
ptp
rbac
replicaset
rolebinding
roleName
rwxr
sbr
serviceaccount
sha
sigs
SMF
txt
UPF
upfdeployments
vlan
webhook
wjngx
WORKDIR
xr
XXXDeployment
29 changes: 23 additions & 6 deletions free5gc-operator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@ TEST_COVERAGE_HTML_FILE=coverage_unit.html
TEST_COVERAGE_FUNC_FILE=func_coverage.out

# CONTAINER_RUNNABLE checks if tests and lint check can be run inside container.
PODMAN ?= $(shell podman -v > /dev/null 2>&1; echo $$?)
ifeq ($(PODMAN), 0)
CONTAINER_RUNTIME=podman
else
CONTAINER_RUNTIME=docker
endif
CONTAINER_RUNTIME ?= $(shell which podman 2> /dev/null || which docker 2> /dev/null || echo docker)
CONTAINER_RUNNABLE ?= $(shell $(CONTAINER_RUNTIME) -v > /dev/null 2>&1; echo $$?)

# Use microk8s if installed
Expand Down Expand Up @@ -171,6 +166,13 @@ deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
$(KUSTOMIZE) build config/default | $(KUBECTL) apply -f -

.PHONY: kind-deploy
kind-deploy: manifests kind kustomize ko ## Deploy controller to the KinD cluster specified in KIND_CLUSTER_NAME.
$(KIND) create cluster || :
$(KUBECTL) apply -f "https://raw.githubusercontent.com/k8snetworkplumbingwg/multus-cni/$(MULTUS_CNI_VERSION)/deployments/multus-daemonset-thick-plugin.yml"
$(KUBECTL) rollout status daemonset/kube-multus-ds -n kube-system --timeout=3m
$(KUSTOMIZE) build config/default | KO_DOCKER_REPO=kind.local $(KO) apply -f -

.PHONY: undeploy
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
$(KUSTOMIZE) build config/default | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
Expand All @@ -188,12 +190,17 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
ENVTEST ?= $(LOCALBIN)/setup-envtest
KPT ?= $(LOCALBIN)/kpt
KPTGEN ?= $(LOCALBIN)/kptgen
KO ?= $(LOCALBIN)/ko
KIND ?= $(LOCALBIN)/kind

## Tool Versions
KUSTOMIZE_VERSION ?= v3.8.7
CONTROLLER_TOOLS_VERSION ?= v0.9.2
KPT_VERSION ?= main
KPTGEN_VERSION ?= v0.0.9
KO_VERSION ?= v0.13.0
KIND_VERSION ?= v0.18.0
MULTUS_CNI_VERSION ?= v3.9.3

KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
Expand All @@ -220,3 +227,13 @@ $(KPT): $(LOCALBIN)
kptgen: $(KPTGEN)
$(KPTGEN): $(LOCALBIN)
test -s $(LOCALBIN)/kptgen || GOBIN=$(LOCALBIN) go install -v github.com/henderiw-kpt/kptgen@$(KPTGEN_VERSION)

.PHONY: ko
ko: $(KO) ## Download ko locally if necessary.
$(KO): $(LOCALBIN)
test -s $(LOCALBIN)/ko || GOBIN=$(LOCALBIN) go install -v github.com/google/ko@$(KO_VERSION)

.PHONY: kind
kind: $(KIND) ## Download kind locally if necessary.
$(KIND): $(LOCALBIN)
test -s $(LOCALBIN)/kind || GOBIN=$(LOCALBIN) go install -v sigs.k8s.io/kind@$(KIND_VERSION)
4 changes: 2 additions & 2 deletions free5gc-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ make run
```

### Deploy the controller
Change image varible in Makefile:
Change image variable in Makefile:

```sh
REGISTRY ?= registry
Expand Down Expand Up @@ -126,7 +126,7 @@ ff5700ec5418: Layer already exists
latest: digest: sha256:3e86a217e906ebfaef66dc7363698e59576c928768105d303d25c59706a01b4d size: 2402
```

and finnaly deploy container to a kubernetes cluster
and finally deploy container to a kubernetes cluster

```sh
$ make deploy
Expand Down
6 changes: 2 additions & 4 deletions free5gc-operator/config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,9 @@ spec:
# seccompProfile:
# type: RuntimeDefault
containers:
- command:
- /manager
args:
- args:
- --leader-elect
image: controller:latest
image: ko://main.go
name: manager
securityContext:
allowPrivilegeEscalation: false
Expand Down
14 changes: 14 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[tox]
minversion = 1.6
skipsdist = True
envlist = lint

[testenv]
passenv = http_proxy,HTTP_PROXY,https_proxy,HTTPS_PROXY,no_proxy,NO_PROXY
usedevelop = False
install_command = pip install {opts} {packages}

[testenv:spell]
deps =
pyspelling
commands = pyspelling -c .spellcheck.yml