Skip to content

Commit

Permalink
Merge branch 'main' into K8SPSMDB-921_add_test_for_irsa
Browse files Browse the repository at this point in the history
  • Loading branch information
nmarukovich authored Nov 11, 2024
2 parents 4ae49e4 + 31adb35 commit 2660176
Show file tree
Hide file tree
Showing 67 changed files with 1,854 additions and 312 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ jobs:
with:
go-version: '^1.22'
- uses: actions/checkout@v4.1.1
- name: go test
run: go test -v ./...
- name: run tests
run: make test
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ VERSION ?= $(shell git rev-parse --abbrev-ref HEAD | $(SED) -e 's^/^-^g; s^[.]^-
IMAGE ?= $(IMAGE_TAG_BASE):$(VERSION)
DEPLOYDIR = ./deploy

ENVTEST_K8S_VERSION = 1.31

all: build

help: ## Display this help.
Expand Down Expand Up @@ -35,6 +37,9 @@ $(DEPLOYDIR)/cw-bundle.yaml: $(DEPLOYDIR)/crd.yaml $(DEPLOYDIR)/cw-rbac.yaml $(D

manifests: $(DEPLOYDIR)/crd.yaml $(DEPLOYDIR)/bundle.yaml $(DEPLOYDIR)/cw-bundle.yaml ## Put generated manifests to deploy directory

e2e-test:
IMAGE=$(IMAGE) ./e2e-tests/$(TEST)/run

##@ Build

.PHONY: build
Expand All @@ -60,6 +65,9 @@ deploy: ## Deploy operator
undeploy: ## Undeploy operator
kubectl delete -f $(DEPLOYDIR)/operator.yaml

test: envtest ## Run tests.
DISABLE_TELEMETRY=true KUBEBUILDER_ASSETS="$(shell $(ENVTEST) --arch=amd64 use $(ENVTEST_K8S_VERSION) -p path)" go test ./... -coverprofile cover.out

# go-get-tool will 'go get' any package $2 and install it to $1.
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
define go-get-tool
Expand All @@ -82,6 +90,10 @@ KUSTOMIZE = $(shell pwd)/bin/kustomize
kustomize: ## Download kustomize locally if necessary.
$(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v4@v4.5.3)

ENVTEST = $(shell pwd)/bin/setup-envtest
envtest: ## Download envtest-setup locally if necessary.
$(call go-get-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest@latest)

# Prepare release
CERT_MANAGER_VER := $(shell grep -Eo "cert-manager v.*" go.mod|grep -Eo "[0-9]+\.[0-9]+\.[0-9]+")
release: manifests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ spec:
type: string
error:
type: string
filesystem:
properties:
path:
type: string
required:
- path
type: object
lastTransition:
format: date-time
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ spec:
type: string
error:
type: string
filesystem:
properties:
path:
type: string
required:
- path
type: object
lastTransition:
format: date-time
type: string
Expand Down
33 changes: 33 additions & 0 deletions config/crd/bases/psmdb.percona.com_perconaservermongodbs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,13 @@ spec:
required:
- credentialsSecret
type: object
filesystem:
properties:
path:
type: string
required:
- path
type: object
s3:
properties:
bucket:
Expand Down Expand Up @@ -388,6 +395,28 @@ spec:
- name
type: object
type: array
volumeMounts:
items:
properties:
mountPath:
type: string
mountPropagation:
type: string
name:
type: string
readOnly:
type: boolean
recursiveReadOnly:
type: string
subPath:
type: string
subPathExpr:
type: string
required:
- mountPath
- name
type: object
type: array
required:
- enabled
- image
Expand Down Expand Up @@ -6380,6 +6409,8 @@ spec:
type: object
host:
type: string
priority:
type: integer
tags:
additionalProperties:
type: string
Expand Down Expand Up @@ -14138,6 +14169,8 @@ spec:
type: object
host:
type: string
priority:
type: integer
tags:
additionalProperties:
type: string
Expand Down
47 changes: 47 additions & 0 deletions deploy/bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ spec:
type: string
error:
type: string
filesystem:
properties:
path:
type: string
required:
- path
type: object
lastTransition:
format: date-time
type: string
Expand Down Expand Up @@ -241,6 +248,13 @@ spec:
type: string
error:
type: string
filesystem:
properties:
path:
type: string
required:
- path
type: object
lastTransition:
format: date-time
type: string
Expand Down Expand Up @@ -990,6 +1004,13 @@ spec:
required:
- credentialsSecret
type: object
filesystem:
properties:
path:
type: string
required:
- path
type: object
s3:
properties:
bucket:
Expand Down Expand Up @@ -1070,6 +1091,28 @@ spec:
- name
type: object
type: array
volumeMounts:
items:
properties:
mountPath:
type: string
mountPropagation:
type: string
name:
type: string
readOnly:
type: boolean
recursiveReadOnly:
type: string
subPath:
type: string
subPathExpr:
type: string
required:
- mountPath
- name
type: object
type: array
required:
- enabled
- image
Expand Down Expand Up @@ -7062,6 +7105,8 @@ spec:
type: object
host:
type: string
priority:
type: integer
tags:
additionalProperties:
type: string
Expand Down Expand Up @@ -14820,6 +14865,8 @@ spec:
type: object
host:
type: string
priority:
type: integer
tags:
additionalProperties:
type: string
Expand Down
14 changes: 14 additions & 0 deletions deploy/cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ spec:
secrets:
users: my-cluster-name-secrets
encryptionKey: my-cluster-name-mongodb-encryption-key
# ssl: my-cluster-name-ssl
# sslInternal: my-cluster-name-ssl-internal
# keyFile: my-cluster-name-mongodb-keyfile
# vault: my-cluster-name-vault
# ldapSecret: my-ldap-secret
Expand All @@ -77,6 +79,7 @@ spec:
# replsetOverrides:
# my-cluster-name-rs0-0:
# host: my-cluster-name-rs0-0.example.net:27017
# priority: 3
# tags:
# key: value-0
# my-cluster-name-rs0-1:
Expand Down Expand Up @@ -189,6 +192,10 @@ spec:
# - name: sidecar-config
# configMap:
# name: myconfigmap
# - name: backup-nfs
# nfs:
# server: "nfs-service.storage.svc.cluster.local"
# path: "/psmdb-some-name-rs0"
# sidecarPVCs:
# - apiVersion: v1
# kind: PersistentVolumeClaim
Expand Down Expand Up @@ -657,6 +664,13 @@ spec:
# prefix: PREFIX-NAME
# endpointUrl: https://accountName.blob.core.windows.net
# credentialsSecret: SECRET-NAME
# backup-nfs:
# type: filesystem
# filesystem:
# path: /mnt/nfs/
# volumeMounts:
# - mountPath: /mnt/nfs/
# name: backup-nfs
pitr:
enabled: false
oplogOnly: false
Expand Down
47 changes: 47 additions & 0 deletions deploy/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ spec:
type: string
error:
type: string
filesystem:
properties:
path:
type: string
required:
- path
type: object
lastTransition:
format: date-time
type: string
Expand Down Expand Up @@ -241,6 +248,13 @@ spec:
type: string
error:
type: string
filesystem:
properties:
path:
type: string
required:
- path
type: object
lastTransition:
format: date-time
type: string
Expand Down Expand Up @@ -990,6 +1004,13 @@ spec:
required:
- credentialsSecret
type: object
filesystem:
properties:
path:
type: string
required:
- path
type: object
s3:
properties:
bucket:
Expand Down Expand Up @@ -1070,6 +1091,28 @@ spec:
- name
type: object
type: array
volumeMounts:
items:
properties:
mountPath:
type: string
mountPropagation:
type: string
name:
type: string
readOnly:
type: boolean
recursiveReadOnly:
type: string
subPath:
type: string
subPathExpr:
type: string
required:
- mountPath
- name
type: object
type: array
required:
- enabled
- image
Expand Down Expand Up @@ -7062,6 +7105,8 @@ spec:
type: object
host:
type: string
priority:
type: integer
tags:
additionalProperties:
type: string
Expand Down Expand Up @@ -14820,6 +14865,8 @@ spec:
type: object
host:
type: string
priority:
type: integer
tags:
additionalProperties:
type: string
Expand Down
Loading

0 comments on commit 2660176

Please sign in to comment.