Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions functions/branch/999-status.yaml.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
---
apiVersion: {{ $xr.apiVersion }}
kind: {{ $xr.kind }}
metadata:
annotations:
gotemplating.fn.crossplane.io/ready: {{ ternary "True" "False" $state.status.ready | quote }}
status:
ready: {{ $state.status.ready }}
bootstrapPhase: {{ $state.status.bootstrapPhase | quote }}
Expand Down
17 changes: 16 additions & 1 deletion tests/test-branch/main.k
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,9 @@ _items = [

# ==========================================================================
# Cross-namespace, second reconcile: once the source snapshot is bound,
# the branch snapshot is rendered with a non-empty static content ref.
# the branch snapshot is rendered with a non-empty static content ref. The
# composite must remain pipeline-unready while those new resources are
# absent; otherwise auto-ready stalls the staged composition here.
# ==========================================================================
metav1alpha1.CompositionTest {
metadata.name = "cross-ns-imports-source-handle-into-branch-content"
Expand Down Expand Up @@ -348,6 +350,19 @@ _items = [
metadata.name = "br-x-branch-snapshot"
spec.forProvider.manifest.spec.source.volumeSnapshotContentName = "preview-pr-1-br-x-6a6f418e5232e5cb-content"
}
{
apiVersion = "hops.ops.com.ai/v1alpha1"
kind = "PSQLBranch"
metadata.name = "br-x"
status = {
ready = False
conditions = [
{type = "Responsive", status = "True"}
{type = "Synced", status = "True"}
{type = "Ready", status = "False"}
]
}
}
]
}
}
Expand Down
59 changes: 59 additions & 0 deletions tests/test-branch/observed/cross-namespace-staged.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
apiVersion: kubernetes.m.crossplane.io/v1alpha1
kind: Object
metadata:
name: pr-142-source-cluster
namespace: preview-pr-142
annotations:
crossplane.io/composition-resource-name: source-cluster
gotemplating.fn.crossplane.io/composition-resource-name: source-cluster
status:
conditions:
- type: Ready
status: "True"
atProvider:
manifest:
spec:
imageName: ghcr.io/cloudnative-pg/postgresql:17
status:
phase: Cluster in healthy state
---
apiVersion: kubernetes.m.crossplane.io/v1alpha1
kind: Object
metadata:
name: pr-142-source-snapshot
namespace: preview-pr-142
annotations:
crossplane.io/composition-resource-name: source-snapshot
gotemplating.fn.crossplane.io/composition-resource-name: source-snapshot
status:
conditions:
- type: Ready
status: "True"
atProvider:
manifest:
status:
boundVolumeSnapshotContentName: source-content
readyToUse: true
---
apiVersion: kubernetes.m.crossplane.io/v1alpha1
kind: Object
metadata:
name: pr-142-source-snapshot-content
namespace: preview-pr-142
annotations:
crossplane.io/composition-resource-name: source-snapshot-content
gotemplating.fn.crossplane.io/composition-resource-name: source-snapshot-content
status:
conditions:
- type: Ready
status: "True"
atProvider:
manifest:
spec:
driver: ebs.csi.eks.amazonaws.com
source:
snapshotHandle: snap-0123456789abcdef0
sourceVolumeMode: Filesystem
volumeSnapshotClassName: psql
status:
readyToUse: true