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

STOR-2015: Rebase to upstream v2.0.7 for OCP 4.18 #86

Merged
merged 65 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
6f3f4e5
Update test file manifest paths for e2e tests
seanzatzdev-amazon Apr 9, 2024
e1e2858
Add script + instructions for in-place upgrade test.
seanzatzdev-amazon Apr 11, 2024
7fd54c6
Install Rust and Cargo for building efs-proxy
RyanStan Apr 12, 2024
686f0e4
Update go-restful dependency
RyanStan Apr 15, 2024
322a470
Merge pull request #1313 from mskanth972/PRsCherrypick
mskanth972 Apr 15, 2024
db00b31
Pre-release PRs for v2.0.0
mskanth972 Apr 15, 2024
ced6bc5
Merge pull request #1314 from mskanth972/Pre-releasePrs2.0.0
mskanth972 Apr 15, 2024
031221e
Post-release PRs for v2.0.0
mskanth972 Apr 15, 2024
97d9f9d
Merge pull request #1316 from mskanth972/post-releasePRsv2.0
mskanth972 Apr 15, 2024
b9736ae
README Update
mskanth972 Apr 16, 2024
11f0253
Merge pull request #1317 from mskanth972/readmeupdate_
mskanth972 Apr 16, 2024
909ccef
Pre-release PR for v2.0.1
mskanth972 Apr 23, 2024
f0c10ed
Merge pull request #1322 from mskanth972/prev2.0.1
mskanth972 Apr 23, 2024
4e1de24
Post-release PR for v2.0.1 and also changed the Default image from do…
mskanth972 Apr 24, 2024
b9e41fb
Merge pull request #1324 from mskanth972/post-releasev2.0.1
k8s-ci-robot Apr 24, 2024
ca5d082
Update CHANGELOG to include 2.x for newer versions.
mskanth972 Apr 26, 2024
c2f4175
Merge pull request #1328 from mskanth972/CHANGELOG-update
mskanth972 Apr 26, 2024
466489f
Update the Helm configuration to use Public ECR image default rather…
mskanth972 Apr 29, 2024
81bfd41
Merge pull request #1333 from mskanth972/helmup
mskanth972 Apr 29, 2024
95568cb
Pre-release PR for v2.0.2
mskanth972 May 1, 2024
d4efe07
Merge pull request #1338 from mskanth972/pre2.0.2
mskanth972 May 1, 2024
d241833
Post-release PRs for v2.0.2
mskanth972 May 1, 2024
5b30aa7
Merge pull request #1339 from mskanth972/post2.0.2
k8s-ci-robot May 1, 2024
23c8cc1
Expose env, volume, and volume mounts for the efs controller and deam…
cnmcavoy Oct 18, 2023
112642b
Update golang.org dependency
mskanth972 May 28, 2024
3abbafe
Merge pull request #1356 from mskanth972/CherryPickPRs_for_v2.0.3
k8s-ci-robot May 28, 2024
35ed846
pre-release PR v2.0.3
seanzatzdev-amazon May 28, 2024
57ffdf7
Merge pull request #1357 from seanzatzdev-amazon/release-2.0
k8s-ci-robot May 28, 2024
380e9f0
post-release PRs for v2.0.3
mskanth972 May 29, 2024
c12f586
Merge pull request #1361 from mskanth972/post-releae2.0.3
k8s-ci-robot May 29, 2024
806a363
Sanitize CSI RPC request logs
mskanth972 May 30, 2024
0d5c563
Fix efs-proxy Zombie processes
mskanth972 Jun 6, 2024
bbf6a50
Fix test file paths after dependency upgrades.
seanzatzdev-amazon Jun 6, 2024
6d3b3c2
Pre-release PR for v2.0.4
seanzatzdev-amazon Jun 6, 2024
44863ba
Merge pull request #1367 from seanzatzdev-amazon/release-2.0
k8s-ci-robot Jun 6, 2024
3141fd9
Post release PRs for v2.0.4
mskanth972 Jun 7, 2024
5a03e9b
Merge pull request #1369 from mskanth972/post2.0.4
k8s-ci-robot Jun 7, 2024
a77f82c
docs(static_provisioning): add a note that dont proceed to the next s…
wafuwafu13 Jul 26, 2023
288f33d
chore: Bump aws-sdk to 1.50 for pod identity support
askulkarni2 Jan 24, 2024
884fe24
Add Pod Identity documentation in README
arnavgup1 Jun 19, 2024
138be57
Bump Side-cars
mskanth972 Jun 25, 2024
7c8db01
Update k8s dependencies
mskanth972 Jun 24, 2024
42bb3b2
Merge pull request #1390 from mskanth972/v2.0.5cherrypick
k8s-ci-robot Jun 26, 2024
eacea31
Pre-release PR for v2.0.5
arnavgup1 Jun 26, 2024
c4e3640
Merge pull request #1392 from arnavgup1/release-2.0.5-branch
k8s-ci-robot Jun 26, 2024
2a442df
Post release PRs for v2.0.5
arnavgup1 Jun 27, 2024
7c1916f
Merge pull request #1395 from arnavgup1/release-2.0.5-post
k8s-ci-robot Jun 27, 2024
5b1801a
impl compensation mechanism for driver.removeNotReadyTaint()
abbshr Mar 15, 2024
c21d6db
add test
abbshr Mar 15, 2024
9957420
Set `fips_mode_enabled` in `efs-utils.conf`
mpatlasov May 5, 2024
784864f
Add additionalLabels to node-daemonset
omerap12 Jun 27, 2024
8950f97
Update statefulset example
seanzatzdev-amazon Jul 3, 2024
4e477a7
Increase the default Port Range from 400 to 1000.
mskanth972 Jul 5, 2024
4a0e1e9
Refactor re-use Access Point
otorreno Jan 3, 2024
723b79a
Updated the docker file to install the latest version of Rust.
mskanth972 Jul 24, 2024
a135bf8
Merge pull request #1415 from mskanth972/cherrypicks_for_2.0.6
mskanth972 Jul 25, 2024
86ae6df
Pre-release PR for v2.0.6
abbshr Mar 15, 2024
15ad9e3
Merge pull request #1417 from mskanth972/pre-releasev2.0.6re
mskanth972 Jul 25, 2024
cb4c114
post-release PR for v2.0.6
mskanth972 Jul 25, 2024
8619642
Merge pull request #1419 from mskanth972/v2.0.6post
k8s-ci-robot Jul 25, 2024
7576187
Update Go Version
mskanth972 Aug 7, 2024
d57f415
Merge pull request #1429 from mskanth972/Go_update_1
k8s-ci-robot Aug 7, 2024
da4bbe0
Pre-release PR for v2.0.7
mskanth972 Aug 7, 2024
dcc681c
Merge remote-tracking branch 'openshift/master' into rebase-v2.0.7
dfajmon Sep 4, 2024
60e489f
UPSTREAM: <carry>: Add OpenShift files
RomanBednar Jun 28, 2024
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
10 changes: 10 additions & 0 deletions CHANGELOG-2.x.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# V2.0.7
* Update GO version from 1.20 to 1.22.5 to mitigate CVEs. ([#1427](https://github.com/kubernetes-sigs/aws-efs-csi-driver/pull/1427),[@mskanth972](https://github.com/mskanth972))
# V2.0.6
* Updated the docker file to install the latest version of Rust. ([#1414](https://github.com/kubernetes-sigs/aws-efs-csi-driver/pull/1414),[@mskanth972](https://github.com/mskanth972))
* Increase the default Port Range from 400 to 1000. ([#1402](https://github.com/kubernetes-sigs/aws-efs-csi-driver/pull/1402),[@mskanth972](https://github.com/mskanth972))
* Update statefulset example ([#1400](https://github.com/kubernetes-sigs/aws-efs-csi-driver/pull/1400) [@seanzatzdev-amazon](https://github.com/seanzatzdev-amazon))
* Add additionalLabels to node-daemonset ([#1394](https://github.com/kubernetes-sigs/aws-efs-csi-driver/pull/1394) [@omerap12](https://github.com/omerap12))
* Set fips_mode_enabled in efs-utils.conf ([#1344](https://github.com/kubernetes-sigs/aws-efs-csi-driver/pull/1344) [@mpatlasov](https://github.com/mpatlasov))
* make sure the startup taint will eventually being removed after efs driver ready ([#1287](https://github.com/kubernetes-sigs/aws-efs-csi-driver/pull/1287) [@abbshr](https://github.com/abbshr))
* Refactor re-use Access Point ([#1233](https://github.com/kubernetes-sigs/aws-efs-csi-driver/pull/1233) [@otorreno](https://github.com/otorreno))
# V2.0.5
* Add a note to not proceed to the next step until pv STATUS is Bound ([#1075](https://github.com/kubernetes-sigs/aws-efs-csi-driver/pull/1075),[@wafuwafu13](https://github.com/wafuwafu13))
* Add Pod Identity Support ([#1254](https://github.com/kubernetes-sigs/aws-efs-csi-driver/pull/12541),[@askulkarni2](https://github.com/askulkarni2))
Expand Down
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM public.ecr.aws/eks-distro-build-tooling/golang:1.20 as go-builder
FROM public.ecr.aws/eks-distro-build-tooling/golang:1.22.5 as go-builder
WORKDIR /go/src/github.com/kubernetes-sigs/aws-efs-csi-driver

ARG TARGETOS
Expand All @@ -38,7 +38,11 @@ RUN mkdir -p /tmp/rpms && \
then echo "Installing efs-utils from Amazon Linux 2 yum repo" && \
yum -y install --downloadonly --downloaddir=/tmp/rpms amazon-efs-utils-1.35.0-1.amzn2.noarch; \
else echo "Installing efs-utils from github using the latest git tag" && \
yum -y install git rpm-build make rust cargo openssl-devel && \
yum -y install git rpm-build make openssl-devel curl && \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
source $HOME/.cargo/env && \
rustup update && \
rustup default stable && \
git clone https://github.com/aws/efs-utils && \
cd efs-utils && \
git checkout $(git describe --tags $(git rev-list --tags --max-count=1)) && \
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.
#

VERSION=v2.0.5
VERSION=v2.0.7

PKG=github.com/kubernetes-sigs/aws-efs-csi-driver
GIT_COMMIT?=$(shell git rev-parse HEAD)
Expand Down
4 changes: 4 additions & 0 deletions charts/aws-efs-csi-driver/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Helm chart
# v3.0.7
* Bump app/driver version to `v2.0.6`
# v3.0.6
* Bump app/driver version to `v2.0.5`
# v3.0.5
* Bump app/driver version to `v2.0.4`
# v3.0.4
Expand Down
4 changes: 2 additions & 2 deletions charts/aws-efs-csi-driver/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: aws-efs-csi-driver
version: 3.0.5
appVersion: 2.0.4
version: 3.0.7
appVersion: 2.0.6
kubeVersion: ">=1.17.0-0"
description: "A Helm chart for AWS EFS CSI Driver"
home: https://github.com/kubernetes-sigs/aws-efs-csi-driver
Expand Down
8 changes: 4 additions & 4 deletions charts/aws-efs-csi-driver/templates/node-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ metadata:
name: efs-csi-node
labels:
app.kubernetes.io/name: {{ include "aws-efs-csi-driver.name" . }}
{{- with .Values.node.additionalLabels }}
{{ toYaml . | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels:
Expand All @@ -21,9 +24,6 @@ spec:
app: efs-csi-node
app.kubernetes.io/name: {{ include "aws-efs-csi-driver.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- with .Values.node.podLabels }}
{{ toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.node.podAnnotations }}
annotations: {{ toYaml .Values.node.podAnnotations | nindent 8 }}
{{- end }}
Expand Down Expand Up @@ -56,7 +56,7 @@ spec:
dnsConfig: {{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ .Values.node.serviceAccount.name }}
priorityClassName: {{ .Values.node.priorityClassName}}
priorityClassName: system-node-critical
{{- with .Values.node.tolerations }}
tolerations: {{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
5 changes: 2 additions & 3 deletions charts/aws-efs-csi-driver/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ useFIPS: false

image:
repository: public.ecr.aws/efs-csi-driver/amazon/aws-efs-csi-driver
tag: "v2.0.4"
tag: "v2.0.6"
pullPolicy: IfNotPresent

sidecars:
Expand Down Expand Up @@ -133,7 +133,6 @@ node:
# "fs-01234567":
# ip: 10.10.2.2
# region: us-east-2
priorityClassName: system-node-critical
dnsPolicy: ClusterFirst
dnsConfig:
{}
Expand All @@ -142,8 +141,8 @@ node:
# dnsConfig:
# nameservers:
# - 169.254.169.253
podLabels: {}
podAnnotations: {}
additionalLabels: {}
resources:
{}
# limits:
Expand Down
2 changes: 1 addition & 1 deletion deploy/kubernetes/base/controller-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ spec:
- name: efs-plugin
securityContext:
privileged: true
image: public.ecr.aws/efs-csi-driver/amazon/aws-efs-csi-driver:v2.0.4
image: public.ecr.aws/efs-csi-driver/amazon/aws-efs-csi-driver:v2.0.6
imagePullPolicy: IfNotPresent
args:
- --endpoint=$(CSI_ENDPOINT)
Expand Down
2 changes: 1 addition & 1 deletion deploy/kubernetes/base/node-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ spec:
- name: efs-plugin
securityContext:
privileged: true
image: public.ecr.aws/efs-csi-driver/amazon/aws-efs-csi-driver:v2.0.4
image: public.ecr.aws/efs-csi-driver/amazon/aws-efs-csi-driver:v2.0.6
imagePullPolicy: IfNotPresent
args:
- --endpoint=$(CSI_ENDPOINT)
Expand Down
2 changes: 1 addition & 1 deletion deploy/kubernetes/overlays/stable/ecr/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ bases:
images:
- name: public.ecr.aws/efs-csi-driver/amazon/aws-efs-csi-driver
newName: 602401143452.dkr.ecr.us-west-2.amazonaws.com/eks/aws-efs-csi-driver
newTag: v2.0.4
newTag: v2.0.6
- name: public.ecr.aws/eks-distro/kubernetes-csi/livenessprobe
newName: 602401143452.dkr.ecr.us-west-2.amazonaws.com/eks/livenessprobe
newTag: v2.13.0-eks-1-30-8
Expand Down
2 changes: 1 addition & 1 deletion deploy/kubernetes/overlays/stable/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ bases:
- ../../base
images:
- name: public.ecr.aws/efs-csi-driver/amazon/aws-efs-csi-driver
newTag: v2.0.4
newTag: v2.0.6
- name: public.ecr.aws/eks-distro/kubernetes-csi/livenessprobe
newTag: v2.13.0-eks-1-30-8
- name: public.ecr.aws/eks-distro/kubernetes-csi/node-driver-registrar
Expand Down
6 changes: 4 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ The following sections are Kubernetes specific. If you are a Kubernetes user, us
| Amazon EFS CSI Driver Version | Image |
|-------------------------------|----------------------------------|
| master branch | amazon/aws-efs-csi-driver:master |
| v2.0.7 | amazon/aws-efs-csi-driver:v2.0.7 |
| v2.0.6 | amazon/aws-efs-csi-driver:v2.0.6 |
| v2.0.5 | amazon/aws-efs-csi-driver:v2.0.5 |
| v2.0.4 | amazon/aws-efs-csi-driver:v2.0.4 |
| v2.0.3 | amazon/aws-efs-csi-driver:v2.0.3 |
Expand Down Expand Up @@ -144,7 +146,7 @@ The following sections are Kubernetes specific. If you are a Kubernetes user, us
### ECR Image
| Driver Version | [ECR](https://gallery.ecr.aws/efs-csi-driver/amazon/aws-efs-csi-driver) Image |
|----------------|-------------------------------------------------------------------------------|
| v2.0.5 | public.ecr.aws/efs-csi-driver/amazon/aws-efs-csi-driver:v2.0.5 |
| v2.0.7 | public.ecr.aws/efs-csi-driver/amazon/aws-efs-csi-driver:v2.0.7 |

**Note**
You can find previous efs-csi-driver versions' images from [here](https://gallery.ecr.aws/efs-csi-driver/amazon/aws-efs-csi-driver)
Expand Down Expand Up @@ -363,7 +365,7 @@ If you want to update to a specific version, first customize the driver yaml fil
kubectl kustomize "github.com/kubernetes-sigs/aws-efs-csi-driver/deploy/kubernetes/overlays/stable/?ref=release-2.0" > driver.yaml
```

Then, update all lines referencing `image: amazon/aws-efs-csi-driver` to the desired version (e.g., to `image: amazon/aws-efs-csi-driver:v2.0.5`) in the yaml file, and deploy driver yaml again:
Then, update all lines referencing `image: amazon/aws-efs-csi-driver` to the desired version (e.g., to `image: amazon/aws-efs-csi-driver:v2.0.7`) in the yaml file, and deploy driver yaml again:
```sh
kubectl apply -f driver.yaml
```
Expand Down
2 changes: 1 addition & 1 deletion examples/kubernetes/statefulset/specs/example.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v1
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: efs-sc
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,4 @@ replace (
vbom.ml/util => github.com/fvbommel/util v0.0.0-20180919145318-efcd4e0f9787
)

go 1.20
go 1.22.5
10 changes: 10 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/aws/aws-sdk-go v1.50.3 h1:NnXC/ukOakZbBwQcwAzkAXYEB4SbWboP9TFx9vvhIrE=
github.com/aws/aws-sdk-go v1.50.3/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
Expand Down Expand Up @@ -77,6 +78,7 @@ github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6
github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153 h1:yUdfgN0XgIJw7foRItutHYUIhlcKzcSf5vDpdhQAKTc=
github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc=
github.com/emicklei/go-restful/v3 v3.12.0 h1:y2DdzBAURM29NFF94q6RaY4vjIH1rtwDapwQtU84iWk=
github.com/emicklei/go-restful/v3 v3.12.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
Expand Down Expand Up @@ -125,6 +127,7 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo=
github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ=
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
Expand Down Expand Up @@ -233,6 +236,7 @@ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFB
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
Expand Down Expand Up @@ -319,6 +323,7 @@ github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0ua
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
Expand All @@ -337,6 +342,7 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand Down Expand Up @@ -366,6 +372,7 @@ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqe
go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I=
go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM=
go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A=
go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
Expand Down Expand Up @@ -410,6 +417,7 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY=
golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
Expand Down Expand Up @@ -654,6 +662,7 @@ google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6D
google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20201209185603-f92720507ed4/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b h1:+YaDE2r2OG8t/z5qmsh7Y+XXwCbvadxxZ0YY6mTdrVA=
google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:CgAqfJo+Xmu0GwA0411Ht3OU3OntXwsGmrmjI8ioGXI=
google.golang.org/genproto/googleapis/api v0.0.0-20231030173426-d783a09b4405 h1:HJMDndgxest5n2y77fnErkM62iUsptE/H8p0dC2Huo4=
google.golang.org/genproto/googleapis/api v0.0.0-20231030173426-d783a09b4405/go.mod h1:oT32Z4o8Zv2xPQTg0pbVaPr0MPOH6f14RgXt7zfIpwg=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 h1:AB/lmRny7e2pLhFEYIbl5qkDAUt2h0ZRO4wGPhZf+ik=
Expand Down Expand Up @@ -697,6 +706,7 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
Expand Down
35 changes: 9 additions & 26 deletions pkg/cloud/cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,10 @@ type Efs interface {

type Cloud interface {
GetMetadata() MetadataService
CreateAccessPoint(ctx context.Context, clientToken string, accessPointOpts *AccessPointOptions, reuseAccessPoint bool) (accessPoint *AccessPoint, err error)
CreateAccessPoint(ctx context.Context, clientToken string, accessPointOpts *AccessPointOptions) (accessPoint *AccessPoint, err error)
DeleteAccessPoint(ctx context.Context, accessPointId string) (err error)
DescribeAccessPoint(ctx context.Context, accessPointId string) (accessPoint *AccessPoint, err error)
FindAccessPointByClientToken(ctx context.Context, clientToken, fileSystemId string) (accessPoint *AccessPoint, err error)
ListAccessPoints(ctx context.Context, fileSystemId string) (accessPoints []*AccessPoint, err error)
DescribeFileSystem(ctx context.Context, fileSystemId string) (fs *FileSystem, err error)
DescribeMountTargets(ctx context.Context, fileSystemId, az string) (fs *MountTarget, err error)
Expand Down Expand Up @@ -164,26 +165,8 @@ func (c *cloud) GetMetadata() MetadataService {
return c.metadata
}

func (c *cloud) CreateAccessPoint(ctx context.Context, clientToken string, accessPointOpts *AccessPointOptions, reuseAccessPoint bool) (accessPoint *AccessPoint, err error) {
func (c *cloud) CreateAccessPoint(ctx context.Context, clientToken string, accessPointOpts *AccessPointOptions) (accessPoint *AccessPoint, err error) {
efsTags := parseEfsTags(accessPointOpts.Tags)

//if reuseAccessPoint is true, check for AP with same Root Directory exists in efs
// if found reuse that AP
if reuseAccessPoint {
existingAP, err := c.findAccessPointByClientToken(ctx, clientToken, accessPointOpts)
if err != nil {
return nil, fmt.Errorf("failed to find access point: %v", err)
}
if existingAP != nil {
//AP path already exists
klog.V(2).Infof("Existing AccessPoint found : %+v", existingAP)
return &AccessPoint{
AccessPointId: existingAP.AccessPointId,
FileSystemId: existingAP.FileSystemId,
CapacityGiB: accessPointOpts.CapacityGiB,
}, nil
}
}
createAPInput := &efs.CreateAccessPointInput{
ClientToken: &clientToken,
FileSystemId: &accessPointOpts.FileSystemId,
Expand Down Expand Up @@ -262,22 +245,22 @@ func (c *cloud) DescribeAccessPoint(ctx context.Context, accessPointId string) (
}, nil
}

func (c *cloud) findAccessPointByClientToken(ctx context.Context, clientToken string, accessPointOpts *AccessPointOptions) (accessPoint *AccessPoint, err error) {
klog.V(5).Infof("AccessPointOptions to find AP : %+v", accessPointOpts)
func (c *cloud) FindAccessPointByClientToken(ctx context.Context, clientToken, fileSystemId string) (accessPoint *AccessPoint, err error) {
klog.V(5).Infof("Filesystem ID to find AP : %+v", fileSystemId)
klog.V(2).Infof("ClientToken to find AP : %s", clientToken)
describeAPInput := &efs.DescribeAccessPointsInput{
FileSystemId: &accessPointOpts.FileSystemId,
FileSystemId: &fileSystemId,
MaxResults: aws.Int64(AccessPointPerFsLimit),
}
res, err := c.efs.DescribeAccessPointsWithContext(ctx, describeAPInput)
if err != nil {
if isAccessDenied(err) {
return
return nil, ErrAccessDenied
}
if isFileSystemNotFound(err) {
return
return nil, ErrNotFound
}
err = fmt.Errorf("failed to list Access Points of efs = %s : %v", accessPointOpts.FileSystemId, err)
err = fmt.Errorf("failed to list Access Points of efs = %s : %v", fileSystemId, err)
return
}
for _, ap := range res.AccessPoints {
Expand Down
Loading