diff --git a/.drone.yml b/.drone.yml index e5c3e37..3f6583c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -27,7 +27,7 @@ alias: - &IMAGE_DEPLOY_ID ${DRONE_REPO,,}:${DRONE_COMMIT_SHA} # Defines which branches will trigger a docker image push our Google Cloud Registry (tags are always published) - - &GCR_PUBLISH_BRANCHES [main, mr/go] + - &GCR_PUBLISH_BRANCHES [main, dev] # Docker registry publish default settings - &GCR_REGISTRY_SETTINGS diff --git a/reference/lib/vs.sh b/reference/lib/vs.sh index 738e18f..15ce450 100644 --- a/reference/lib/vs.sh +++ b/reference/lib/vs.sh @@ -151,7 +151,8 @@ vs_apply_retain_policy() { log "processing ns='${ns}' pvc_label='${pvc_label}' retain_label='${retain_label}' retain_count='${retain_count}'..." # we keep the last $retain_count daily snapshots, let's get all current volumesnapshots with the label "$retain_label" sorted by latest asc - local sorted_snapshots; sorted_snapshots=$(kubectl -n "$ns" get volumesnapshot -l"$retain_label","$pvc_label" -o=jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}' --sort-by=.metadata.creationTimestamp | tac) + # ensure to use .status.creationTime instead of .metadata.creationTimestamp as restored vs from dangling vsc (new preprovided vsc) are correctly sorted again! + local sorted_snapshots; sorted_snapshots=$(kubectl -n "$ns" get volumesnapshot -l"$retain_label","$pvc_label" -o=jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}' --sort-by=.status.creationTime | tac) local snapshots_retained; snapshots_retained=$(echo "$sorted_snapshots" | head -n "$retain_count")