Skip to content

Commit 3fd510b

Browse files
committed
Upgrade OCI provider SDK to v65.90.0. Required for Go 1.24.
1 parent ff55955 commit 3fd510b

File tree

1,325 files changed

+17401
-7142
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,325 files changed

+17401
-7142
lines changed

cluster-autoscaler/cloudprovider/oci/vendor-internal/github.com/gofrs/flock/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ go get -u github.com/gofrs/flock
2121

2222
## Usage
2323
```Go
24-
import "github.com/gofrs/flock"
24+
import "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/oci/vendor-internal/github.com/gofrs/flock"
2525

2626
fileLock := flock.New("/var/lock/go-lock.lock")
2727

cluster-autoscaler/cloudprovider/oci/vendor-internal/github.com/oracle/oci-go-sdk/v65/common/auth/certificate_retriever.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved.
1+
// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved.
22
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
33

44
package auth

cluster-autoscaler/cloudprovider/oci/vendor-internal/github.com/oracle/oci-go-sdk/v65/common/auth/configuration.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved.
1+
// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved.
22
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
33

44
package auth

cluster-autoscaler/cloudprovider/oci/vendor-internal/github.com/oracle/oci-go-sdk/v65/common/auth/dispatcher_modifier.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved.
1+
// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved.
22
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
33

44
package auth

cluster-autoscaler/cloudprovider/oci/vendor-internal/github.com/oracle/oci-go-sdk/v65/common/auth/federation_client.go

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved.
1+
// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved.
22
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
33

44
// Package auth provides supporting functions and structs for authentication
@@ -203,6 +203,13 @@ func newAuthClient(region common.Region, provider common.KeyProvider) *common.Ba
203203
client.Host = region.Endpoint("auth")
204204
}
205205
client.BasePath = "v1/x509"
206+
207+
if common.GlobalAuthClientCircuitBreakerSetting != nil {
208+
client.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.GlobalAuthClientCircuitBreakerSetting)
209+
} else if !common.IsEnvVarFalse("OCI_SDK_AUTH_CLIENT_CIRCUIT_BREAKER_ENABLED") {
210+
common.Logf("Configuring DefaultAuthClientCircuitBreakerSetting for federation client")
211+
client.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultAuthClientCircuitBreakerSetting())
212+
}
206213
return &client
207214
}
208215

@@ -288,7 +295,7 @@ func (c *x509FederationClient) getSecurityToken() (securityToken, error) {
288295
var httpResponse *http.Response
289296
defer common.CloseBodyIfValid(httpResponse)
290297

291-
for retry := 0; retry < 5; retry++ {
298+
for retry := 0; retry < 3; retry++ {
292299
request := c.makeX509FederationRequest()
293300

294301
if httpRequest, err = common.MakeDefaultHTTPRequestWithTaggedStruct(http.MethodPost, "", request); err != nil {
@@ -298,7 +305,10 @@ func (c *x509FederationClient) getSecurityToken() (securityToken, error) {
298305
if httpResponse, err = c.authClient.Call(context.Background(), &httpRequest); err == nil {
299306
break
300307
}
301-
308+
// Don't retry on 4xx errors
309+
if httpResponse != nil && httpResponse.StatusCode >= 400 && httpResponse.StatusCode <= 499 {
310+
return nil, fmt.Errorf("error %s returned by auth service: %s", httpResponse.Status, err.Error())
311+
}
302312
nextDuration := time.Duration(1000.0*(math.Pow(2.0, float64(retry)))) * time.Millisecond
303313
time.Sleep(nextDuration)
304314
}

cluster-autoscaler/cloudprovider/oci/vendor-internal/github.com/oracle/oci-go-sdk/v65/common/auth/federation_client_oke_workload_identity.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved.
1+
// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved.
22
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
33

44
package auth
@@ -125,8 +125,14 @@ func (c *x509FederationClientForOkeWorkloadIdentity) getSecurityToken() (securit
125125

126126
statusCode := response.StatusCode
127127
if statusCode != http.StatusOK {
128-
return nil, fmt.Errorf("failed to get a RPST token from Proxymux: URL: %s, Status: %s, Message: %s",
129-
c.proxymuxEndpoint, response.Status, body.String())
128+
if statusCode == http.StatusForbidden {
129+
return nil, fmt.Errorf("please ensure the cluster type is enhanced: Status: %s, Message: %s",
130+
response.Status, body.String())
131+
} else {
132+
return nil, fmt.Errorf("failed to get a RPST token from Proxymux: URL: %s, Status: %s, Message: %s",
133+
c.proxymuxEndpoint, response.Status, body.String())
134+
}
135+
130136
}
131137

132138
if _, err = body.ReadFrom(response.Body); err != nil {

cluster-autoscaler/cloudprovider/oci/vendor-internal/github.com/oracle/oci-go-sdk/v65/common/auth/instance_principal_delegation_token_provider.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved.
1+
// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved.
22
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
33

44
package auth

cluster-autoscaler/cloudprovider/oci/vendor-internal/github.com/oracle/oci-go-sdk/v65/common/auth/instance_principal_key_provider.go

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved.
1+
// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved.
22
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
33

44
package auth
@@ -7,9 +7,9 @@ import (
77
"bytes"
88
"crypto/rsa"
99
"fmt"
10+
"math/rand"
1011
"net/http"
1112
"os"
12-
"strings"
1313
"time"
1414

1515
"k8s.io/autoscaler/cluster-autoscaler/cloudprovider/oci/vendor-internal/github.com/oracle/oci-go-sdk/v65/common"
@@ -18,7 +18,6 @@ import (
1818
const (
1919
defaultMetadataBaseURL = `http://169.254.169.254/opc/v2`
2020
metadataBaseURLEnvVar = `OCI_METADATA_BASE_URL`
21-
metadataFallbackURL = `http://169.254.169.254/opc/v1`
2221
regionPath = `/instance/region`
2322
leafCertificatePath = `/identity/cert.pem`
2423
leafCertificateKeyPath = `/identity/key.pem`
@@ -106,19 +105,19 @@ func newInstancePrincipalKeyProvider(modifier func(common.HTTPRequestDispatcher)
106105
func getRegionForFederationClient(dispatcher common.HTTPRequestDispatcher, url string) (r common.Region, err error) {
107106
var body bytes.Buffer
108107
var statusCode int
109-
MaxRetriesFederationClient := 3
108+
MaxRetriesFederationClient := 8
110109
for currTry := 0; currTry < MaxRetriesFederationClient; currTry++ {
111110
body, statusCode, err = httpGet(dispatcher, url)
112111
if err == nil && statusCode == 200 {
113112
return common.StringToRegion(body.String()), nil
114113
}
115114
common.Logf("Error in getting region from url: %s, Status code: %v, Error: %s", url, statusCode, err.Error())
116-
if statusCode == 404 && strings.Compare(url, getMetadataBaseURL()+regionPath) == 0 {
117-
common.Logf("Falling back to http://169.254.169.254/opc/v1 to try again...\n")
118-
updateX509CertRetrieverURLParas(metadataFallbackURL)
119-
url = regionURL
115+
nextDuration := time.Duration(float64(int(1)<<currTry)+rand.Float64()) * time.Second
116+
if nextDuration > 30*time.Second {
117+
nextDuration = 30*time.Second + time.Duration(rand.Float64())*time.Second
120118
}
121-
time.Sleep(1 * time.Second)
119+
common.Logf("Retrying for getRegionForFederationClinet function, current retry count is:%v, sleep after %v", currTry+1, nextDuration)
120+
time.Sleep(nextDuration)
122121
}
123122
return
124123
}

cluster-autoscaler/cloudprovider/oci/vendor-internal/github.com/oracle/oci-go-sdk/v65/common/auth/jwt.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved.
1+
// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved.
22
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
33

44
package auth

cluster-autoscaler/cloudprovider/oci/vendor-internal/github.com/oracle/oci-go-sdk/v65/common/auth/resource_principal_delegation_token_provider.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved.
1+
// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved.
22
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
33

44
package auth

0 commit comments

Comments
 (0)