Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 177 for IntPtr (0.14 sec)

  1. staging/src/k8s.io/apimachinery/pkg/util/intstr/intstr.go

    func (intstr *IntOrString) UnmarshalJSON(value []byte) error {
    	if value[0] == '"' {
    		intstr.Type = String
    		return json.Unmarshal(value, &intstr.StrVal)
    	}
    	intstr.Type = Int
    	return json.Unmarshal(value, &intstr.IntVal)
    }
    
    func (intstr *IntOrString) UnmarshalCBOR(value []byte) error {
    	if err := cbor.Unmarshal(value, &intstr.StrVal); err == nil {
    		intstr.Type = String
    		return nil
    	}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 29 21:48:09 UTC 2024
    - 7.8K bytes
    - Viewed (0)
  2. pkg/controller/deployment/rolling_test.go

    	"testing"
    
    	apps "k8s.io/api/apps/v1"
    	"k8s.io/apimachinery/pkg/util/intstr"
    	"k8s.io/client-go/kubernetes/fake"
    	core "k8s.io/client-go/testing"
    	"k8s.io/client-go/tools/record"
    	"k8s.io/klog/v2/ktesting"
    )
    
    func TestDeploymentController_reconcileNewReplicaSet(t *testing.T) {
    	tests := []struct {
    		deploymentReplicas  int32
    		maxSurge            intstr.IntOrString
    		oldReplicas         int32
    		newReplicas         int32
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Sep 08 09:10:50 UTC 2023
    - 11K bytes
    - Viewed (0)
  3. pkg/apis/policy/validation/validation_test.go

    	}
    }
    
    func TestValidateMinAvailablePodDisruptionBudgetSpec(t *testing.T) {
    	successCases := []intstr.IntOrString{
    		intstr.FromString("0%"),
    		intstr.FromString("1%"),
    		intstr.FromString("100%"),
    		intstr.FromInt32(0),
    		intstr.FromInt32(1),
    		intstr.FromInt32(100),
    	}
    	for _, c := range successCases {
    		spec := policy.PodDisruptionBudgetSpec{
    			MinAvailable: &c,
    		}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Aug 07 20:44:13 UTC 2023
    - 9.1K bytes
    - Viewed (0)
  4. pkg/probe/util_test.go

    }
    
    func TestResolveContainerPort(t *testing.T) {
    	t.Parallel()
    	type args struct {
    		param     intstr.IntOrString
    		container *v1.Container
    	}
    	tests := []struct {
    		name    string
    		args    args
    		want    int
    		wantErr bool
    	}{
    		{
    			name: "get port by int type",
    			args: args{
    				param:     intstr.IntOrString{Type: 0, IntVal: 443},
    				container: &v1.Container{},
    			},
    			want:    443,
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Mar 10 06:14:41 UTC 2023
    - 3.9K bytes
    - Viewed (0)
  5. pkg/kube/apimirror/probe.go

    // UnmarshalJSON implements the json.Unmarshaller interface.
    func (intstr *IntOrString) UnmarshalJSON(value []byte) error {
    	if value[0] == '"' {
    		intstr.Type = String
    		return json.Unmarshal(value, &intstr.StrVal)
    	}
    	intstr.Type = Int
    	return json.Unmarshal(value, &intstr.IntVal)
    }
    
    // MarshalJSON implements the json.Marshaller interface.
    func (intstr IntOrString) MarshalJSON() ([]byte, error) {
    	switch intstr.Type {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu May 23 15:07:03 UTC 2024
    - 4.4K bytes
    - Viewed (0)
  6. pkg/controlplane/controller/kubernetesservice/controller_test.go

    				{Name: "baz", Port: 1000, Protocol: "TCP", TargetPort: intstr.FromInt32(1000)},
    			},
    			serviceType: corev1.ServiceTypeClusterIP,
    			service: &corev1.Service{
    				ObjectMeta: om("foo"),
    				Spec: corev1.ServiceSpec{
    					Ports: []corev1.ServicePort{
    						{Name: "foo", Port: 8080, Protocol: "TCP", TargetPort: intstr.FromInt32(8080)},
    					},
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Jul 13 10:41:06 UTC 2023
    - 15.3K bytes
    - Viewed (0)
  7. pkg/kubelet/lifecycle/handlers_test.go

    	tests := []struct {
    		Name        string
    		Port        intstr.IntOrString
    		ExpectError bool
    		Expected    string
    	}{
    		{
    			Name:     "consistent/with port",
    			Port:     intstr.FromString("70"),
    			Expected: "https://foo:70/bar",
    		}, {
    			Name:        "consistent/without port",
    			Port:        intstr.FromString(""),
    			ExpectError: true,
    		},
    	}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 24.4K bytes
    - Viewed (0)
  8. pkg/controller/daemon/update_test.go

    	ds.Spec.Template.Spec.Containers[0].Image = "foo2/bar2"
    	ds.Spec.UpdateStrategy.Type = apps.RollingUpdateDaemonSetStrategyType
    	intStr := intstr.FromInt32(int32(maxUnavailable))
    	ds.Spec.UpdateStrategy.RollingUpdate = &apps.RollingUpdateDaemonSet{MaxUnavailable: &intStr}
    	manager.dsStore.Update(ds)
    
    	clearExpectations(t, manager, ds, podControl)
    	expectSyncDaemonSets(t, manager, ds, podControl, 0, maxUnavailable, 0)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Feb 10 21:10:35 UTC 2024
    - 28.9K bytes
    - Viewed (0)
  9. staging/src/k8s.io/apiserver/pkg/util/proxy/proxy_test.go

    	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    	"k8s.io/apimachinery/pkg/util/intstr"
    	v1listers "k8s.io/client-go/listers/core/v1"
    	"k8s.io/client-go/tools/cache"
    )
    
    func TestResolve(t *testing.T) {
    	matchingEndpoints := func(svc *v1.Service) []*v1.Endpoints {
    		ports := []v1.EndpointPort{}
    		for _, p := range svc.Spec.Ports {
    			if p.TargetPort.Type != intstr.Int {
    				continue
    			}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon May 01 07:16:27 UTC 2023
    - 8.6K bytes
    - Viewed (0)
  10. pkg/probe/util.go

    package probe
    
    import (
    	"fmt"
    	"strconv"
    
    	v1 "k8s.io/api/core/v1"
    	"k8s.io/apimachinery/pkg/util/intstr"
    )
    
    func ResolveContainerPort(param intstr.IntOrString, container *v1.Container) (int, error) {
    	port := -1
    	var err error
    	switch param.Type {
    	case intstr.Int:
    		port = param.IntValue()
    	case intstr.String:
    		if port, err = findPortByName(container, param.StrVal); err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Oct 19 16:51:52 UTC 2022
    - 1.6K bytes
    - Viewed (0)
Back to top