Skip to content

Commit

Permalink
wip - TestOutput*
Browse files Browse the repository at this point in the history
  • Loading branch information
aabouzaid committed Sep 18, 2023
1 parent c0388c1 commit 13e9ea5
Show file tree
Hide file tree
Showing 3 changed files with 337 additions and 14 deletions.
1 change: 1 addition & 0 deletions .github/workflows/go-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3
with:
version: v1.54
args: '--timeout=5m'
- name: Run Go test coverage
run: go test -race -coverprofile=coverage.out -covermode=atomic ./...
- name: Upload coverage to Codecov
Expand Down
10 changes: 8 additions & 2 deletions pkg/merger/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,26 +82,32 @@ func (r *mergerResource) export() []*yaml.RNode {
}

case ConfigMap:
rNode, _ := yaml.FromMap(map[string]interface{}{
rNode, err := yaml.FromMap(map[string]interface{}{
"apiVersion": "v1",
"kind": "ConfigMap",
"metadata": map[string]string{
"name": r.Name,
},
})
if err != nil {
log.Fatalf("Error creating ConfigMap: %v", err)
}
if err := rNode.LoadMapIntoConfigMapData(r.Output.items); err != nil {
log.Fatalf("Error creating ConfigMap data: %v", err)
}
rlItems = append(rlItems, rNode)

case Secret:
rNode, _ := yaml.FromMap(map[string]interface{}{
rNode, err := yaml.FromMap(map[string]interface{}{
"apiVersion": "v1",
"kind": "Secret",
"metadata": map[string]string{
"name": r.Name,
},
})
if err != nil {
log.Fatalf("Error creating Secret: %v", err)
}
if err := rNode.LoadMapIntoSecretData(r.Output.items); err != nil {
log.Fatalf("Error creating Secret data: %v", err)
}
Expand Down
Loading

0 comments on commit 13e9ea5

Please sign in to comment.