Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(helm): werf-helm-* commands now fully support --post-renderer param
Chain werfs extra-annotations-and-labels-post-renderer with user specified post-renderer. Refs werf/3p-helm#108
- Loading branch information
1 parent
077cd28
commit eb8208e
Showing
12 changed files
with
117 additions
and
71 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package helm | ||
|
||
import ( | ||
"bytes" | ||
|
||
"helm.sh/helm/v3/pkg/postrender" | ||
) | ||
|
||
type PostRendererChain struct { | ||
PostRenderers []postrender.PostRenderer | ||
} | ||
|
||
func NewPostRendererChain(postRenderers ...postrender.PostRenderer) *PostRendererChain { | ||
return &PostRendererChain{ | ||
PostRenderers: postRenderers, | ||
} | ||
} | ||
|
||
func (chain *PostRendererChain) Run(renderedManifests *bytes.Buffer) (*bytes.Buffer, error) { | ||
newManifests := renderedManifests | ||
|
||
for _, pr := range chain.PostRenderers { | ||
manifests, err := pr.Run(newManifests) | ||
if err != nil { | ||
return manifests, err | ||
} | ||
newManifests = manifests | ||
} | ||
|
||
return newManifests, nil | ||
} |