-
Notifications
You must be signed in to change notification settings - Fork 64
Open
Description
There is no simple way to test a single template's healthRules
cartotest makes it easy to assert that a template will stamp an expected object given certain inputs. It allows users to mock out earlier steps in a supply chain. Users also care about the healthRules, status of the created object and the status of the workload. But these can only be evaluated once the given object is submitted to the cluster.
Proposed solution
Create a new cartographer CRD that allows pointing to a template, defining a workload, defining inputs and supplychain params, and asserting on both the status of the object on the cluster and the status of the workload.
Example
apiVersion: carto.run/v1alpha1
kind: CartoTest
metadata:
name: test-kpack-healthy
spec:
workload:
metadata:
name: my-workload-name
namespace: my-namespace
spec:
serviceAccountName: such-a-good-sa
templateRef:
name: image
inputs:
sources:
source:
url: some-passed-on-url
revision:
branch: "some_unused_branch"
blueprintParams:
- name: "image_prefix"
value: "some-prefix"
assertion:
lifecycle:
# either:
eventually: true
timeout: "10m"
# or:
consistently: true
duration: "20m"
expectedObject:
apiVersion: kpack.io/v1alpha2
kind: Image
metadata:
name: my-workload-name
status:
# insert expected status fields here
expectedWorkloadStatus:
status:
# insert expected status fields hereafter reconciliation the object would either have a Ready: true or Ready: false condition.
Additional Context
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels