mirror of https://github.com/k3s-io/k3s
Merge pull request #1974 from mschneider82/patch-1
fixed panic in network_policy_controllerpull/1914/head
commit
0d6a2bfb0b
|
@ -1693,7 +1693,11 @@ func NewNetworkPolicyController(
|
|||
npc.syncPeriod = ipTablesSyncPeriod
|
||||
|
||||
npc.v1NetworkPolicy = true
|
||||
v, _ := clientset.Discovery().ServerVersion()
|
||||
v, err := clientset.Discovery().ServerVersion()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
valid := regexp.MustCompile("[0-9]")
|
||||
v.Minor = strings.Join(valid.FindAllString(v.Minor, -1), "")
|
||||
minorVer, _ := strconv.Atoi(v.Minor)
|
||||
|
|
Loading…
Reference in New Issue