All checks were successful
deploy / deploy (push) Successful in 30s
Proof: Push-driven repo workflow now renders and applies the built image across all repo-owned deployments instead of resetting services to placeholder images or relying on a manual rollout list. Assumptions: All repo-owned workloads that should roll on push carry app.kubernetes.io/part-of= in the manifests, and namespace bootstrap can happen before the image build without applying placeholder deployments. Still fake: This turn fixes the repo deployment path in code, but I have not yet exercised the new Forgejo workflow end-to-end from a fresh push on the cluster.
42 lines
932 B
Python
42 lines
932 B
Python
import unittest
|
|
|
|
from scripts.deploy.render_release_manifest import render_release_manifest
|
|
|
|
|
|
class RenderReleaseManifestTest(unittest.TestCase):
|
|
def test_swaps_placeholder_images_for_release_image(self):
|
|
input_manifest = """
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: operator-dashboard
|
|
spec:
|
|
template:
|
|
spec:
|
|
containers:
|
|
- name: app
|
|
image: ghcr.io/example/unrip:bootstrap
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: ops-sentinel
|
|
spec:
|
|
template:
|
|
spec:
|
|
containers:
|
|
- name: app
|
|
image: ghcr.io/example/unrip:bootstrap
|
|
"""
|
|
|
|
output = render_release_manifest(
|
|
input_manifest,
|
|
"registry.example/unrip:abc123",
|
|
)
|
|
|
|
self.assertIn("image: registry.example/unrip:abc123", output)
|
|
self.assertNotIn("ghcr.io/example/unrip:bootstrap", output)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|