...

Source file src/sigs.k8s.io/kustomize/api/krusty/directoryarrangement_test.go

Documentation: sigs.k8s.io/kustomize/api/krusty

     1  // Copyright 2019 The Kubernetes Authors.
     2  // SPDX-License-Identifier: Apache-2.0
     3  
     4  package krusty_test
     5  
     6  import (
     7  	"testing"
     8  
     9  	kusttest_test "sigs.k8s.io/kustomize/api/testutils/kusttest"
    10  )
    11  
    12  const expectedResources = `apiVersion: v1
    13  kind: Service
    14  metadata:
    15    name: myService
    16  spec:
    17    ports:
    18    - port: 7002
    19  `
    20  
    21  func TestIssue596AllowDirectoriesThatAreSubstringsOfEachOther(t *testing.T) {
    22  	th := kusttest_test.MakeHarness(t)
    23  	th.WriteF("base/service.yaml", expectedResources)
    24  	th.WriteK("base", `resources:
    25  - service.yaml`)
    26  	th.WriteK("overlays/aws", `
    27  resources:
    28  - ../../base
    29  `)
    30  	th.WriteK("overlays/aws-nonprod", `
    31  resources:
    32  - ../aws
    33  `)
    34  	th.WriteK("overlays/aws-sandbox2.us-east-1", `
    35  resources:
    36  - ../aws-nonprod
    37  `)
    38  	m := th.Run("overlays/aws-sandbox2.us-east-1", th.MakeDefaultOptions())
    39  	th.AssertActualEqualsExpected(m, expectedResources)
    40  }
    41  

View as plain text