fix(util): correct logging for synth #1634
Open
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.
FYI - This is my first OSS contribution. I'm open to any feedback or input!
Summary of Changes
The console logs generated during
cdk8s synth
gave the impression that synthesis had failed when it actually succeeded, leading to unnecessary confusion. This change updates that log to a warning if theoutdir
doesn't exist, and also adds a "success" log if generated manifests are found. This isn't actually a problem becausesynth
in cdk8s-core always attempts to create the necessary directory.Current State
Without providing a CLI option for
outdir
and without specifying anoutdir
property in my config file, I defined my App like so:where
outdir
is defined in my IaC directly. I wanted to make a clear differentiation between TS output ("dist") andcdk8s
output (I chose "out").With this current state, here's what the console output looks like:
This "ERROR" message gives the false impression that manifest synthesis failed, when in reality, because I had specified a different
outdir
in my TS file, everything worked just fine.Proposed Change
My changes make it so that the console output reflects the following:
This accomplishes the following:
pathExists
check resulted in an exit)