Skip to content

Commit

Permalink
Merge branch 'kubernetes:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
shapirus authored Nov 10, 2023
2 parents 112abe9 + c3e33c7 commit 0ed7d15
Show file tree
Hide file tree
Showing 6,019 changed files with 952,794 additions and 623,236 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '>=1.20.0'
go-version: '1.21.3'

- uses: actions/checkout@v2
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,13 +334,6 @@ func (ng *brightboxNodeGroup) findServerType() (*brightbox.ServerType, error) {
return nil, fmt.Errorf("ServerType with handle '%s' doesn't exist", handle)
}

func max(x, y int64) int64 {
if x > y {
return x
}
return y
}

func applyFudgeFactor(capacity *schedulerframework.Resource) *schedulerframework.Resource {
allocatable := capacity.Clone()
allocatable.Memory = max(0, capacity.Memory-max(capacity.Memory*memoryReservePercent/100, minimumMemoryReserve))
Expand Down
4 changes: 2 additions & 2 deletions cluster-autoscaler/cloudprovider/builder/builder_all.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ func buildCloudProvider(opts config.AutoscalingOptions, do cloudprovider.NodeGro
return ovhcloud.BuildOVHcloud(opts, do, rl)
case cloudprovider.HetznerProviderName:
return hetzner.BuildHetzner(opts, do, rl)
case cloudprovider.PacketProviderName:
return packet.BuildPacket(opts, do, rl)
case cloudprovider.PacketProviderName, cloudprovider.EquinixMetalProviderName:
return packet.BuildCloudProvider(opts, do, rl)
case cloudprovider.ClusterAPIProviderName:
return clusterapi.BuildClusterAPI(opts, do, rl)
case cloudprovider.IonoscloudProviderName:
Expand Down
7 changes: 4 additions & 3 deletions cluster-autoscaler/cloudprovider/builder/builder_packet.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@ import (
// AvailableCloudProviders supported by the cloud provider builder.
var AvailableCloudProviders = []string{
packet.ProviderName,
cloudprovider.EquinixMetalProviderName,
}

// DefaultCloudProvider for Packet-only build is Packet.
const DefaultCloudProvider = packet.ProviderName
const DefaultCloudProvider = cloudprovider.EquinixMetalProviderName

func buildCloudProvider(opts config.AutoscalingOptions, do cloudprovider.NodeGroupDiscoveryOptions, rl *cloudprovider.ResourceLimiter) cloudprovider.CloudProvider {
switch opts.CloudProviderName {
case packet.ProviderName:
return packet.BuildPacket(opts, do, rl)
case packet.ProviderName, cloudprovider.EquinixMetalProviderName:
return packet.BuildCloudProvider(opts, do, rl)
}

return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ func (mgr *cherryManagerRest) deleteServer(ctx context.Context, nodegroup string
return err
}

klog.Infof("Deleted server %s: %v", id, result)
klog.Infof("Deleted server %d: %v", id, result)
return nil

}
Expand Down Expand Up @@ -591,10 +591,10 @@ func (mgr *cherryManagerRest) deleteNodes(nodegroup string, nodes []NodeRef, upd

switch {
case s.Hostname == n.Name:
klog.V(1).Infof("Matching Cherry Server %s - %s", s.Hostname, s.ID)
klog.V(1).Infof("Matching Cherry Server %s - %d", s.Hostname, s.ID)
errList = append(errList, mgr.deleteServer(ctx, nodegroup, s.ID))
case fakeNode && int(nodeID) == s.ID:
klog.V(1).Infof("Fake Node %s", s.ID)
klog.V(1).Infof("Fake Node %d", s.ID)
errList = append(errList, mgr.deleteServer(ctx, nodegroup, s.ID))
}
}
Expand Down
2 changes: 1 addition & 1 deletion cluster-autoscaler/cloudprovider/civo/civo_node_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func (n *NodeGroup) IncreaseSize(delta int) error {
func (n *NodeGroup) DeleteNodes(nodes []*apiv1.Node) error {
for _, node := range nodes {
instanceID := toNodeID(node.Spec.ProviderID)
klog.V(4).Info("deleteing node: %q", instanceID)
klog.V(4).Infof("deleteing node: %q", instanceID)
_, err := n.client.DeleteKubernetesClusterPoolInstance(n.clusterID, n.id, instanceID)
if err != nil {
return fmt.Errorf("deleting node failed for cluster: %q node pool: %q node: %q: %s",
Expand Down
2 changes: 2 additions & 0 deletions cluster-autoscaler/cloudprovider/cloud_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ const (
VultrProviderName = "vultr"
// PacketProviderName gets the provider name of packet
PacketProviderName = "packet"
// EquinixMetalProviderName gets the provider name of packet
EquinixMetalProviderName = "equinixmetal"
// TencentcloudProviderName gets the provider name of tencentcloud
TencentcloudProviderName = "tencentcloud"
// ExternalGrpcProviderName gets the provider name of the external grpc provider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ package clusterapi

import (
"fmt"
"k8s.io/klog/v2"
"os"
"strconv"
"strings"
"sync"

"k8s.io/klog/v2"

"github.com/pkg/errors"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -335,7 +336,7 @@ func GetDefaultScaleFromZeroArchitecture() SystemArchitecture {
once.Do(func() {
archStr := os.Getenv(scaleUpFromZeroDefaultArchEnvVar)
arch := SystemArchitectureFromString(archStr)
klog.V(5).Infof("the default scale from zero architecture value is set to %s (%s)", scaleUpFromZeroDefaultArchEnvVar, archStr, arch.Name())
klog.V(5).Infof("the default scale from zero architecture value is set to %s (%s)", archStr, arch.Name())
if arch == UnknownArch {
arch = DefaultArch
klog.Errorf("Unrecognized architecture '%s', falling back to %s",
Expand Down
2 changes: 1 addition & 1 deletion cluster-autoscaler/cloudprovider/exoscale/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,5 @@ kubectl apply -f ./examples/cluster-autoscaler.yaml


[exo-iam]: https://community.exoscale.com/documentation/iam/quick-start/
[exo-limits]: https://portal.exoscale.com/account/limits
[exo-limits]: https://portal.exoscale.com/organization/quotas
[k8s-secrets]: https://kubernetes.io/docs/concepts/configuration/secret/
2 changes: 1 addition & 1 deletion cluster-autoscaler/cloudprovider/gce/gce_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ func (m *gceManagerImpl) refreshAutoscalingOptions() {
for _, mig := range m.migLister.GetMigs() {
template, err := m.migInfoProvider.GetMigInstanceTemplate(mig.GceRef())
if err != nil {
klog.Warningf("Not evaluating autoscaling options for %q MIG: failed to find corresponding instance template", mig.GceRef(), err)
klog.Warningf("Not evaluating autoscaling options for %q MIG: failed to find corresponding instance template: %v", mig.GceRef(), err)
continue
}
if template.Properties == nil {
Expand Down
6 changes: 3 additions & 3 deletions cluster-autoscaler/cloudprovider/gce/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ func extractKubeReservedFromKubeEnv(kubeEnv string) (string, error) {
func extractExtendedResourcesFromKubeEnv(kubeEnvValue string) (apiv1.ResourceList, error) {
extendedResourcesAsString, found, err := extractAutoscalerVarFromKubeEnv(kubeEnvValue, "extended_resources")
if err != nil {
klog.Warning("error while obtaining extended_resources from AUTOSCALER_ENV_VARS; %v", err)
klog.Warningf("error while obtaining extended_resources from AUTOSCALER_ENV_VARS; %v", err)
return nil, err
}

Expand All @@ -503,7 +503,7 @@ func extractExtendedResourcesFromKubeEnv(kubeEnvValue string) (apiv1.ResourceLis
if q, err := resource.ParseQuantity(quantity); err == nil && q.Sign() >= 0 {
extendedResources[apiv1.ResourceName(name)] = q
} else if err != nil {
klog.Warning("ignoring invalid value in extended_resources defined in AUTOSCALER_ENV_VARS; %v", err)
klog.Warningf("ignoring invalid value in extended_resources defined in AUTOSCALER_ENV_VARS; %v", err)
}
}
return extendedResources, nil
Expand Down Expand Up @@ -739,7 +739,7 @@ func extractAutoscalingOptionsFromKubeEnv(kubeEnvValue string) (map[string]strin
func extractEvictionHardFromKubeEnv(kubeEnvValue string) (map[string]string, error) {
evictionHardAsString, found, err := extractAutoscalerVarFromKubeEnv(kubeEnvValue, "evictionHard")
if err != nil {
klog.Warning("error while obtaining eviction-hard from AUTOSCALER_ENV_VARS; %v", err)
klog.Warningf("error while obtaining eviction-hard from AUTOSCALER_ENV_VARS; %v", err)
return nil, err
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ package hetzner
import (
"context"
"fmt"
"maps"
"math/rand"
"strings"
"sync"
"time"

"maps"

apiv1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -155,7 +156,7 @@ func (n *hetznerNodeGroup) DeleteNodes(nodes []*apiv1.Node) error {

err := n.manager.deleteByNode(node)
if err != nil {
klog.Errorf("failed to delete server ID %d error: %v", node.Name, err)
klog.Errorf("failed to delete server ID %s error: %v", node.Name, err)
}

waitGroup.Done()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func CreateCloudConfig(cloudConfigPath string, configProvider common.Configurati
}
if cloudConfig.Global.RefreshInterval == 0 {
if os.Getenv(ipconsts.OciRefreshInterval) != "" {
klog.V(4).Info("using a custom cache refresh interval %v...", os.Getenv(ipconsts.OciRefreshInterval))
klog.V(4).Infof("using a custom cache refresh interval %v...", os.Getenv(ipconsts.OciRefreshInterval))
cloudConfig.Global.RefreshInterval, _ = time.ParseDuration(os.Getenv(ipconsts.OciRefreshInterval))
} else {
if implType == npconsts.OciNodePoolResourceIdent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func BuildOVHcloud(opts config.AutoscalingOptions, do cloudprovider.NodeGroupDis

configFile, err = os.Open(opts.CloudConfig)
if err != nil {
klog.Fatalf("Failed to open cloud provider configuration %s: %v", opts.CloudConfig)
klog.Fatalf("Failed to open cloud provider configuration %s: %v", opts.CloudConfig, err)
}

defer configFile.Close()
Expand Down Expand Up @@ -268,7 +268,7 @@ func (provider *OVHCloudProvider) GetAvailableGPUTypes() map[string]struct{} {

flavorsByName, err := provider.manager.getFlavorsByName()
if err != nil {
klog.Errorf("Failed to get flavors: %w", err)
klog.Errorf("Failed to get flavors: %v", err)
return nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ spec:
secretKeyRef:
name: bootstrap-token-cluster-autoscaler-packet
key: token-secret
- name: PACKET_AUTH_TOKEN
- name: METAL_AUTH_TOKEN
valueFrom:
secretKeyRef:
name: cluster-autoscaler-packet
Expand Down
Loading

0 comments on commit 0ed7d15

Please sign in to comment.