Skip to content

Commit

Permalink
Add test case for https catalog repo
Browse files Browse the repository at this point in the history
Rendered from template version: main (ff9d5a8)
  • Loading branch information
simu committed Dec 17, 2024
1 parent 42da58b commit e25e52a
Show file tree
Hide file tree
Showing 40 changed files with 45,076 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"template": "https://github.com/projectsyn/commodore-component-template.git",
"commit": "8840f87d25d97ce0d4bfed75d40173caaf4100fc",
"commit": "ff9d5a839714344345b76be069ea23e39e580f38",
"checkout": "main",
"context": {
"cookiecutter": {
"name": "Argo CD",
"slug": "argocd",
"parameter_key": "argocd",
"test_cases": "defaults openshift params prometheus",
"test_cases": "defaults openshift params prometheus https-catalog",
"add_lib": "y",
"add_pp": "n",
"add_golden": "y",
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
- openshift
- params
- prometheus
- https-catalog
defaults:
run:
working-directory: ${{ env.COMPONENT_NAME }}
Expand All @@ -54,6 +55,7 @@ jobs:
- openshift
- params
- prometheus
- https-catalog
defaults:
run:
working-directory: ${{ env.COMPONENT_NAME }}
Expand Down
2 changes: 1 addition & 1 deletion Makefile.vars.mk
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ KUBENT_IMAGE ?= ghcr.io/doitintl/kube-no-trouble:latest
KUBENT_DOCKER ?= $(DOCKER_CMD) $(DOCKER_ARGS) $(root_volume) --entrypoint=/app/kubent $(KUBENT_IMAGE)

instance ?= defaults
test_instances = tests/defaults.yml tests/openshift.yml tests/params.yml tests/prometheus.yml
test_instances = tests/defaults.yml tests/openshift.yml tests/params.yml tests/prometheus.yml tests/https-catalog.yml
14 changes: 14 additions & 0 deletions tests/golden/https-catalog/argocd/apps/00_default-project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
name: default
namespace: syn
spec:
clusterResourceWhitelist:
- group: '*'
kind: '*'
destinations:
- namespace: '*'
server: '*'
sourceRepos:
- '*'
16 changes: 16 additions & 0 deletions tests/golden/https-catalog/argocd/apps/00_syn-project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
name: syn
namespace: syn
spec:
clusterResourceWhitelist:
- group: '*'
kind: '*'
destinations:
- namespace: '*'
server: https://kubernetes.default.svc
orphanedResources:
warn: false
sourceRepos:
- https://git.example.com/cluster-catalog.git
20 changes: 20 additions & 0 deletions tests/golden/https-catalog/argocd/apps/01_rootapp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: root
namespace: syn
spec:
destination:
namespace: syn
server: https://kubernetes.default.svc
project: syn
source:
directory:
recurse: true
path: manifests/apps/
repoURL: https://git.example.com/cluster-catalog.git
targetRevision: HEAD
syncPolicy:
automated:
prune: true
selfHeal: true
26 changes: 26 additions & 0 deletions tests/golden/https-catalog/argocd/apps/10_argocd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
annotations:
argocd.argoproj.io/compare-options: ServerSideDiff=true
finalizers:
- resources-finalizer.argocd.argoproj.io
name: argocd
namespace: syn
spec:
destination:
namespace: syn
server: https://kubernetes.default.svc
project: syn
source:
directory:
recurse: true
path: manifests/argocd
repoURL: https://git.example.com/cluster-catalog.git
targetRevision: HEAD
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- ServerSideApply=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: Namespace
metadata:
annotations: {}
labels:
app.kubernetes.io/part-of: argocd
name: syn
openshift.io/cluster-monitoring: 'true'
name: syn
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
app.kubernetes.io/name: syn-argocd-metrics
app.kubernetes.io/part-of: argocd
name: syn-component-argocd-metrics
name: syn-component-argocd-metrics
namespace: syn
spec:
endpoints:
- port: metrics
selector:
matchLabels:
app.kubernetes.io/name: syn-argocd-metrics
app.kubernetes.io/part-of: argocd
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
app.kubernetes.io/name: syn-argocd-server-metrics
app.kubernetes.io/part-of: argocd
name: syn-component-argocd-server-metrics
name: syn-component-argocd-server-metrics
namespace: syn
spec:
endpoints:
- port: metrics
selector:
matchLabels:
app.kubernetes.io/name: syn-argocd-server-metrics
app.kubernetes.io/part-of: argocd
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
app.kubernetes.io/name: syn-argocd-repo-server
app.kubernetes.io/part-of: argocd
name: syn-component-argocd-repo-server
name: syn-component-argocd-repo-server
namespace: syn
spec:
endpoints:
- port: metrics
selector:
matchLabels:
app.kubernetes.io/name: syn-argocd-repo-server
app.kubernetes.io/part-of: argocd
---
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
labels:
cluster_id: c-green-test-1234
name: argocd
prometheus: platform
role: alert-rules
tenant_id: t-silent-test-1234
name: argocd
namespace: syn
spec:
groups:
- name: argocd.rules
rules:
- alert: ArgoCDAppUnsynced
annotations:
dashboard: argocd
description: kubectl -n syn describe app {{ $labels.name }}
message: Argo CD app {{ $labels.name }} is not synced
expr: argocd_app_info{exported_namespace="syn", sync_status!="Synced"} >
0
for: 10m
labels:
severity: warning
syn: 'true'
- alert: ArgoCDAppUnhealthy
annotations:
dashboard: argocd
description: kubectl -n syn describe app {{ $labels.name }}
message: Argo CD app {{ $labels.name }} is not healthy
expr: argocd_app_info{exported_namespace="syn", health_status!="Healthy"}
> 0
for: 10m
labels:
severity: critical
syn: 'true'
- alert: ArgoCDDown
annotations:
dashboard: argocd
message: Argo CD job {{ $labels.job }} is down
expr: up{namespace="syn", job=~"^syn-argocd-.+$"} != 1
for: 5m
labels:
severity: critical
syn: 'true'
Loading

0 comments on commit e25e52a

Please sign in to comment.