log.Warnf("Seems like you're mounting a file at '%s' while also using a referenced registries config or k3d-managed registries: Your mounted file will probably be overwritten!",k3d.DefaultRegistriesFilePath)
l.Log().Warnf("Seems like you're mounting a file at '%s' while also using a referenced registries config or k3d-managed registries: Your mounted file will probably be overwritten!",k3d.DefaultRegistriesFilePath)
}
// create new entry or append filter to existing entry
cmd.Flags().StringVarP(&mergeKubeconfigFlags.output,"output","o","",fmt.Sprintf("Define output [ - | FILE ] (default from $KUBECONFIG or %s",clientcmd.RecommendedHomeFile))
iferr:=cmd.MarkFlagFilename("output");err!=nil{
log.Fatalln("Failed to mark flag --output as filename")
l.Log().Fatalln("Failed to mark flag --output as filename")
}
cmd.Flags().BoolVarP(&mergeKubeconfigFlags.targetDefault,"kubeconfig-merge-default","d",false,fmt.Sprintf("Merge into the default kubeconfig ($KUBECONFIG or %s)",clientcmd.RecommendedHomeFile))
cmd.Flags().BoolVarP(&writeKubeConfigOptions.UpdateExisting,"update","u",true,"Update conflicting fields in existing kubeconfig")
log.Fatalln("Failed to hide --cluster flag on registry create command")
l.Log().Fatalln("Failed to hide --cluster flag on registry create command")
}
cmd.Flags().StringVarP(&flags.Image,"image","i",fmt.Sprintf("%s:%s",k3d.DefaultRegistryImageRepo,k3d.DefaultRegistryImageTag),"Specify image used for the registry")
log.Warnf("The part '%s' of the flag input '%s' ends with a double backslash, so we assume you want to escape the backslash before the '@'. That's the only time we do this.",it,flag)
l.Log().Warnf("The part '%s' of the flag input '%s' ends with a double backslash, so we assume you want to escape the backslash before the '@'. That's the only time we do this.",it,flag)
}else{
// Case 1.2: Unescaped backslash -> Escaping the '@' -> remove suffix and append it to buffer, followed by the escaped @ sign
log.Tracef("Item '%s' just before an '@' ends with '\\', so we assume it's escaping a literal '@'",it)
l.Log().Tracef("Item '%s' just before an '@' ends with '\\', so we assume it's escaping a literal '@'",it)
clusterCreateOpts.GlobalLabels[k3d.LabelNetworkExternal]="true"// if the network wasn't created, we say that it's managed externally (important for cluster deletion)
log.Warnf("Node '%s' is restarting for more than a minute now. Possibly it will recover soon (e.g. when it's waiting to join). Consider using a creation timeout to avoid waiting forever in a Restart Loop.",node.Name)
l.Log().Warnf("Node '%s' is restarting for more than a minute now. Possibly it will recover soon (e.g. when it's waiting to join). Consider using a creation timeout to avoid waiting forever in a Restart Loop.",node.Name)
}
time.Sleep(500*time.Millisecond)// wait for half a second to avoid overloading docker (error `socket: too many open files`)
}
log.Debugf("Finished waiting for log message '%s' from node '%s'",message,node.Name)
l.Log().Debugf("Finished waiting for log message '%s' from node '%s'",message,node.Name)
log.Infof("portmapping '%s' lacks a nodefilter, but there's more than one node: defaulting to %s",portWithNodeFilters.Port,types.DefaultTargetsNodefiltersPortMappings)
l.Log().Infof("portmapping '%s' lacks a nodefilter, but there's more than one node: defaulting to %s",portWithNodeFilters.Port,types.DefaultTargetsNodefiltersPortMappings)
log.Tracef("Got registry %+v from node %+v",registry,node)
l.Log().Tracef("Got registry %+v from node %+v",registry,node)
returnregistry,nil
@ -273,11 +273,11 @@ func RegistryGenerateLocalRegistryHostingConfigMapYAML(ctx context.Context, runt
}
iflen(registries)>1{
log.Warnf("More than one registry specified, but the LocalRegistryHostingV1 spec only supports one -> Selecting the first one: %s",registries[0].Host)
l.Log().Warnf("More than one registry specified, but the LocalRegistryHostingV1 spec only supports one -> Selecting the first one: %s",registries[0].Host)
}
iflen(registries)<1{
log.Debugln("No registry specified, not generating local registry hosting configmap")
l.Log().Debugln("No registry specified, not generating local registry hosting configmap")
returnnil,nil
}
@ -290,15 +290,15 @@ func RegistryGenerateLocalRegistryHostingConfigMapYAML(ctx context.Context, runt
// if the host is now 0.0.0.0, check if we can set it to the IP of the docker-machine, if it's used
log.Infoln("Hostnetwork selected - disabling injection of docker host into the cluster, server load balancer and setting the api port to the k3s default")
l.Log().Infoln("Hostnetwork selected - disabling injection of docker host into the cluster, server load balancer and setting the api port to the k3s default")
// if network is set to host, exposed api port must be the one imposed by k3s
k3sPort:=cluster.KubeAPI.Port.Port()
log.Debugf("Host network was chosen, changing provided/random api port to k3s:%s",k3sPort)
l.Log().Debugf("Host network was chosen, changing provided/random api port to k3s:%s",k3sPort)
returnnetaddr.IPPrefix{},fmt.Errorf("failed to inspect fake network %s: %w",fakenetResp.ID,err)
}
log.Tracef("Created fake network %s (%s) with subnet prefix %s. Deleting it again to re-use that prefix...",fakenet.Name,fakenet.ID,fakenet.IPAM.IPPrefix.String())
l.Log().Tracef("Created fake network %s (%s) with subnet prefix %s. Deleting it again to re-use that prefix...",fakenet.Name,fakenet.ID,fakenet.IPAM.IPPrefix.String())
iferr:=d.DeleteNetwork(ctx,fakenet.ID);err!=nil{
returnnetaddr.IPPrefix{},fmt.Errorf("failed to delete fake network %s (%s): %w",fakenet.Name,fakenet.ID,err)
netInfo,err:=GetNetwork(context.Background(),node.Networks[0])// FIXME: only considering first network here, as that's the one k3d creates for a cluster
iferr!=nil{
log.Warnf("Failed to get network information: %v",err)
l.Log().Warnf("Failed to get network information: %v",err)
newClientOpts.Common.LogLevel=log.GetLevel().String()// this is needed, as the following Initialize() call will set a new log level on the global logrus instance
newClientOpts.Common.LogLevel=l.Log().GetLevel().String()// this is needed, as the following Initialize() call will set a new log level on the global logrus instance