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

Fixed Otel Controller - Auxiliares resources deletion #2575

Merged
merged 31 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
5a31481
Fixed HPA deletion
yuriolisa Jan 29, 2024
bd9bd93
Fix e2e tests
yuriolisa Jan 29, 2024
10f82b0
Added reconciliation test
yuriolisa Feb 12, 2024
515a034
Changed from client.Object to HPA Obj
yuriolisa Feb 12, 2024
2ac2af7
Added owned objects function
yuriolisa Feb 12, 2024
a61de02
Fixed controller test
yuriolisa Feb 13, 2024
20c7bf6
Fixed controller test
yuriolisa Feb 13, 2024
29135cd
Fixed controller test
yuriolisa Feb 13, 2024
8f6159c
Add PodDisruptionBudget
yuriolisa Feb 14, 2024
dacc99a
Add PodDisruptionBudget
yuriolisa Feb 15, 2024
a0a30da
Change vars setting
yuriolisa Feb 16, 2024
1edd721
Change vars setting
yuriolisa Feb 16, 2024
29ad837
Change vars setting
yuriolisa Feb 19, 2024
2f1b576
Update e2e tests to chainsaw
yuriolisa Feb 20, 2024
9a669d0
Added ingress e2e tests
yuriolisa Feb 21, 2024
ebbb447
Added Volumes, changed function's place
yuriolisa Feb 26, 2024
55240ba
Added Volumes, changed function's place
yuriolisa Feb 26, 2024
4350a56
Added Volumes, changed function's place
yuriolisa Feb 27, 2024
1839504
Fixed Suite Test
yuriolisa Feb 27, 2024
88b30ef
Added RBAC for Volumes
yuriolisa Feb 27, 2024
7e1b010
Added RBAC for Volumes
yuriolisa Feb 27, 2024
18c8385
Fixed Suite Test
yuriolisa Feb 27, 2024
3e77e72
Fixed Suite Test
yuriolisa Feb 27, 2024
8bd21d5
Fixed Suite Test
yuriolisa Feb 27, 2024
2087366
Add a sleep
jaronoff97 Feb 27, 2024
d2a0269
Merge pull request #1 from jaronoff97/fix-hpa-delete
yuriolisa Feb 28, 2024
7d09dd0
Fixed Chainsaw test
yuriolisa Feb 28, 2024
42469b4
Fixed Chainsaw test
yuriolisa Feb 28, 2024
8af8038
Fixed Chainsaw test
yuriolisa Feb 28, 2024
1ffc7eb
Fixed Chainsaw test
yuriolisa Feb 28, 2024
ba7c3b2
Fixed Chainsaw test
yuriolisa Feb 28, 2024
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
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ generate: controller-gen
# end-to-tests
.PHONY: e2e
e2e: chainsaw
$(CHAINSAW) test --test-dir ./tests/e2e
$(CHAINSAW) test --test-dir ./tests/e2e/ingress
yuriolisa marked this conversation as resolved.
Show resolved Hide resolved

# end-to-end-test for testing autoscale
.PHONY: e2e-autoscale
Expand Down Expand Up @@ -367,7 +367,7 @@ KUSTOMIZE_VERSION ?= v5.0.3
CONTROLLER_TOOLS_VERSION ?= v0.12.0
GOLANGCI_LINT_VERSION ?= v1.54.0
KIND_VERSION ?= v0.20.0
CHAINSAW_VERSION ?= v0.1.4
CHAINSAW_VERSION ?= v0.1.7

.PHONY: install-tools
install-tools: kustomize golangci-lint kind controller-gen envtest crdoc kind operator-sdk chainsaw
Expand Down
12 changes: 6 additions & 6 deletions tests/e2e/ingress/00-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: simplest-collector
name: otel-simplest-collector
status:
readyReplicas: 1
---
Expand All @@ -13,29 +13,29 @@ metadata:
something.com: "true"
labels:
app.kubernetes.io/managed-by: opentelemetry-operator
app.kubernetes.io/name: simplest-ingress
name: simplest-ingress
app.kubernetes.io/name: otel-simplest-ingress
name: otel-simplest-ingress
ownerReferences:
- apiVersion: opentelemetry.io/v1alpha1
blockOwnerDeletion: true
controller: true
kind: OpenTelemetryCollector
name: simplest
name: otel-simplest
spec:
rules:
- host: example.com
http:
paths:
- backend:
service:
name: simplest-collector
name: otel-simplest-collector
port:
name: otlp-grpc
path: /otlp-grpc
pathType: Prefix
- backend:
service:
name: simplest-collector
name: otel-simplest-collector
port:
name: otlp-http
path: /otlp-http
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/ingress/00-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
apiVersion: opentelemetry.io/v1alpha1
kind: OpenTelemetryCollector
metadata:
name: simplest
name: otel-simplest
spec:
mode: "deployment"
mode: deployment
ingress:
type: ingress
hostname: "example.com"
Expand Down
10 changes: 5 additions & 5 deletions tests/e2e/ingress/01-error.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,29 @@ metadata:
something.com: "true"
labels:
app.kubernetes.io/managed-by: opentelemetry-operator
app.kubernetes.io/name: simplest-ingress
name: simplest-ingress
app.kubernetes.io/name: otel-simplest-ingress
name: otel-simplest-ingress
ownerReferences:
- apiVersion: opentelemetry.io/v1alpha1
blockOwnerDeletion: true
controller: true
kind: OpenTelemetryCollector
name: simplest
name: otel-simplest
spec:
rules:
- host: example.com
http:
paths:
- backend:
service:
name: simplest-collector
name: otel-simplest-collector
port:
name: otlp-grpc
path: /otlp-grpc
pathType: Prefix
- backend:
service:
name: simplest-collector
name: otel-simplest-collector
port:
name: otlp-http
path: /otlp-http
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
apiVersion: opentelemetry.io/v1alpha1
kind: OpenTelemetryCollector
metadata:
name: simplest
name: otel-simplest
spec:
mode: "deployment"
mode: deployment
ingress: ~
config: |
receivers:
otlp:
Expand Down
18 changes: 11 additions & 7 deletions tests/e2e/ingress/chainsaw-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
creationTimestamp: null
name: ingress
spec:
skip: false
concurrent: false
skipDelete: false
timeouts:
apply: 10s
assert: 10s
error: 10s
steps:
- name: step-00
try:
Expand All @@ -15,9 +21,7 @@ spec:
# Applying the same OpenTelemetryCollector from the previous step, but this time without the spec.ingress, which should inform the controller to delete the ingress resource. So, we should get an error checking if the ingress still exists.
- name: step-01
try:
- apply:
file: 01-install.yaml
- sleep:
duration: 5s
- error:
file: 01-error.yaml
- patch:
file: 01-remove-ingress.yaml
- error:
file: 01-error.yaml