Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for patchNodeWithAnnotation (0.17 sec)

  1. pkg/controller/ttl/ttl_controller.go

    	if node.Annotations == nil {
    		node.Annotations = make(map[string]string)
    	}
    	node.Annotations[annotationKey] = strconv.Itoa(value)
    }
    
    func (ttlc *Controller) patchNodeWithAnnotation(ctx context.Context, node *v1.Node, annotationKey string, value int) error {
    	oldData, err := json.Marshal(node)
    	if err != nil {
    		return err
    	}
    	setIntAnnotation(node, annotationKey, value)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat May 04 18:33:12 UTC 2024
    - 8.5K bytes
    - Viewed (0)
  2. pkg/controller/ttl/ttl_controller_test.go

    			patch:      "{}",
    		},
    	}
    
    	for i, testCase := range testCases {
    		fakeClient := &fake.Clientset{}
    		ttlController := &Controller{
    			kubeClient: fakeClient,
    		}
    		err := ttlController.patchNodeWithAnnotation(context.TODO(), testCase.node, v1.ObjectTTLAnnotationKey, testCase.ttlSeconds)
    		if err != nil {
    			t.Errorf("%d: unexpected error: %v", i, err)
    			continue
    		}
    		actions := fakeClient.Actions()
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat May 04 18:33:12 UTC 2024
    - 7.1K bytes
    - Viewed (0)
Back to top