Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for getPathContext (0.28 sec)

  1. operator/pkg/tpath/tree.go

    	pc, _, err := getPathContext(&PathContext{Node: root}, path, path, false)
    	if err != nil {
    		return false, err
    	}
    	return true, WritePathContext(pc, nil, false)
    }
    
    // getPathContext is the internal implementation of GetPathContext.
    // If createMissing is true, it creates any missing map (but NOT list) path entries in root.
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue May 23 17:08:31 UTC 2023
    - 17.5K bytes
    - Viewed (0)
  2. operator/pkg/tpath/tree_test.go

    				t.Fatal(err)
    			}
    			pc, gotFound, gotErr := GetPathContext(root, util.PathFromString(tt.path), false)
    			if gotErr, wantErr := errToString(gotErr), tt.wantErr; gotErr != wantErr {
    				t.Fatalf("GetPathContext(%s): gotErr:%s, wantErr:%s", tt.desc, gotErr, wantErr)
    			}
    			if gotFound != tt.wantFound {
    				t.Fatalf("GetPathContext(%s): gotFound:%v, wantFound:%v", tt.desc, gotFound, tt.wantFound)
    			}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Jul 25 19:30:47 UTC 2022
    - 15.6K bytes
    - Viewed (0)
  3. operator/pkg/tpath/util.go

    func GetConfigSubtree(manifest, path string) (string, error) {
    	root := make(map[string]any)
    	if err := yaml2.Unmarshal([]byte(manifest), &root); err != nil {
    		return "", err
    	}
    
    	nc, _, err := GetPathContext(root, util.PathFromString(path), false)
    	if err != nil {
    		return "", err
    	}
    	out, err := yaml2.Marshal(nc.Node)
    	if err != nil {
    		return "", err
    	}
    	return string(out), nil
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Jul 25 19:30:47 UTC 2022
    - 1.7K bytes
    - Viewed (0)
  4. operator/cmd/mesh/test-util_test.go

    }
    
    // Match implements the Matcher interface.
    func (m *HavePathValueEqualMatcher) Match(actual any) (bool, error) {
    	pv := m.expected.(PathValue)
    	node := actual.(map[string]any)
    	got, f, err := tpath.GetPathContext(node, util.PathFromString(pv.path), false)
    	if err != nil || !f {
    		return false, err
    	}
    	if reflect.TypeOf(got.Node) != reflect.TypeOf(pv.value) {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Oct 31 14:48:28 UTC 2023
    - 15.3K bytes
    - Viewed (0)
  5. operator/pkg/translate/translate_value.go

    		_, found, err := tpath.GetPathContext(valuesOverlay, util.ToYAMLPath(inPath), false)
    		if err != nil {
    			scope.Debug(err.Error())
    			continue
    		}
    		if found {
    			deprecatedFields = append(deprecatedFields, inPath)
    		}
    	}
    	for inPath := range t.GatewayKubernetesMapping.EgressMapping {
    		_, found, err := tpath.GetPathContext(valuesOverlay, util.ToYAMLPath(inPath), false)
    		if err != nil {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Feb 08 03:52:24 UTC 2024
    - 21.6K bytes
    - Viewed (0)
  6. operator/pkg/patch/patch.go

    		if strings.TrimSpace(p.Path) == "" {
    			scope.Warnf("value=%s has empty path, skip\n", v)
    			continue
    		}
    		scope.Debugf("applying path=%s, value=%s\n", p.Path, v)
    		inc, _, err := tpath.GetPathContext(bo, util.PathFromString(p.Path), true)
    		if err != nil {
    			errs = util.AppendErr(errs, err)
    			metrics.ManifestPatchErrorTotal.Increment()
    			continue
    		}
    
    		err = tpath.WritePathContext(inc, v, false)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Aug 10 15:35:03 UTC 2023
    - 6.2K bytes
    - Viewed (0)
  7. operator/pkg/object/objects.go

    func (o *K8sObject) Container(name string) map[string]any {
    	u := o.Unstructured()
    	path := fmt.Sprintf("spec.template.spec.containers.[name:%s]", name)
    	node, f, err := tpath.GetPathContext(u, util.PathFromString(path), false)
    	if err == nil && f {
    		// Must be the type from the schema.
    		return node.Node.(map[string]any)
    	}
    	return nil
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Sep 21 07:16:46 UTC 2023
    - 15.5K bytes
    - Viewed (0)
  8. operator/pkg/manifest/shared.go

    	if iop == nil {
    		iop = make(map[string]any)
    	}
    
    	for _, sf := range setFlags {
    		p, v := getPV(sf)
    		p = strings.TrimPrefix(p, "spec.")
    		inc, _, err := tpath.GetPathContext(iop, util.PathFromString("spec."+p), true)
    		if err != nil {
    			return "", err
    		}
    		// input value type is always string, transform it to correct type before setting.
    		var val any = v
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Apr 03 06:27:07 UTC 2024
    - 19.7K bytes
    - Viewed (0)
Back to top