Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for getLabelValue (0.11 sec)

  1. pilot/pkg/serviceregistry/kube/controller/util_test.go

    			"beta-region",
    		},
    		{
    			"No label defined at all",
    			&v1.Node{},
    			"",
    		},
    	}
    
    	for _, test := range tests {
    		t.Run(test.name, func(t *testing.T) {
    			got := getLabelValue(test.node.ObjectMeta, NodeRegionLabel, NodeRegionLabelGA)
    			if test.expectedLabelValue != got {
    				t.Errorf("Expected %v, but got %v", test.expectedLabelValue, got)
    			}
    		})
    	}
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Jun 21 20:45:12 UTC 2023
    - 5K bytes
    - Viewed (0)
  2. pilot/pkg/serviceregistry/kube/controller/util.go

    	"istio.io/api/annotation"
    	"istio.io/istio/pilot/pkg/model"
    	"istio.io/istio/pkg/config"
    	"istio.io/istio/pkg/config/constants"
    	"istio.io/istio/pkg/config/host"
    	"istio.io/istio/pkg/config/labels"
    )
    
    func getLabelValue(metadata metav1.ObjectMeta, label string, fallBackLabel string) string {
    	metaLabels := metadata.GetLabels()
    	val := metaLabels[label]
    	if val != "" {
    		return val
    	}
    
    	return metaLabels[fallBackLabel]
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Jul 28 02:01:47 UTC 2023
    - 6.1K bytes
    - Viewed (0)
  3. pilot/pkg/serviceregistry/kube/controller/controller.go

    			log.Warnf("unable to get node %q for pod %q/%q", pod.Spec.NodeName, pod.Namespace, pod.Name)
    		}
    		return ""
    	}
    
    	region := getLabelValue(node.ObjectMeta, NodeRegionLabelGA, NodeRegionLabel)
    	zone := getLabelValue(node.ObjectMeta, NodeZoneLabelGA, NodeZoneLabel)
    	subzone := getLabelValue(node.ObjectMeta, label.TopologySubzone.Name, "")
    
    	if region == "" && zone == "" && subzone == "" {
    		return ""
    	}
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu May 23 21:07:03 UTC 2024
    - 41.2K bytes
    - Viewed (0)
Back to top