Resolve convert placeholders from cluster resources#101
Open
ArnobKumarSaha wants to merge 1 commit into
Open
Conversation
Use the live cluster to resolve the target, addon and task for AppBinding-backed BackupConfiguration/RestoreSession instead of emitting placeholders: - Capture the client convert already built (was discarded) and register the appcatalog scheme so AppBindings can be fetched. - resolveAppBindingTarget looks up the AppBinding -> spec.appRef (real KubeDB target) and the KubeStash addon name from the catalog version's spec.archiver.addon.name (falling back to <kind>-addon). Backup/restore tasks use the logical-backup / logical-backup-restore constants. - If the cluster is unreachable, keep the existing placeholder behaviour; only hard-fail when a referenced AppBinding/version is genuinely NotFound. - Add --encryption-secret-name / --encryption-secret-namespace flags to fill the encryptionSecret; set repository.directory to <namespace>/<name> of the target. - Emit review YAML line-comments for fields that still need operator attention. Signed-off-by: Arnob Kumar Saha <arnob@appscode.com>
anisurrahman75
approved these changes
Jul 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Improves
kubectl kubestash convertso that, for database backups, it resolves values from the live cluster instead of emitting### Set Valid X ###placeholders that operators must fill in by hand.The command already built a Kubernetes client and then discarded it; this wires it up.
How
For
BackupConfiguration/RestoreSessionwhose target is anAppBinding:AppBinding.spec.appRef(the real KubeDB object: apiGroup/kind/name/namespace).spec.archiver.addon.name(e.g.postgres-addon), falling back to the<kind>-addonconvention. Catalog versions are read unstructured, so no extra scheme is needed.logical-backup/logical-backup-restoreconstants.--encryption-secret-name/--encryption-secret-namespaceflags.<namespace>/<name>of the resolved target.Behaviour on errors
NotFound→ hard fail, rather than papering over a real misconfiguration.Fields still needing operator attention (
directory,encryptionSecretwhen flags omitted,snapshot) get a review YAML line-comment.Scope
BackupBlueprintkeep their existing behaviour.Notes
kmodules.xyz/custom-resourcesmoves from indirect to direct in go.mod (already vendored).