Repository navigation
Harden resource-history debug output & make debug env var case-insensitive - #1137
Open
sameerforge wants to merge 4 commits into
Open
sameerforge wants to merge 4 commits into
sameerforge wants to merge 4 commits into
Conversation
- Compare KAPP_DEBUG_RESOURCE_WITH_HISTORY case-insensitively - Debug output no longer prints resource diffs, which can contain secret values; only the resource description and MD5 hashes are printed - Drop the now-unused expected diff return value Signed-off-by: Sameer Khan <sameer.khan@broadcom.com>
aroradaman
approved these changes
Oct 6, 2026
aroradaman
left a comment
Member
There was a problem hiding this comment.
Dont' we need any test case change here?
- completion.go: Add powershell to supported shells list and capitalize "Unsupported shell type" error - profiling.go: Capitalize "Unknown profile" error message - namespace_flags.go: Fix grammar: "Expected namespace name to be non-empty" - rename.go: Fix awkward conjunction: "or" instead of "or/and" - resource_filter_flags.go: Use standard terminology: "a valid time.Duration" - app_filter_flags.go: Use standard terminology: "a valid time.Duration" - appchange/list.go: Capitalize "Unrecognized time format" - appchange/list.go: Clarify temporal ordering: "earlier than" instead of "less than" - labeled_resources.go: Fix plural form: "Disallowed label errors" These improvements enhance user experience and provide clearer error guidance. Signed-off-by: Sameer Khan <sameer.khan@broadcom.com>
Fixes a failure during the "Create Kind Cluster" step when testing against recent Kubernetes releases (v1.36+). The previous `helm/kind-action@v1` installed an older `kind` binary that generated `kubeadm.k8s.io/v1beta3` configurations, which are deprecated and rejected by newer `kubeadm` binaries requiring `v1beta4`. Changes made in test-gh.yml: - Moved `actions/checkout@v4` to the beginning of the workflow so that `actions/setup-go@v5` can locate `go.mod` via `go-version-file`. - Replaced `helm/kind-action` with `go install sigs.k8s.io/kind@latest` to dynamically build the latest release of `kind`. This ensures compatibility with newer Kubernetes versions without requiring manual action version updates. Signed-off-by: Sameer Khan <sameer.khan@broadcom.com>
sameerforge
force-pushed
the
topic/sameerkh/compliance-fixes
branch
from
October 6, 2026 09:12
5375295 to
f066c09
Compare
- Extract debugEnabled so the case-insensitive comparison of KAPP_DEBUG_RESOURCE_WITH_HISTORY can be tested directly - Cover completion for each supported shell, including powershell, and the unsupported shell error - Cover time parsing errors for app change list - Cover invalid age errors for app and resource filter flags - Cover the disallowed label error Signed-off-by: Sameer Khan <sameer.khan@broadcom.com>
sameerforge
force-pushed
the
topic/sameerkh/compliance-fixes
branch
from
October 6, 2026 09:14
f066c09 to
9c5a102
Compare
Author
Added tests for debug env var parsing and reworded error messages |
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
KAPP_DEBUG_RESOURCE_WITH_HISTORYdebug output no longer prints resource diffs, which can contain secret values. It now prints only the resource description and MD5 hashes.KAPP_DEBUG_RESOURCE_WITH_HISTORYis now case-insensitive, soTRUEandTrueenable debug mode.kapp completionhelp and errors now listpowershell.Commits
resource_with_history.goprints only hashes under the debug flag. The flag is compared withstrings.ToLower.recalculateLastAppliedChangeno longer returns the unused diff string.completion.go: lists powershell, andUnsupported shell typeis now capitalizedprofiling.go:Unknown profilenamespace_flags.go:Expected namespace name to be non-emptyrename.go:or/andbecomesorapp_filter_flags.goandresource_filter_flags.go:parseablebecomesa valid time.Durationappchange/list.go:Unrecognized time format, andearlier thanreplacesless thanlabeled_resources.go:Disallowed label errorsdebugEnabledhelper so it can be tested.Notes
--debugflag are unchanged.earlier thanmessage inlist.go(needs a cluster) and the debug output omitting diffs.Testing
golangci-lint run: 0 issuesgo build ./...andgo test ./pkg/...: pass