Skip to content

Commit

Permalink
Merge pull request #44 from openshift-cloud-team/rebase-bot-master
Browse files Browse the repository at this point in the history
  • Loading branch information
openshift-merge-robot committed Jul 27, 2023
2 parents 208ad00 + 1c77dfe commit 1763ea5
Show file tree
Hide file tree
Showing 4,824 changed files with 1,535,998 additions and 20 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
24 changes: 12 additions & 12 deletions cloudbuild.yaml
Expand Up @@ -6,25 +6,25 @@ options:
steps:
- name: gcr.io/cloud-builders/git
args: ['fetch', '--tags']
- name: gcr.io/k8s-testimages/gcb-docker-gcloud
- name: 'gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20221214-1b4dd4d69a'
entrypoint: /buildx-entrypoint
args:
- build
- --tag=gcr.io/$PROJECT_ID/cloud-controller-manager:$_SHORT_TAG
- --tag=gcr.io/$PROJECT_ID/cloud-controller-manager:latest
- --build-arg=VERSION=$_SHORT_TAG
- --output=type=registry
- --platform=linux/amd64,linux/arm64
- .
- build
- --tag=gcr.io/$PROJECT_ID/cloud-controller-manager:$_SHORT_TAG
- --tag=gcr.io/$PROJECT_ID/cloud-controller-manager:latest
- --build-arg=VERSION=$_SHORT_TAG
- --output=type=registry
- --platform=linux/amd64,linux/arm64
- .
# Build cloudbuild artifacts (for attestation)
- name: 'docker.io/library/golang:1.19.5-bullseye'
- name: 'docker.io/library/golang:1.20.3-bullseye'
id: cloudbuild-artifacts
entrypoint: make
env:
- PULL_BASE_REF=$_PULL_BASE_REF
- LATEST_FILE=markers/${_PULL_BASE_REF}/latest-tag.txt
- PULL_BASE_REF=$_PULL_BASE_REF
- LATEST_FILE=markers/${_PULL_BASE_REF}/latest-tag.txt
args:
- cloudbuild-artifacts
- cloudbuild-artifacts
substitutions:
_GIT_TAG: 'v99999999-v12345'
# Remove date prefix (first 10 characters) to create valid semver version:
Expand Down
2 changes: 1 addition & 1 deletion cmd/ecr-credential-provider/plugin_test.go
Expand Up @@ -92,7 +92,7 @@ func Test_runPlugin(t *testing.T) {
}

if !reflect.DeepEqual(out.Bytes(), testcase.expectedOut) {
t.Logf("actual output: %v", string(out.Bytes()))
t.Logf("actual output: %v", out.String())
t.Logf("expected output: %v", string(testcase.expectedOut))
t.Errorf("unexpected output")
}
Expand Down
3 changes: 2 additions & 1 deletion docs/README.md
Expand Up @@ -47,7 +47,8 @@ The AWS cloud provider is released with a specific semantic version that correla

| Kubernetes Version | Latest AWS Cloud Provider Release Version |
|-----------------------------|-----------------------------------------------|
| v1.26 | v1.26.0 |
| v1.27 | v1.27.1 |
| v1.26 | v1.26.1 |
| v1.25 | v1.25.3 |
| v1.24 | v1.24.4 |
| v1.23 | v1.23.6 |
Expand Down
4 changes: 4 additions & 0 deletions docs/credential_provider.md
Expand Up @@ -35,3 +35,7 @@ Once you pass this config to the kubelet, every time it needs to fetch an image
in the list.
Globbing may be used, but each glob can only match a single subdomain segment.
So `*.io` does not match `*.k8s.io`.

## Authentication

The [AWS SDK credential chain](https://docs.aws.amazon.com/sdkref/latest/guide/standardized-credentials.html) is used to locate credentials for authenticating with AWS. For example, when you run the ECR credential provider on an EC2 instance, credentials are usually fetched from IMDS and no other configuration is necessary. If you do not run the ECR credential provider on EC2, you can specify credentials using environment variables, the `~/.aws/config` file, or any other standard method in the credential chain.
10 changes: 6 additions & 4 deletions pkg/providers/v1/aws.go
Expand Up @@ -45,10 +45,8 @@ import (
"github.com/aws/aws-sdk-go/service/kms"
"github.com/aws/aws-sdk-go/service/sts"
"gopkg.in/gcfg.v1"
v1 "k8s.io/api/core/v1"
"k8s.io/klog/v2"
netutils "k8s.io/utils/net"

v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
Expand All @@ -68,6 +66,8 @@ import (
cloudvolume "k8s.io/cloud-provider/volume"
volerr "k8s.io/cloud-provider/volume/errors"
volumehelpers "k8s.io/cloud-provider/volume/helpers"
"k8s.io/klog/v2"
netutils "k8s.io/utils/net"
)

// NLBHealthCheckRuleDescription is the comment used on a security group rule to
Expand Down Expand Up @@ -850,7 +850,9 @@ func InstanceIDIndexFunc(obj interface{}) ([]string, error) {
}
instanceID, err := KubernetesInstanceID(node.Spec.ProviderID).MapToAWSInstanceID()
if err != nil {
return []string{""}, fmt.Errorf("error mapping node %q's provider ID %q to instance ID: %v", node.Name, node.Spec.ProviderID, err)
//logging the error as warning as Informer.AddIndexers would panic if there is an error
klog.Warningf("error mapping node %q's provider ID %q to instance ID: %v", node.Name, node.Spec.ProviderID, err)
return []string{""}, nil
}
return []string{string(instanceID)}, nil
}
Expand Down
56 changes: 55 additions & 1 deletion pkg/providers/v1/aws_test.go
Expand Up @@ -36,7 +36,6 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"

v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
Expand Down Expand Up @@ -3983,3 +3982,58 @@ func TestDescribeInstances(t *testing.T) {
})
}
}

func TestInstanceIDIndexFunc(t *testing.T) {
type args struct {
obj interface{}
}
tests := []struct {
name string
args args
want []string
wantErr bool
}{
{
name: "returns empty on invalid provider id",
args: args{
obj: &v1.Node{
ObjectMeta: metav1.ObjectMeta{
Name: "test-node",
},
Spec: v1.NodeSpec{
ProviderID: "foo://com-2351",
},
},
},
want: []string{""},
wantErr: false,
},
{
name: "returns correct instance id on valid provider id",
args: args{
obj: &v1.Node{
ObjectMeta: metav1.ObjectMeta{
Name: "test-valid-node",
},
Spec: v1.NodeSpec{
ProviderID: "aws:////i-12345678abcdef01",
},
},
},
want: []string{"i-12345678abcdef01"},
wantErr: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got, err := InstanceIDIndexFunc(tt.args.obj)
if (err != nil) != tt.wantErr {
t.Errorf("InstanceIDIndexFunc() error = %v, wantErr %v", err, tt.wantErr)
return
}
if !reflect.DeepEqual(got, tt.want) {
t.Errorf("InstanceIDIndexFunc() = %v, want %v", got, tt.want)
}
})
}
}
20 changes: 20 additions & 0 deletions tests/e2e/vendor/github.com/beorn7/perks/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1763ea5

Please sign in to comment.