Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for ApplyNamespace (0.11 sec)

  1. pkg/test/util/yml/apply.go

    	"istio.io/istio/pkg/test"
    	"istio.io/istio/pkg/test/util/tmpl"
    )
    
    // ApplyNamespace applies the given namespaces to the resources in the yamlText if not set.
    func ApplyNamespace(yamlText, ns string) (string, error) {
    	chunks := SplitString(yamlText)
    
    	toJoin := make([]string, 0, len(chunks))
    	for _, chunk := range chunks {
    		chunk, err := applyNamespace(chunk, ns)
    		if err != nil {
    			return "", err
    		}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Oct 17 07:02:38 UTC 2023
    - 3.8K bytes
    - Viewed (0)
  2. pkg/test/util/yml/apply_test.go

    metadata:
      name: foo
      namespace: default
    ---
    apiVersion: v1
    metadata:
      name: bar
      namespace: default`,
    		},
    	}
    	for _, tt := range cases {
    		t.Run(tt.name, func(t *testing.T) {
    			got, err := ApplyNamespace(tt.yml, tt.namespace)
    			if err != nil {
    				t.Fatal(err)
    			}
    			if got != tt.expected {
    				t.Fatalf("expected '%s', got '%s'", tt.expected, got)
    			}
    		})
    	}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon May 03 21:37:39 UTC 2021
    - 1.6K bytes
    - Viewed (0)
Back to top