Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

k8s: Fix data race when setting node address #11851

Merged
merged 1 commit into from Jun 3, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 10 additions & 9 deletions daemon/cmd/daemon.go
Expand Up @@ -380,16 +380,8 @@ func NewDaemon(ctx context.Context, dp datapath.Datapath) (*Daemon, *endpointRes
treatRemoteNodeAsHost := option.Config.AlwaysAllowLocalhost() && !option.Config.EnableRemoteNodeIdentity
policyApi.InitEntities(option.Config.ClusterName, treatRemoteNodeAsHost)

d.k8sCachesSynced = d.k8sWatcher.InitK8sSubsystem()

bootstrapStats.cleanup.Start()
err = clearCiliumVeths()
bootstrapStats.cleanup.EndError(err)
if err != nil {
log.WithError(err).Warning("Unable to clean stale endpoint interfaces")
}

if k8s.IsEnabled() {
bootstrapStats.k8sInit.Start()
if err := k8s.RegisterCRDs(); err != nil {
log.WithError(err).Fatal("Unable to register CRDs")
}
Expand All @@ -416,6 +408,15 @@ func NewDaemon(ctx context.Context, dp datapath.Datapath) (*Daemon, *endpointRes
bootstrapStats.k8sInit.End(true)
}

d.k8sCachesSynced = d.k8sWatcher.InitK8sSubsystem()

bootstrapStats.cleanup.Start()
err = clearCiliumVeths()
bootstrapStats.cleanup.EndError(err)
if err != nil {
log.WithError(err).Warning("Unable to clean stale endpoint interfaces")
}

d.bootstrapIPAM()

// Start the proxy before we restore endpoints so that we can inject the
Expand Down