diff --git a/node/pkg/lifecycle/startup/startup.go b/node/pkg/lifecycle/startup/startup.go index 45b4cb79acb..6a3948accfc 100644 --- a/node/pkg/lifecycle/startup/startup.go +++ b/node/pkg/lifecycle/startup/startup.go @@ -439,7 +439,6 @@ func waitForConnection(ctx context.Context, c client.Interface) { // is working. Getting a specific Node is a good option, even // if the Node does not exist. _, err := c.Nodes().Get(ctx, "foo", options.GetOptions{}) - // We only care about a couple of error cases, all others would // suggest the datastore is accessible. if err != nil { @@ -675,7 +674,6 @@ func evaluateENVBool(envVar string, defaultValue bool) bool { if isSet { switch strings.ToLower(envValue) { - case "false", "0", "no", "n", "f": log.Infof("%s is %t through environment variable", envVar, false) return false @@ -691,6 +689,12 @@ func evaluateENVBool(envVar string, defaultValue bool) bool { // in the environment, or is a no-op if not specified. // Returns true if the node object needs to be updated. func configureASNumber(node *libapi.Node) bool { + // If Calico is running in policy only mode we don't need to write BGP related + // details to the Node. + if os.Getenv("CALICO_NETWORKING_BACKEND") == "none" { + return false + } + // Extract the AS number from the environment asStr := os.Getenv("AS") if asStr != "" { @@ -861,7 +865,6 @@ func configureIPPools(ctx context.Context, client client.Interface, kubeadmConfi createIPPool(ctx, client, ipv6Cidr, DEFAULT_IPV6_POOL_NAME, string(api.IPIPModeNever), ipv6VXLANModeEnvVar, outgoingNATEnabled, ipv6BlockSize, ipv6NodeSelector, bgpExportDisabled) } - } // createIPPool creates an IP pool using the specified CIDR. This