Skip to content
This repository was archived by the owner on Feb 24, 2025. It is now read-only.

Commit

Permalink
Merge pull request #10 from gianlucam76/prep
Browse files Browse the repository at this point in the history
Prepare for release v0.33.0
  • Loading branch information
gianlucam76 authored Jul 4, 2024
2 parents ad34043 + 74cfc1c commit bb6a296
Show file tree
Hide file tree
Showing 9 changed files with 187 additions and 30 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:
run: make vet
- name: LINT
run: make lint
- name: TEST
run: make test
env:
LINT: true
FV:
Expand Down
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ hack/tools/bin/
test/fv/workload_kubeconfig
bin/manager

manager_image_patch.yaml-e
manager_pull_policy.yaml-e
manager_auth_proxy_patch.yaml-e
k8s/manifest.yaml-e

version.txt

Expand Down
20 changes: 18 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARCH ?= $(shell go env GOARCH)
OS ?= $(shell uname -s | tr A-Z a-z)
K8S_LATEST_VER ?= $(shell curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)
export CONTROLLER_IMG ?= $(REGISTRY)/$(IMAGE_NAME)
TAG ?= dev
TAG ?= v0.33.0

# Directories.
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
Expand Down Expand Up @@ -46,6 +46,13 @@ $(KUBECTL):
curl -L https://storage.googleapis.com/kubernetes-release/release/$(K8S_LATEST_VER)/bin/$(OS)/$(ARCH)/kubectl -o $@
chmod +x $@

set-manifest-image:
sed -i'' -e 's@image: .*@image: '"${MANIFEST_IMG}:$(MANIFEST_TAG)"'@' ./k8s/manifest.yaml >> ./k8s/manifest.yaml-e
cp ./k8s/manifest.yaml ./manifest/manifest.yaml

.PHONY: manifests
manifests: fmt # Generate manifest
MANIFEST_IMG=$(CONTROLLER_IMG) MANIFEST_TAG=$(TAG) $(MAKE) set-manifest-image

.PHONY: tools
tools: $(GOLANGCI_LINT) $(GOIMPORTS) $(GINKGO) $(CLUSTERCTL) $(KIND) $(KUBECTL) ## build all tools
Expand Down Expand Up @@ -83,6 +90,15 @@ docker-buildx: ## docker build for multiple arch and push to docker hub
load-image: docker-build $(KIND)
$(KIND) load docker-image $(CONTROLLER_IMG):$(TAG) --name $(CONTROL_CLUSTER_NAME)

.PHONY: test
test: | check-manifests fmt vet ## Run uts.
KUBEBUILDER_ASSETS="$(KUBEBUILDER_ASSETS)" go test $(shell go list ./... |grep -v test/fv |grep -v test/helpers) $(TEST_ARGS) -coverprofile cover.out

.PHONY: check-manifests
check-manifests: manifests ## Verify manifests file is up to date
test `git status --porcelain $(GENERATED_FILES) | grep -cE '(^\?)|(^ M)'` -eq 0 || (echo "The manifest file changed, please 'make manifests' and commit the results"; exit 1)


# K8S_VERSION for the Kind cluster can be set as environment variable. If not defined,
# this default value is used
ifndef K8S_VERSION
Expand Down Expand Up @@ -151,4 +167,4 @@ create-cluster: $(KIND) $(CLUSTERCTL) $(KUBECTL) ## Create a new kind cluster de

