Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Yuriy Losev <[email protected]>
  • Loading branch information
miklezzzz and yalosev committed Oct 22, 2024
1 parent c9e488b commit 38cd01e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 4 additions & 4 deletions pkg/helm/post_renderer/post_renderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ func (p *PostRenderer) Run(renderedManifests *bytes.Buffer) (modifiedManifests *
if err != nil {
return nil, fmt.Errorf("parse rendered manifests failed: %v", err)
}
for _, v := range nodes {
labels := v.GetLabels()
for _, node := range nodes {
labels := node.GetLabels()
if labels == nil {
labels = make(map[string]string)
labels = make(map[string]string, len(p.ExtraLabels))
}
for k, v := range p.ExtraLabels {
labels[k] = v
}
v.SetLabels(labels)
node.SetLabels(labels)
}

str, err := kio.StringAll(nodes)
Expand Down
4 changes: 0 additions & 4 deletions pkg/helm_resources_manager/test/mock/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ func (h *MockHelmResourcesManager) WithContext(_ context.Context) {}

func (h *MockHelmResourcesManager) WithKubeClient(_ *klient.Client) {}

func (h *MockHelmResourcesManager) WithCache(_ context.Context) error {
return nil
}

func (h *MockHelmResourcesManager) WithDefaultNamespace(_ string) {}

func (h *MockHelmResourcesManager) Stop() {}
Expand Down

0 comments on commit 38cd01e

Please sign in to comment.