Skip to content

fix: reject unsupported identity.type and missing credentials key, merge XR status, skip query on unresolved subscriptionsRef, page results up to maxResults (default 1000), and switch to distroless static-debian13 - #166

Merged
jakubramut merged 3 commits into
mainfrom
fix/release-review-defects
Nov 23, 2026

Conversation

@jakubramut

@jakubramut jakubramut commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Description of your changes

Fixes an identity.type crash, silent wrong or stale results and 1000-row truncation; adds maxResults; switches the runtime to static-debian13.

Why

main (42ce960) on kind, Crossplane v2.4.3:

  • Unsupported identity.type: nil client, panic: runtime error: invalid memory address or nil pointer dereference at fn.go:497, exit 2; other XRs get rpc error: code = Unavailable.
  • Secret without the credentials key: Ready=True, empty status, no warning.
  • After a step writing partial XR status: queryIntervalMinutes, skipQueryWhenTargetHasData ignored.
  • Skip + interval: empty result stored as [{lastQueryTime}], never re-queried.
  • Unresolved subscriptionsRef: falls back to subscriptions, credentials or tenant scope.
  • $skipToken ignored: 1200 rows → 1000 stored, no warning.

grype on a v0.12.1 build: 26 libssl3t64/libc6 matches from base-debian13 (not-fixed/wont-fix), unused by the CGO_ENABLED=0 binary.

What

  • fn.go. Fatal on unsupported identity.type (plus default: in azQuery) and missing credentials key. getXRAndStatus deep-merges desired over observed status; targetHasData ignores a lastQueryTime-only element. Unresolved, empty or non-string subscriptionsRef → warning, query skipped. queryAllPages follows $skipToken up to maxResults; warning when more rows exist or on resultTruncated.
  • input/v1beta1/input.go. maxResults (default 1000, minimum 1); identity.type enum. CRD regenerated (controller-gen v0.23.0).
  • Dockerfile. base-debian13 → static-debian13, as in function-msgraph, function-aws-query.
  • README.md, package/crossplane.yaml. credentials key, maxResults, subscriptionsRef, identity.type; WI example pinned to v0.12.1, valid JSON.

Tests

  • Coverage 58.0% → 82.2%; golangci-lint v2.11.4, govulncheck, grype (ca0dffb image): 0. Mutants: 25/26 killed, survivor drops an unreachable min() guard.
  • kind, main vs branch (static-debian13): 12 baseline scenarios identical, 0 restarts; unknown identity, missing key, maxResults: 0 → fatal; 1200 rows → 1000 + warning (default), 1200 (maxResults: 1200); 449 rows, maxResults: 448 → 448 + warning. Interval, empty-result and subscriptionsRef fixes verified on earlier builds, same code paths.

Default output unchanged; over 1000 rows now warns. Missing credentials key or unknown identity.type now fails; unresolved subscriptionsRef skips, even with subscriptions set. Each extra page is one ARG call; a failed page fails the step. After a partial-status step, observed status carries into the desired XR. No glibc or OpenSSL in the image.

@jakubramut
jakubramut force-pushed the fix/release-review-defects branch from 726f7a8 to ca0dffb Compare November 23, 2026 13:35
@jakubramut jakubramut changed the title fix: reject unsupported identity.type and missing credentials key, merge XR status, page results, skip query on unresolved subscriptionsRef fix: reject unsupported identity.type and missing credentials key, merge XR status, skip query on unresolved subscriptionsRef, page results up to maxResults (default 1000), and switch to distroless static-debian13 Nov 23, 2026
@jakubramut
jakubramut merged commit fc4bc40 into main Nov 23, 2026
6 checks passed
@jakubramut
jakubramut deleted the fix/release-review-defects branch November 23, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants