Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for NewFullName (0.3 sec)

  1. pkg/config/resource/name_test.go

    func TestFullNameString(t *testing.T) {
    	n := NewFullName("ns1", "l1")
    	if n.String() != "ns1/l1" {
    		t.Fatalf("unexpected name string: %v", n.String())
    	}
    }
    
    func TestFullNameString_NoName(t *testing.T) {
    	n := NewFullName("ns1", "")
    	if n.String() != "ns1/" {
    		t.Fatalf("unexpected name string: %v", n.String())
    	}
    }
    
    func TestFullNameString_NoNamespace(t *testing.T) {
    	n := NewFullName("", "l1")
    	if n.String() != "l1" {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri May 29 20:42:01 UTC 2020
    - 3.1K bytes
    - Viewed (0)
  2. pkg/config/analysis/analyzers/util/hosts_test.go

    	g.Expect(GetResourceNameFromHost("default", "foo.default.svc.cluster.local")).To(Equal(resource.NewFullName("default", "foo")))
    	// FQDN, cross namespace
    	g.Expect(GetResourceNameFromHost("default", "foo.other.svc.cluster.local")).To(Equal(resource.NewFullName("other", "foo")))
    	// short name
    	g.Expect(GetResourceNameFromHost("default", "foo")).To(Equal(resource.NewFullName("default", "foo")))
    	// bogus FQDN (gets treated like a short name)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Oct 31 14:48:28 UTC 2023
    - 4.4K bytes
    - Viewed (0)
  3. pkg/config/resource/metadata_test.go

    func TestMetadata_Clone_NilMaps(t *testing.T) {
    	g := NewWithT(t)
    
    	m := Metadata{
    		FullName: NewFullName("ns1", "rs1"),
    		Version:  Version("v1"),
    	}
    
    	c := m.Clone()
    	g.Expect(m).To(Equal(c))
    }
    
    func TestMetadata_Clone_NonNilMaps(t *testing.T) {
    	g := NewWithT(t)
    
    	m := Metadata{
    		FullName:    NewFullName("ns1", "rs1"),
    		Version:     Version("v1"),
    		Annotations: map[string]string{"foo": "bar"},
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Oct 31 14:48:28 UTC 2023
    - 1.1K bytes
    - Viewed (0)
  4. pkg/config/resource/name.go

    func (n FullName) Validate() error {
    	if len(n.Name) == 0 {
    		return fmt.Errorf("invalid name '%s': name must not be empty", n.String())
    	}
    	return nil
    }
    
    // NewFullName creates a new FullName from the given Namespace and Name.
    func NewFullName(ns Namespace, n LocalName) FullName {
    	return FullName{
    		Namespace: ns,
    		Name:      n,
    	}
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Sep 14 13:55:49 UTC 2023
    - 2.6K bytes
    - Viewed (0)
  5. pkg/config/analysis/local/helpers_test.go

    	ClusterScoped: false,
    	ValidateProto: validation.EmptyValidate,
    }.MustBuild()
    
    func createTestResource(t *testing.T, ns, name, version string) *resource.Instance {
    	t.Helper()
    	rname := resource.NewFullName(resource.Namespace(ns), resource.LocalName(name))
    	return &resource.Instance{
    		Metadata: resource.Metadata{
    			FullName: rname,
    			Version:  resource.Version(version),
    		},
    		Message: &emptypb.Empty{},
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Feb 02 17:36:47 UTC 2024
    - 1.7K bytes
    - Viewed (0)
  6. pkg/config/analysis/analyzers/webhook/webhook.go

    		return
    	}
    	for name, whs := range webhooks {
    		for _, wh := range whs {
    			if wh.ClientConfig.Service == nil {
    				// it is an url, skip it
    				continue
    			}
    			fname := resource.NewFullName(
    				resource.Namespace(wh.ClientConfig.Service.Namespace),
    				resource.LocalName(wh.ClientConfig.Service.Name))
    			if !context.Exists(gvk.Service, fname) {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Sun May 05 03:44:57 UTC 2024
    - 6K bytes
    - Viewed (0)
  7. pkg/config/analysis/analyzers/analyzers_bench_test.go

    	// Generate blank test data
    	store := memory.MakeSkipValidation(collections.All)
    	collections.All.ForEach(func(s resource2.Schema) bool {
    		for i := 0; i < count; i++ {
    			name := resource.NewFullName("default", resource.LocalName(fmt.Sprintf("%s-%d", s.Kind(), i)))
    			_, _ = store.Create(config.Config{
    				Meta: config.Meta{
    					GroupVersionKind: s.GroupVersionKind(),
    					Name:             name.Name.String(),
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Apr 02 08:32:06 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  8. pkg/config/analysis/analyzers/schema/validation_test.go

    		return nil, nil
    	})
    	ctx := &fixtures.Context{
    		Resources: []*resource.Instance{
    			{
    				Message: &v1alpha3.VirtualService{},
    				Metadata: resource.Metadata{
    					FullName: resource.NewFullName("ns", "name"),
    				},
    				Origin: fakeOrigin{},
    			},
    		},
    	}
    	a := ValidationAnalyzer{s: testSchema}
    	a.Analyze(ctx)
    }
    
    func TestSchemaValidationWrapper(t *testing.T) {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Apr 02 08:32:06 UTC 2024
    - 4.5K bytes
    - Viewed (0)
  9. pkg/config/analysis/analyzers/injection/image-auto.go

    		}
    	}
    	return false
    }
    
    func getNamespaceLabels(c analysis.Context, nsName string) map[string]string {
    	if nsName == "" {
    		nsName = "default"
    	}
    	ns := c.Find(gvk.Namespace, resource.NewFullName("", resource.LocalName(nsName)))
    	if ns == nil {
    		return nil
    	}
    	return ns.Metadata.Labels
    }
    
    func matchesWebhooks(nsLabels, podLabels map[string]string, istioWebhooks []admitv1.MutatingWebhook) bool {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Mar 01 01:34:15 UTC 2023
    - 4K bytes
    - Viewed (0)
  10. pkg/config/analysis/analyzers/util/in_mesh.go

    func getNamesSidecarInjectionStatus(ns resource.Namespace, c analysis.Context) (enabled bool, ok bool) {
    	enabled, ok = false, false
    
    	namespace := c.Find(gvk.Namespace, resource.NewFullName("", resource.LocalName(ns)))
    	if namespace != nil {
    		enabled, ok = namespace.Metadata.Labels[InjectionLabelName] == InjectionLabelEnableValue, true
    	}
    
    	return enabled, ok
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu May 02 21:29:40 UTC 2024
    - 4.3K bytes
    - Viewed (0)
Back to top