Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated agent version #1474

Merged
merged 2 commits into from
May 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions test/agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ One way to run the traffic test is as follows
#### Networking Testing
Networking testing binary must be invoked on a pod that runs in Host Networking mode. It is capable of testing the Pod networking is setup correctly and once the Pod has been deleted the networking has been teared down correctly by the CNI Plugin.

### Using the local changes to Agent inside ginkgo
Ginkgo tests take dependency on the Agent module for supplying PodNetworkingValidationInput as of now.
If you are making changes to the PodNetworkingValidationInput then gingko must use local copy of agent with your modifications instead of downloading the upstream module to reflect those changes.
You can modify the go.mod file located inside test folder as below to enable ginkgo to use local copy of the agent
```
replace github.com/aws/amazon-vpc-cni-k8s/test/agent => <absolute local path>/amazon-vpc-cni-k8s/test/agent>
```

### How to test the Agent locally
Apart from running the tests on your local environment. For some test cases where we want to run test on Pod (for instance Pod networking tests) we can copy over the binary to the Pod and execute it. For e2e testing, we can push docker image to ECR and use the image in automation test suite.

Expand Down Expand Up @@ -64,6 +72,19 @@ Change the agent image in the Go code and run the test case as usual.

#### Finalizing the changes
- Submit PR with the change to Agent.
- Once the PR is merged get the commit hash and generate a new version for the agent changes
```
go get -d github.com/aws/amazon-vpc-cni-k8s/test/agent@<commit_hash>
```
Sample Output
```
go: github.com/aws/amazon-vpc-cni-k8s/test/agent 4d1931b480a23d2c6cb0eee8adef5bd3b2fbefac => v0.0.0-20210519174950-4d1931b480a2
go: downloading github.com/aws/amazon-vpc-cni-k8s/test/agent v0.0.0-20210519174950-4d1931b480a2
```
- Update the version in the go.mod file under test folder
```
github.com/aws/amazon-vpc-cni-k8s/test/agent v0.0.0-20210519174950-4d1931b480a2
```
- One of the AWS Maintainer will push the image to ECR (Till we have pipeline that does this for us)
- Use the updated image tag wherever you want to update the docker image in automation tests.

Expand Down
2 changes: 1 addition & 1 deletion test/framework/utils/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const (
AWSInitContainerName = "aws-vpc-cni-init"

// See https://gallery.ecr.aws/r3i6j7b0/aws-vpc-cni-test-helper
TestAgentImage = "public.ecr.aws/r3i6j7b0/aws-vpc-cni-test-helper:07ac7548"
TestAgentImage = "public.ecr.aws/r3i6j7b0/aws-vpc-cni-test-helper:143009a3"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion test/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.14
require (
github.com/apparentlymart/go-cidr v1.0.1
github.com/aws/amazon-vpc-cni-k8s v1.7.10
github.com/aws/amazon-vpc-cni-k8s/test/agent v0.0.0-20210504235351-07ac754880d8
github.com/aws/amazon-vpc-cni-k8s/test/agent v0.0.0-20210519174950-4d1931b480a2
github.com/aws/amazon-vpc-resource-controller-k8s v1.0.7
github.com/aws/aws-sdk-go v1.37.23
github.com/onsi/ginkgo v1.12.1
Expand Down