.PHONY: delete-cluster
delete-cluster: $(KIND) ## Deletes the kind cluster $(CONTROL_CLUSTER_NAME)
$(KIND) delete cluster --name $(CONTROL_CLUSTER_NAME)
$(KIND) delete cluster --name $(CONTROL_CLUSTER_NAME)
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ require (
github.com/TwiN/go-color v1.4.1
github.com/onsi/ginkgo/v2 v2.19.0
github.com/onsi/gomega v1.33.1
github.com/projectsveltos/addon-controller v0.32.1-0.20240625081059-4d758080eef8
github.com/projectsveltos/event-manager v0.32.1-0.20240621192110-ee3370551bc3
github.com/projectsveltos/libsveltos v0.32.1-0.20240624142620-affdfeb694be
github.com/projectsveltos/sveltosctl v0.32.1-0.20240624113158-952a08da4c51
github.com/projectsveltos/addon-controller v0.33.0
github.com/projectsveltos/event-manager v0.33.0
github.com/projectsveltos/libsveltos v0.33.0
github.com/projectsveltos/sveltosctl v0.33.0
github.com/spf13/pflag v1.0.5
k8s.io/api v0.30.2
k8s.io/apimachinery v0.30.2
k8s.io/client-go v0.30.2
k8s.io/component-base v0.30.2
k8s.io/klog/v2 v2.130.0
k8s.io/klog/v2 v2.130.1
sigs.k8s.io/cluster-api v1.7.3
sigs.k8s.io/controller-runtime v0.18.4
)
Expand Down
20 changes: 10 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/projectsveltos/addon-controller v0.32.1-0.20240625081059-4d758080eef8 h1:oesi73hS7KKwEHGfWsDGzYjnNBzEzwG5rtl7I05rWD0=
github.com/projectsveltos/addon-controller v0.32.1-0.20240625081059-4d758080eef8/go.mod h1:nZ4iikcl8juMmqRVBX6VcUK1sd4kIS69WjLlZX0/GVw=
github.com/projectsveltos/event-manager v0.32.1-0.20240621192110-ee3370551bc3 h1:PqilcMnFoHhWJXgMF/bd/s28PKWsg6qi/UQH1eCjEEo=
github.com/projectsveltos/event-manager v0.32.1-0.20240621192110-ee3370551bc3/go.mod h1:tGdsr0BqGaX5X+p3NQ7/F+iWCkwgsAInj+Ktx5k+oZQ=
github.com/projectsveltos/libsveltos v0.32.1-0.20240624142620-affdfeb694be h1:IC9Ca6OqzSQRv//9NSRZt34gdZDyjudwyEz2hZVae7c=
github.com/projectsveltos/libsveltos v0.32.1-0.20240624142620-affdfeb694be/go.mod h1:z6avfRqeHbzqkThyqqqoGcCWMI0JBeAjdeZlbJ7P8TI=
github.com/projectsveltos/sveltosctl v0.32.1-0.20240624113158-952a08da4c51 h1:JgoUg/TRWj2agg/3vvhnU2gStqBz05Nvdg5HzivT+u8=
github.com/projectsveltos/sveltosctl v0.32.1-0.20240624113158-952a08da4c51/go.mod h1:qLWf8ppswh8sNwpgIGNmEuHWzr14/6PY+Nucnm9O64A=
github.com/projectsveltos/addon-controller v0.33.0 h1:EBLX54EPb+IPn1z3JvdQO9jxsaGfFVWtAnAXnVUgW98=
github.com/projectsveltos/addon-controller v0.33.0/go.mod h1:Pxy/45wp5CqLCvFUiGCW8UTo6qa0lxqGSBaUbIx6me8=
github.com/projectsveltos/event-manager v0.33.0 h1:cCju0oX2+KiNHaInm444/jrz+6hfpWptlmwhQAje8VM=
github.com/projectsveltos/event-manager v0.33.0/go.mod h1:wCKEEJEq/+kwD2cKowOZHBoD0bRnk694CXIB+eCV3sM=
github.com/projectsveltos/libsveltos v0.33.0 h1:DHPxqX9zlALgW7Ahn5OaHtcSA35Tfv3H6JU6Cjn+rYA=
github.com/projectsveltos/libsveltos v0.33.0/go.mod h1:GRQ9Otq55Aii1icSvkrTjyDOniBZjYVA5018BRpMvdA=
github.com/projectsveltos/sveltosctl v0.33.0 h1:8VibVlezOfle9dJlx9uwvgAcN5CnnVeRl7o0IvjWsVQ=
github.com/projectsveltos/sveltosctl v0.33.0/go.mod h1:yxUs+Foc2bv8u3CRk89Y7hLaDzEqy/mLgSpdcDlrTos=
github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE=
github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho=
github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw=
Expand Down Expand Up @@ -199,8 +199,8 @@ k8s.io/client-go v0.30.2 h1:sBIVJdojUNPDU/jObC+18tXWcTJVcwyqS9diGdWHk50=
k8s.io/client-go v0.30.2/go.mod h1:JglKSWULm9xlJLx4KCkfLLQ7XwtlbflV6uFFSHTMgVs=
k8s.io/component-base v0.30.2 h1:pqGBczYoW1sno8q9ObExUqrYSKhtE5rW3y6gX88GZII=
k8s.io/component-base v0.30.2/go.mod h1:yQLkQDrkK8J6NtP+MGJOws+/PPeEXNpwFixsUI7h/OE=
k8s.io/klog/v2 v2.130.0 h1:5nB3+3HpqKqXJIXNtJdtxcDCfaa9KL8StJgMzGJkUkM=
k8s.io/klog/v2 v2.130.0/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag=
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98=
k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0 h1:jgGTlFYnhF1PM1Ax/lAlxUPE+KfCIXHaathvJg1C3ak=
Expand Down
6 changes: 3 additions & 3 deletions hack/tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.22.0
require (
github.com/onsi/ginkgo/v2 v2.19.0
golang.org/x/oauth2 v0.21.0
k8s.io/client-go v0.30.1
k8s.io/client-go v0.30.2
sigs.k8s.io/controller-tools v0.15.0
sigs.k8s.io/kind v0.23.0
)
Expand Down Expand Up @@ -45,9 +45,9 @@ require (
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/api v0.30.1 // indirect
k8s.io/api v0.30.2 // indirect
k8s.io/apiextensions-apiserver v0.30.0 // indirect
k8s.io/apimachinery v0.30.1 // indirect
k8s.io/apimachinery v0.30.2 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
Expand Down
12 changes: 6 additions & 6 deletions hack/tools/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,14 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
k8s.io/api v0.30.1 h1:kCm/6mADMdbAxmIh0LBjS54nQBE+U4KmbCfIkF5CpJY=
k8s.io/api v0.30.1/go.mod h1:ddbN2C0+0DIiPntan/bye3SW3PdwLa11/0yqwvuRrJM=
k8s.io/api v0.30.2 h1:+ZhRj+28QT4UOH+BKznu4CBgPWgkXO7XAvMcMl0qKvI=
k8s.io/api v0.30.2/go.mod h1:ULg5g9JvOev2dG0u2hig4Z7tQ2hHIuS+m8MNZ+X6EmI=
k8s.io/apiextensions-apiserver v0.30.0 h1:jcZFKMqnICJfRxTgnC4E+Hpcq8UEhT8B2lhBcQ+6uAs=
k8s.io/apiextensions-apiserver v0.30.0/go.mod h1:N9ogQFGcrbWqAY9p2mUAL5mGxsLqwgtUce127VtRX5Y=
k8s.io/apimachinery v0.30.1 h1:ZQStsEfo4n65yAdlGTfP/uSHMQSoYzU/oeEbkmF7P2U=
k8s.io/apimachinery v0.30.1/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc=
k8s.io/client-go v0.30.1 h1:uC/Ir6A3R46wdkgCV3vbLyNOYyCJ8oZnjtJGKfytl/Q=
k8s.io/client-go v0.30.1/go.mod h1:wrAqLNs2trwiCH/wxxmT/x3hKVH9PuV0GGW0oDoHVqc=
k8s.io/apimachinery v0.30.2 h1:fEMcnBj6qkzzPGSVsAZtQThU62SmQ4ZymlXRC5yFSCg=
k8s.io/apimachinery v0.30.2/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc=
k8s.io/client-go v0.30.2 h1:sBIVJdojUNPDU/jObC+18tXWcTJVcwyqS9diGdWHk50=
k8s.io/client-go v0.30.2/go.mod h1:JglKSWULm9xlJLx4KCkfLLQ7XwtlbflV6uFFSHTMgVs=
k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw=
k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag=
Expand Down
141 changes: 141 additions & 0 deletions k8s/manifest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
---
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/name: sveltos-webhook
name: webhook-service
namespace: projectsveltos
spec:
ports:
- port: 443
protocol: TCP
targetPort: 9443
selector:
app: sveltos-webhook
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/name: project
app: sveltos-webhook
name: conversion-webhook
namespace: projectsveltos
spec:
replicas: 1
selector:
matchLabels:
app: sveltos-webhook
template:
metadata:
annotations:
kubectl.kubernetes.io/default-container: sveltos-webhook
labels:
app: sveltos-webhook
spec:
containers:
- command:
- /conversion-webhook
image: projectsveltos/webhook-conversion:v0.33.0
name: sveltos-webhook
ports:
- containerPort: 9443
name: webhook-server
protocol: TCP
- containerPort: 9440
name: healthz
protocol: TCP
livenessProbe:
failureThreshold: 3
httpGet:
path: /healthz
port: healthz
scheme: HTTP
initialDelaySeconds: 15
periodSeconds: 20
readinessProbe:
failureThreshold: 3
httpGet:
path: /readyz
port: healthz
scheme: HTTP
initialDelaySeconds: 5
periodSeconds: 10
resources:
limits:
cpu: 500m
memory: 128Mi
requests:
cpu: 10m
memory: 64Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
volumeMounts:
- mountPath: /tmp/k8s-webhook-server/serving-certs
name: cert
readOnly: true
securityContext:
runAsNonRoot: true
serviceAccountName: default
terminationGracePeriodSeconds: 10
volumes:
- name: cert
secret:
defaultMode: 420
secretName: webhook-server-cert
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
labels:
app.kubernetes.io/component: certificate
app.kubernetes.io/created-by: project
app.kubernetes.io/instance: serving-cert
app.kubernetes.io/name: certificate
app.kubernetes.io/part-of: project
name: projectsveltos-serving-cert
namespace: projectsveltos
spec:
dnsNames:
- webhook-service.projectsveltos.svc
- webhook-service.projectsveltos.svc.cluster.local
issuerRef:
kind: Issuer
name: project-selfsigned-issuer
secretName: webhook-server-cert
---
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
labels:
app.kubernetes.io/name: sveltos-webhook
name: project-selfsigned-issuer
namespace: projectsveltos
spec:
selfSigned: {}
---
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
annotations:
cert-manager.io/inject-ca-from: projectsveltos/projectsveltos-serving-cert
labels:
app.kubernetes.io/name: sveltos-webhook
name: projectsveltos-mutating-webhook-configuration
webhooks:
- admissionReviewVersions:
- v1beta1
- v1alpha1
clientConfig:
service:
name: webhook-service
namespace: projectsveltos
path: /mutate-projectsveltos-v1beta1-clusterprofile
failurePolicy: Fail
name: mclusterprofile.projectsveltos.io
sideEffects: None
---
2 changes: 1 addition & 1 deletion manifest/manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ spec:
containers:
- command:
- /conversion-webhook
image: projectsveltos/webhook-conversion:dev
image: projectsveltos/webhook-conversion:v0.33.0
name: sveltos-webhook
ports:
- containerPort: 9443
Expand Down

0 comments on commit bb6a296

Please sign in to comment.