mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/kube-vip/kube-vip.git
synced 2026-09-20 08:03:47 +08:00
path up other ci complaints.
Signed-off-by: Dan Finneran <dan@thebsdbox.co.uk>
This commit is contained in:
@@ -4,9 +4,17 @@ linters:
|
|||||||
- bodyclose
|
- bodyclose
|
||||||
- gosec
|
- gosec
|
||||||
- misspell
|
- misspell
|
||||||
- revive
|
|
||||||
- unconvert
|
- unconvert
|
||||||
- unparam
|
- unparam
|
||||||
|
settings:
|
||||||
|
misspell:
|
||||||
|
ignore-rules:
|
||||||
|
- creater
|
||||||
|
staticcheck:
|
||||||
|
checks:
|
||||||
|
- all
|
||||||
|
# Disable QF1008 to retain embedded fields for better readability.
|
||||||
|
- "-QF1008"
|
||||||
exclusions:
|
exclusions:
|
||||||
generated: lax
|
generated: lax
|
||||||
presets:
|
presets:
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ func main() {
|
|||||||
var errorOccurred bool
|
var errorOccurred bool
|
||||||
for {
|
for {
|
||||||
p := make([]byte, 2048)
|
p := make([]byte, 2048)
|
||||||
conn, err := net.Dial("udp", fmt.Sprintf("%s:%d", *address, *port))
|
conn, err := net.Dial("udp", net.JoinHostPort(*address, fmt.Sprint(port)))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if !errorOccurred {
|
if !errorOccurred {
|
||||||
errorTime = time.Now()
|
errorTime = time.Now()
|
||||||
|
|||||||
@@ -37,5 +37,5 @@ func FindIPAddress(addrName string) (string, string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return "", "", fmt.Errorf("Unknown interface [%s]", addrName)
|
return "", "", fmt.Errorf("unknown interface [%s]", addrName)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"log/slog"
|
|
||||||
log "log/slog"
|
log "log/slog"
|
||||||
|
|
||||||
"github.com/vishvananda/netlink"
|
"github.com/vishvananda/netlink"
|
||||||
@@ -369,19 +368,19 @@ func (i *Instance) startDHCP() error {
|
|||||||
// Check the rp_filter value
|
// Check the rp_filter value
|
||||||
rpFilter, err := strconv.Atoi(i.ServiceSnapshot.Annotations[kubevip.RPFilter])
|
rpFilter, err := strconv.Atoi(i.ServiceSnapshot.Annotations[kubevip.RPFilter])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
slog.Error("[DHCP] unable to process rp_filter", "value", rpFilter)
|
log.Error("[DHCP] unable to process rp_filter", "value", rpFilter)
|
||||||
} else {
|
} else {
|
||||||
if rpFilter >= 0 && rpFilter < 3 { // Ensure the value is 0,1,2
|
if rpFilter >= 0 && rpFilter < 3 { // Ensure the value is 0,1,2
|
||||||
rpfilterSetting = i.ServiceSnapshot.Annotations[kubevip.RPFilter]
|
rpfilterSetting = i.ServiceSnapshot.Annotations[kubevip.RPFilter]
|
||||||
} else {
|
} else {
|
||||||
slog.Error("[DHCP] rp_filter value not within range 0-2", "value", rpFilter)
|
log.Error("[DHCP] rp_filter value not within range 0-2", "value", rpFilter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
err = sysctl.WriteProcSys("/proc/sys/net/ipv4/conf/"+interfaceName+"/rp_filter", rpfilterSetting)
|
err = sysctl.WriteProcSys("/proc/sys/net/ipv4/conf/"+interfaceName+"/rp_filter", rpfilterSetting)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
slog.Error("[DHCP] unable to write rp_filter", "value", rpfilterSetting, "err", err)
|
log.Error("[DHCP] unable to write rp_filter", "value", rpfilterSetting, "err", err)
|
||||||
}
|
}
|
||||||
var initRebootFlag bool
|
var initRebootFlag bool
|
||||||
if i.DHCPInterfaceIP != "" {
|
if i.DHCPInterfaceIP != "" {
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ func GenerateRoleBinding(rolebinding bool, saCfg *applyCoreV1.ServiceAccountAppl
|
|||||||
func generatePodSpec(c *Config, image, imageVersion string, inCluster bool) *corev1.Pod {
|
func generatePodSpec(c *Config, image, imageVersion string, inCluster bool) *corev1.Pod {
|
||||||
imageRef, err := name.NewTag(image, name.WeakValidation, name.WithDefaultTag(imageVersion))
|
imageRef, err := name.NewTag(image, name.WeakValidation, name.WithDefaultTag(imageVersion))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(fmt.Errorf("Cannot parse %q: %w", image, err))
|
panic(fmt.Errorf("cannot parse %q: %w", image, err))
|
||||||
}
|
}
|
||||||
command := "manager"
|
command := "manager"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user