Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for SetNestedStringMap (0.14 sec)

  1. staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/helpers_test.go

    }
    
    func TestSetNestedStringMap(t *testing.T) {
    	obj := map[string]interface{}{
    		"x": map[string]interface{}{
    			"y": 1,
    			"a": "foo",
    		},
    	}
    
    	err := SetNestedStringMap(obj, map[string]string{"b": "bar"}, "x", "z")
    	assert.NoError(t, err)
    	assert.Len(t, obj["x"], 3)
    	assert.Len(t, obj["x"].(map[string]interface{})["z"], 1)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Nov 24 07:53:28 UTC 2021
    - 5.9K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/helpers.go

    	return SetNestedField(obj, value, fields...)
    }
    
    // SetNestedStringMap sets the map[string]string value of a nested field.
    // Returns an error if value cannot be set because one of the nesting levels is not a map[string]interface{}.
    func SetNestedStringMap(obj map[string]interface{}, value map[string]string, fields ...string) error {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Jun 29 20:39:55 UTC 2023
    - 16.3K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured/unstructured.go

    	}
    	SetNestedSlice(u.Object, value, fields...)
    }
    
    func (u *Unstructured) setNestedMap(value map[string]string, fields ...string) {
    	if u.Object == nil {
    		u.Object = make(map[string]interface{})
    	}
    	SetNestedStringMap(u.Object, value, fields...)
    }
    
    func (u *Unstructured) GetOwnerReferences() []metav1.OwnerReference {
    	field, found, err := NestedFieldNoCopy(u.Object, "metadata", "ownerReferences")
    	if !found || err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sun May 28 03:26:35 UTC 2023
    - 13.7K bytes
    - Viewed (0)
Back to top