feat: pass ssl cert environment variables to cli#55
Closed
Conversation
Pass SSL_CERT_DIR and SSL_CERT_FILE env variables from main process to child cli processes. Signed-off-by: Tomas Turek <tturek@redhat.com>
Reviewer's GuideCommands now include SSL_CERT_DIR and SSL_CERT_FILE from the parent process when spawning child CLI subprocesses in both Command and CommandOutput methods. Sequence diagram for passing SSL cert environment variables to CLI subprocessessequenceDiagram
participant ParentProcess as Parent Process
participant CLI as cli.Command/cli.CommandOutput
participant Subprocess as CLI Subprocess
ParentProcess->>CLI: Call Command/CommandOutput(...)
CLI->>ParentProcess: Read SSL_CERT_DIR and SSL_CERT_FILE from environment
CLI->>Subprocess: Start subprocess with SSL_CERT_DIR and SSL_CERT_FILE in env
Subprocess-->>CLI: Execute CLI logic with provided env
CLI-->>ParentProcess: Return result/output
Class diagram for updated cli methods handling environment variablesclassDiagram
class cli {
+Command(ctx, args)
+CommandOutput(ctx, args)
}
cli : +Command now sets cmd.Env with SSL_CERT_DIR and SSL_CERT_FILE if present
cli : +CommandOutput now sets cmd.Env with SSL_CERT_DIR and SSL_CERT_FILE if present
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
kdacosta0
requested changes
Jul 15, 2025
Member
kdacosta0
left a comment
There was a problem hiding this comment.
Setting cmd.Env wipes the entire environment, including (PATH, etc.), which will cause the command to fail. I believe you need to append to the current environment instead of replacing it.
cmd.Env = append(cmd.Env, "SSL_CERT_DIR="+val)
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.
Pass SSL_CERT_DIR and SSL_CERT_FILE env variables from main process to child cli processes.
Summary by Sourcery
New Features: