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

Add some e2e tests as a feature branch #533

Merged
merged 9 commits into from
Dec 5, 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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ IMG ?= ngrok-operator
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.29.0

# Repository URL
REPO_URL = github.com/ngrok/ngrok-operator

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
Expand Down
58 changes: 58 additions & 0 deletions tests/chainsaw/operator-registration/chainsaw-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
name: operator-registration
spec:
steps:
- name: assert KubernetesOperator/ngrok-operator is registered
try:
- assert:
resource:
apiVersion: ngrok.k8s.ngrok.com/v1alpha1
kind: KubernetesOperator
metadata:
name: ngrok-operator
namespace: ngrok-operator
spec:
deployment:
name: ngrok-operator
namespace: ngrok-operator
enabledFeatures:
- ingress
- bindings
# - gateway
binding:
tlsSecretName: ngrok-operator-default-tls
(name != null && starts_with(name, 'k8s/')): true
status:
registrationStatus: registered
(id != null && starts_with(id, 'k8sop_')): true
(uri != null): true

- name: assert Secret/ngrok-operator-default-tls exists (CSR is signed)
try:
- assert:
resource:
apiVersion: v1
kind: Secret
metadata:
name: ngrok-operator-default-tls
namespace: ngrok-operator
type: kubernetes.io/tls
data:
("tls.crt" != null): true
("tls.csr" != null): true
("tls.key" != null): true

- name: assert Configmap/ngrok-intermediate-ca exists (tunnels/forwarders will work)
try:
- assert:
resource:
apiVersion: v1
kind: ConfigMap
metadata:
name: ngrok-intermediate-ca
namespace: ngrok-operator
data:
("root.crt" != null): true
Loading