Skip to content

Commit

Permalink
Don't panic on ipmasq failures
Browse files Browse the repository at this point in the history
  • Loading branch information
aojea authored and BenTheElder committed Oct 14, 2019
1 parent 90ea520 commit 128196c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion images/kindnetd/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.0
0.5.1
6 changes: 2 additions & 4 deletions images/kindnetd/cmd/kindnetd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,9 @@ func main() {
// enforce ip masquerade rules
// TODO: dual stack...?
masqAgent := NewIPMasqAgent(net.IsIPv6String(hostIP), []string{os.Getenv("POD_SUBNET")})
// TODO: handle the errors and logging here, temporally the agent will run forever
go func() {
// TODO: use logging and continue retrying instead...
if err := masqAgent.SyncRulesForever(time.Second * 60); err != nil {
panic(err)
}
masqAgent.SyncRulesForever(time.Second * 60)
}()

// setup nodes reconcile function, closes over arguments
Expand Down
4 changes: 2 additions & 2 deletions images/kindnetd/cmd/kindnetd/masq.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ type IPMasqAgent struct {
}

// SyncRulesForever syncs ip masquerade rules forever
func (ma *IPMasqAgent) SyncRulesForever(interval time.Duration) error {
func (ma *IPMasqAgent) SyncRulesForever(interval time.Duration) {
for {
if err := ma.SyncRules(); err != nil {
return err
fmt.Printf("kind-masq-agent: error syncing rules %v , retrying ... \n", err)
}
time.Sleep(interval)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/build/node/cni.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const (
The default CNI manifest and images are our own tiny kindnet
*/

var defaultCNIImages = []string{"kindest/kindnetd:0.5.0"}
var defaultCNIImages = []string{"kindest/kindnetd:0.5.1"}

const defaultCNIManifest = `
# kindnetd networking manifest
Expand Down Expand Up @@ -144,7 +144,7 @@ spec:
serviceAccountName: kindnet
containers:
- name: kindnet-cni
image: kindest/kindnetd:0.5.0
image: kindest/kindnetd:0.5.1
env:
- name: HOST_IP
valueFrom:
Expand Down

0 comments on commit 128196c

Please sign in to comment.