Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
4eb282ed
Commit
4eb282ed
authored
Dec 21, 2021
by
Manuel Buil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move flannel logs to logrus
Signed-off-by:
Manuel Buil
<
mbuil@suse.com
>
parent
2e91913f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
flannel.go
pkg/agent/flannel/flannel.go
+8
-8
No files found.
pkg/agent/flannel/flannel.go
View file @
4eb282ed
...
@@ -25,8 +25,8 @@ import (
...
@@ -25,8 +25,8 @@ import (
"github.com/flannel-io/flannel/network"
"github.com/flannel-io/flannel/network"
"github.com/flannel-io/flannel/pkg/ip"
"github.com/flannel-io/flannel/pkg/ip"
"github.com/flannel-io/flannel/subnet/kube"
"github.com/flannel-io/flannel/subnet/kube"
"github.com/sirupsen/logrus"
"golang.org/x/net/context"
"golang.org/x/net/context"
log
"k8s.io/klog"
// Backends need to be imported for their init() to get executed and them to register
// Backends need to be imported for their init() to get executed and them to register
_
"github.com/flannel-io/flannel/backend/extension"
_
"github.com/flannel-io/flannel/backend/extension"
...
@@ -73,13 +73,13 @@ func flannel(ctx context.Context, flannelIface *net.Interface, flannelConf, kube
...
@@ -73,13 +73,13 @@ func flannel(ctx context.Context, flannelIface *net.Interface, flannelConf, kube
if
err
:=
WriteSubnetFile
(
subnetFile
,
config
.
Network
,
config
.
IPv6Network
,
true
,
bn
);
err
!=
nil
{
if
err
:=
WriteSubnetFile
(
subnetFile
,
config
.
Network
,
config
.
IPv6Network
,
true
,
bn
);
err
!=
nil
{
// Continue, even though it failed.
// Continue, even though it failed.
log
.
Warningf
(
"Failed to write
subnet file: %s"
,
err
)
log
rus
.
Warningf
(
"Failed to write flannel
subnet file: %s"
,
err
)
}
else
{
}
else
{
log
.
Infof
(
"Wrote
subnet file to %s"
,
subnetFile
)
log
rus
.
Infof
(
"Wrote flannel
subnet file to %s"
,
subnetFile
)
}
}
// Start "Running" the backend network. This will block until the context is done so run in another goroutine.
// Start "Running" the backend network. This will block until the context is done so run in another goroutine.
log
.
Info
(
"Running
backend."
)
log
rus
.
Info
(
"Running flannel
backend."
)
bn
.
Run
(
ctx
)
bn
.
Run
(
ctx
)
return
nil
return
nil
}
}
...
@@ -90,18 +90,18 @@ func LookupExtInterface(iface *net.Interface, netMode int) (*backend.ExternalInt
...
@@ -90,18 +90,18 @@ func LookupExtInterface(iface *net.Interface, netMode int) (*backend.ExternalInt
var
err
error
var
err
error
if
iface
==
nil
{
if
iface
==
nil
{
log
.
Info
(
"Determining IP address of default
interface"
)
log
rus
.
Debug
(
"No interface defined for flannel in the config. Fetching the default gateway
interface"
)
if
iface
,
err
=
ip
.
GetDefaultGatewayInterface
();
err
!=
nil
{
if
iface
,
err
=
ip
.
GetDefaultGatewayInterface
();
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"failed to get default interface: %s"
,
err
)
return
nil
,
fmt
.
Errorf
(
"failed to get default interface: %s"
,
err
)
}
}
}
else
{
log
.
Info
(
"Determining IP address of specified interface: "
,
iface
.
Name
)
}
}
logrus
.
Debugf
(
"The interface %s will be used by flannel"
,
iface
.
Name
)
ifaceAddr
,
err
=
ip
.
GetInterfaceIP4Addr
(
iface
)
ifaceAddr
,
err
=
ip
.
GetInterfaceIP4Addr
(
iface
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"failed to find IPv4 address for interface %s"
,
iface
.
Name
)
return
nil
,
fmt
.
Errorf
(
"failed to find IPv4 address for interface %s"
,
iface
.
Name
)
}
}
logrus
.
Infof
(
"The interface %s with ipv4 address %s will be used by flannel"
,
iface
.
Name
,
ifaceAddr
)
if
netMode
==
(
ipv4
+
ipv6
)
{
if
netMode
==
(
ipv4
+
ipv6
)
{
ifacev6Addr
,
err
=
ip
.
GetInterfaceIP6Addr
(
iface
)
ifacev6Addr
,
err
=
ip
.
GetInterfaceIP6Addr
(
iface
)
...
@@ -109,7 +109,7 @@ func LookupExtInterface(iface *net.Interface, netMode int) (*backend.ExternalInt
...
@@ -109,7 +109,7 @@ func LookupExtInterface(iface *net.Interface, netMode int) (*backend.ExternalInt
return
nil
,
fmt
.
Errorf
(
"failed to find IPv6 address for interface %s"
,
iface
.
Name
)
return
nil
,
fmt
.
Errorf
(
"failed to find IPv6 address for interface %s"
,
iface
.
Name
)
}
}
log
.
Infof
(
"Using ipv6 address %s
"
,
ifacev6Addr
)
log
rus
.
Infof
(
"Using dual-stack mode. The ipv6 address %s will be used by flannel
"
,
ifacev6Addr
)
}
}
if
iface
.
MTU
==
0
{
if
iface
.
MTU
==
0
{
return
nil
,
fmt
.
Errorf
(
"failed to determine MTU for %s interface"
,
ifaceAddr
)
return
nil
,
fmt
.
Errorf
(
"failed to determine MTU for %s interface"
,
ifaceAddr
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment