Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for ParseTaints (0.55 sec)

  1. pkg/util/taints/taints.go

    	}
    
    	return nil
    }
    
    // ParseTaints takes a spec which is an array and creates slices for new taints to be added, taints to be deleted.
    // It also validates the spec. For example, the form `<key>` may be used to remove a taint, but not to add one.
    func ParseTaints(spec []string) ([]v1.Taint, []v1.Taint, error) {
    	var taints, taintsToRemove []v1.Taint
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Sep 16 09:23:35 UTC 2022
    - 8.4K bytes
    - Viewed (0)
  2. pkg/util/flag/flags.go

    }
    
    // Set sets the flag value
    func (t RegisterWithTaintsVar) Set(s string) error {
    	if len(s) == 0 {
    		*t.Value = nil
    		return nil
    	}
    	sts := strings.Split(s, ",")
    	corev1Taints, _, err := utiltaints.ParseTaints(sts)
    	if err != nil {
    		return err
    	}
    	var taints []v1.Taint
    	for _, ct := range corev1Taints {
    		taints = append(taints, v1.Taint{Key: ct.Key, Value: ct.Value, Effect: ct.Effect})
    	}
    	*t.Value = taints
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jul 19 03:30:46 UTC 2022
    - 7.8K bytes
    - Viewed (0)
  3. pkg/util/taints/taints_test.go

    				{
    					Key:    "baz",
    					Value:  "",
    					Effect: v1.TaintEffectNoSchedule,
    				},
    			},
    			expectedErr: false,
    		},
    	}
    
    	for _, c := range cases {
    		taints, taintsToRemove, err := ParseTaints(c.spec)
    		if c.expectedErr && err == nil {
    			t.Errorf("[%s] expected error for spec %s, but got nothing", c.name, c.spec)
    		}
    		if !c.expectedErr && err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Sep 16 09:23:35 UTC 2022
    - 22.6K bytes
    - Viewed (0)
Back to top