Conversation
Signed-off-by: Jim Fitzpatrick <jfitzpat@redhat.com>
Some short demos show how to use the diff and get commands. Signed-off-by: Jim Fitzpatrick <jfitzpat@redhat.com>
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.
Summary
getanddiffcommands, including step-by-step guides and sample Kubernetes manifests for the diff demogetandsnapshotcommand config initialization to construct config structs inline instead of using separate mutable variables and conditional assignmentsDefaultDelay) intypes.zigsnapshot.zigwheredefer resource.deinit()was placed before an earlycontinuethat would skip the deinit on excluded resourcesdocs/from.gitignoreso demo documentation is tracked in version controlDetails
The refactor commit simplifies how CLI arguments are mapped to config structs. Previously,
get.zigdeclared several mutable local variables, conditionally assigned each from parsed args, then built the config struct from those locals. The new approach constructs theConfigstruct directly using inlineifexpressions on the parsed args, eliminating the intermediate variables. The same pattern is applied toSnapshotConfiginitialization insnapshot.zig, wheredelay,limit, andcountwere previously set via post-construction mutation.A subtle bug fix is included in
snapshot.zig: thedefer resource.deinit(gpa)was moved after the exclude check. Previously, when a resource matched an exclude pattern and hitcontinue, the explicitresource.deinit(gpa)in the exclude branch would free it, and then thedeferwould fire again at loop iteration end, causing a double-free. Moving thedeferafter the exclude check ensures it only activates for resources that proceed past the exclusion logic.The demo commit adds documentation with embedded asciinema recordings showing real usage of the tool against KinD clusters. The diff demo includes Kuadrant Kubernetes manifests (HTTPRoute, RateLimitPolicy, Kuadrant CR) and a kustomization file to demonstrate how
kubectlgetall diffreveals cluster changes.