|
| 1 | +package: |
| 2 | + name: mariadb-operator |
| 3 | + version: "0.38.1" |
| 4 | + epoch: 0 |
| 5 | + description: A Go operator that automates the deployment and management of MariaDB databases on Kubernetes |
| 6 | + copyright: |
| 7 | + - license: MIT |
| 8 | + |
| 9 | +pipeline: |
| 10 | + - uses: git-checkout |
| 11 | + with: |
| 12 | + repository: https://github.com/mariadb-operator/mariadb-operator.git |
| 13 | + tag: v${{package.version}} |
| 14 | + expected-commit: 1d616a2c931a115f503f7cfb5a08ae0aa608799d |
| 15 | + |
| 16 | + - uses: go/bump |
| 17 | + with: |
| 18 | + deps: | |
| 19 | + |
| 20 | + |
| 21 | + github.com/go-chi/chi/[email protected] |
| 22 | +
|
| 23 | + - uses: go/build |
| 24 | + with: |
| 25 | + packages: ./cmd/controller |
| 26 | + output: mariadb-operator |
| 27 | + |
| 28 | +update: |
| 29 | + enabled: true |
| 30 | + ignore-regex-patterns: |
| 31 | + github: |
| 32 | + identifier: mariadb-operator/mariadb-operator |
| 33 | + use-tag: true |
| 34 | + strip-prefix: v |
| 35 | + tag-filter: ^v\d+\.\d+\.\d+$ |
| 36 | + |
| 37 | +vars: |
| 38 | + bin-name: mariadb-operator |
| 39 | + |
| 40 | +test: |
| 41 | + environment: |
| 42 | + contents: |
| 43 | + packages: |
| 44 | + - ${{package.name}} |
| 45 | + - cmd:mkcert |
| 46 | + - curl |
| 47 | + environment: |
| 48 | + KUBERNETES_SERVICE_HOST: "127.0.0.1" |
| 49 | + KUBERNETES_SERVICE_PORT: "8080" |
| 50 | + MARIADB_OPERATOR_NAME: "mariadb-operator" |
| 51 | + MARIADB_OPERATOR_NAMESPACE: "default" |
| 52 | + MARIADB_OPERATOR_SA_PATH: "/var/run/secrets/kubernetes.io/serviceaccount" |
| 53 | + MARIADB_OPERATOR_IMAGE: "cgr.dev/chainguard/mariadb-operator:latest" |
| 54 | + RELATED_IMAGE_MARIADB: "docker-registry1.mariadb.com/library/mariadb:11.4.5" |
| 55 | + RELATED_IMAGE_MAXSCALE: "docker-registry2.mariadb.com/mariadb/maxscale:23.08.5" |
| 56 | + RELATED_IMAGE_EXPORTER: "prom/mysqld-exporter:v0.15.1" |
| 57 | + RELATED_IMAGE_EXPORTER_MAXSCALE: "docker-registry2.mariadb.com/mariadb/maxscale-prometheus-exporter-ubi:v0.0.1" |
| 58 | + MARIADB_GALERA_LIB_PATH: "/usr/lib/galera/libgalera_smm.so" |
| 59 | + MARIADB_DEFAULT_VERSION: "11.4" |
| 60 | + pipeline: |
| 61 | + - uses: test/tw/ldd-check |
| 62 | + - runs: | |
| 63 | + ${{vars.bin-name}} --help 2>&1 | grep -E "Run and operate MariaDB in a cloud native way." |
| 64 | + - uses: test/kwok/cluster |
| 65 | + - name: Install MariaDB operator CRDs |
| 66 | + runs: | |
| 67 | + # Install MariaDB operator CRDs from upstream |
| 68 | + kubectl apply -f https://raw.githubusercontent.com/mariadb-operator/mariadb-operator/v${{package.version}}/config/crd/bases/k8s.mariadb.com_mariadbs.yaml |
| 69 | + kubectl apply -f https://raw.githubusercontent.com/mariadb-operator/mariadb-operator/v${{package.version}}/config/crd/bases/k8s.mariadb.com_connections.yaml |
| 70 | + kubectl apply -f https://raw.githubusercontent.com/mariadb-operator/mariadb-operator/v${{package.version}}/config/crd/bases/k8s.mariadb.com_backups.yaml |
| 71 | + kubectl apply -f https://raw.githubusercontent.com/mariadb-operator/mariadb-operator/v${{package.version}}/config/crd/bases/k8s.mariadb.com_restores.yaml |
| 72 | + kubectl apply -f https://raw.githubusercontent.com/mariadb-operator/mariadb-operator/v${{package.version}}/config/crd/bases/k8s.mariadb.com_sqljobs.yaml |
| 73 | + kubectl apply -f https://raw.githubusercontent.com/mariadb-operator/mariadb-operator/v${{package.version}}/config/crd/bases/k8s.mariadb.com_databases.yaml |
| 74 | + kubectl apply -f https://raw.githubusercontent.com/mariadb-operator/mariadb-operator/v${{package.version}}/config/crd/bases/k8s.mariadb.com_users.yaml |
| 75 | + kubectl apply -f https://raw.githubusercontent.com/mariadb-operator/mariadb-operator/v${{package.version}}/config/crd/bases/k8s.mariadb.com_grants.yaml |
| 76 | + kubectl apply -f https://raw.githubusercontent.com/mariadb-operator/mariadb-operator/v${{package.version}}/config/crd/bases/k8s.mariadb.com_maxscales.yaml |
| 77 | + kubectl wait --for=condition=Established crd --all --timeout=60s |
| 78 | + - name: Launch operator with dummy kubeconfig |
| 79 | + uses: test/daemon-check-output |
| 80 | + with: |
| 81 | + setup: | |
| 82 | + kubectl config view --minify --raw > /tmp/kubeconfig.yaml |
| 83 | + # Create webhook certificates |
| 84 | + mkcert example.com mariadb.local localhost 127.0.0.1 ::1 |
| 85 | + mkdir -p /tmp/k8s-webhook-server/serving-certs |
| 86 | + mv example.com+4-key.pem /tmp/k8s-webhook-server/serving-certs/tls.key |
| 87 | + mv example.com+4.pem /tmp/k8s-webhook-server/serving-certs/tls.crt |
| 88 | + # Create service account directory structure |
| 89 | + mkdir -p /var/run/secrets/kubernetes.io/serviceaccount |
| 90 | + echo "default" > /var/run/secrets/kubernetes.io/serviceaccount/namespace |
| 91 | + echo "dummy-token" > /var/run/secrets/kubernetes.io/serviceaccount/token |
| 92 | + echo "dummy-ca-cert" > /var/run/secrets/kubernetes.io/serviceaccount/ca.crt |
| 93 | + start: env KUBECONFIG=/tmp/kubeconfig.yaml ${{vars.bin-name}} |
| 94 | + timeout: 30 |
| 95 | + expected_output: | |
| 96 | + Watching all namespaces |
| 97 | + Discovery info |
| 98 | + Resources |
| 99 | + Starting manager |
| 100 | + Starting metrics server |
| 101 | + Starting EventSource |
| 102 | + Starting Controller |
| 103 | + Starting workers |
| 104 | + post: | |
| 105 | + echo "Verifying metrics endpoint" |
| 106 | + curl -sf http://127.0.0.1:8080/metrics | grep -E "go_goroutines|process_cpu_seconds_total" || exit 1 |
0 commit comments