diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml index 0a10953..3b9f77f 100644 --- a/.github/workflows/build-test.yaml +++ b/.github/workflows/build-test.yaml @@ -35,7 +35,7 @@ jobs: go-version-file: 'go.mod' - name: Lint - uses: golangci/golangci-lint-action@v5 + uses: golangci/golangci-lint-action@v6 with: version: v1.58.0 args: --timeout=5m --config=.golangci.yml diff --git a/pkg/transformer/transformer.go b/pkg/transformer/transformer.go index 39960ac..7f6071e 100644 --- a/pkg/transformer/transformer.go +++ b/pkg/transformer/transformer.go @@ -44,15 +44,15 @@ var prohibitedPlatformMetadataKeys = []string{"hostname", "platform"} // //nolint:gocyclo,cyclop func TransformNode(terms []NodeTerm, platformMetadata *runtime.PlatformMetadataSpec) (*NodeSpec, error) { - if len(terms) == 0 { - return nil, nil - } - node := &NodeSpec{ Annotations: make(map[string]string), Labels: make(map[string]string), } + if len(terms) == 0 { + return node, nil + } + metadata := metadataFromStruct(platformMetadata) for _, term := range terms { diff --git a/pkg/transformer/transformer_test.go b/pkg/transformer/transformer_test.go index 9f8953f..e77ece1 100644 --- a/pkg/transformer/transformer_test.go +++ b/pkg/transformer/transformer_test.go @@ -26,6 +26,10 @@ func TestMatch(t *testing.T) { Platform: "test-platform", Hostname: "test-hostname", }, + expected: &transformer.NodeSpec{ + Annotations: map[string]string{}, + Labels: map[string]string{}, + }, }, { name: "Transform labels",