github.com/metaprov/modela-operator@v0.0.0-20240118193048-f378be8b74d2/pkg/kube/filters_test.go (about)

     1  package kube
     2  
     3  import (
     4  	"fmt"
     5  	. "github.com/onsi/ginkgo"
     6  	. "github.com/onsi/gomega"
     7  	"sigs.k8s.io/kustomize/kyaml/kio"
     8  )
     9  
    10  var _ = Describe("Resource filter", func() {
    11  	It("Should add a controller reference", func() {
    12  		yaml, _, err := LoadResources("../../manifests/modela-system", []kio.Filter{
    13  			OwnerReferenceFilter{
    14  				Owner: "modela",
    15  				UID:   "abc-123",
    16  			},
    17  		}, true)
    18  		Expect(err).To(BeNil())
    19  		fmt.Println(string(yaml))
    20  	})
    21  	It("Should add minio secret and access keys", func() {
    22  		yaml, _, err := LoadResources("../../manifests/tenant", []kio.Filter{
    23  			MinioSecretFilter{
    24  				AccessKey: "test123",
    25  				SecretKey: "testabc",
    26  			},
    27  		}, true)
    28  		Expect(err).To(BeNil())
    29  		fmt.Println(string(yaml))
    30  	})
    31  	It("Should change default tenant objects", func() {
    32  		yaml, _, err := LoadResources("../../manifests/tenant", []kio.Filter{
    33  			TenantFilter{TenantName: "test-tenant"},
    34  		}, true)
    35  		Expect(err).To(BeNil())
    36  		fmt.Println(string(yaml))
    37  	})
    38  })