Repository navigation
Fix panic in manifest diff when env value is not a map - #3904
Open
jochenehret wants to merge 1 commit into
Open
jochenehret wants to merge 1 commit into
jochenehret wants to merge 1 commit into
Conversation
CAPI 1.253.0 (cloud_controller_ng PR #5712) redacts sensitive manifest
values server-side, sending the env map in the manifest diff as the
string "[PRIVATE DATA HIDDEN]". redactDiff assumed any diff whose path
ends in "env" carried a map and asserted diff.Value.(map[string]interface{})
unconditionally, so `cf push --redact-env` crashed with "interface
conversion: interface {} is string, not map[string]interface {}".
Use comma-ok assertions in redactDiff and redactEnvVarsInRawManifest and
redact the value directly when it is not a map. Adds regression tests for
both paths.
cloudfoundry/cloud_controller_ng#5712
This branch has not been deployed
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.
This PR has been created with Claude Code.
Description of the Change
Caused by cloudfoundry/cloud_controller_ng#5712
redactDiff and redactEnvVarsInRawManifest asserted env values to be maps unconditionally, crashing with "interface conversion: interface {} is string, not map[string]interface {}" on
cf push --redact-envwhen a diff path ending in "env" (or a raw manifest's env key) carried a non-map value. Use comma-ok assertions and redact the value directly in that case. Adds regression tests for both paths.Why Is This PR Valuable?
Fixes possible go panics when pushing with
--redact-env.Applicable Issues
How Urgent Is The Change?
Issue blocks the cf-deployment validation:
https://concourse.wg-ard.ci.cloudfoundry.org/teams/main/pipelines/cf-deployment/jobs/fresh-deploy/builds/2490
But we'll apply a workaround for now.