• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kubernetes-sigs / sig-storage-local-static-provisioner / 16065277026

04 Jul 2025 03:37AM UTC coverage: 50.79% (-0.4%) from 51.195%
16065277026

push

github

web-flow
Merge pull request #501 from saidjawad/support_for_karpenter_start_up_taint

Support for removing start up taint

32 of 90 new or added lines in 4 files covered. (35.56%)

1 existing line in 1 file now uncovered.

996 of 1961 relevant lines covered (50.79%)

6.79 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/pkg/util/node_util.go
1
/*
2
Copyright 2025 The Kubernetes Authors.
3

4
Licensed under the Apache License, Version 2.0 (the "License");
5
you may not use this file except in compliance with the License.
6
You may obtain a copy of the License at
7

8
    http://www.apache.org/licenses/LICENSE-2.0
9

10
Unless required by applicable law or agreed to in writing, software
11
distributed under the License is distributed on an "AS IS" BASIS,
12
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
See the License for the specific language governing permissions and
14
limitations under the License.
15
*/
16

17
package util
18

19
import (
20
        "context"
21
        "time"
22

23
        v1 "k8s.io/api/core/v1"
24
        metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
25
        corev1 "k8s.io/client-go/kubernetes/typed/core/v1"
26
        "k8s.io/klog/v2"
27
)
28

29
const maxGetNodesRetries = 3
30

31
// GetNode returns the node with the given name.
NEW
32
func GetNode(client corev1.CoreV1Interface, name string) *v1.Node {
×
NEW
33
        var retries int
×
NEW
34

×
NEW
35
        for {
×
NEW
36
                node, err := client.Nodes().Get(context.TODO(), name, metav1.GetOptions{})
×
NEW
37
                if err == nil {
×
NEW
38
                        return node
×
NEW
39
                }
×
40

NEW
41
                retries++
×
NEW
42
                klog.Infof("Could not get node information (remaining retries: %d): %v", maxGetNodesRetries-retries, err)
×
NEW
43

×
NEW
44
                if retries >= maxGetNodesRetries {
×
NEW
45
                        klog.Fatalf("Could not get node information: %v", err)
×
NEW
46
                }
×
NEW
47
                time.Sleep(time.Second)
×
48
        }
49
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc