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

Fix four small papercuts #2149

Merged
merged 4 commits into from
Sep 20, 2024
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
4 changes: 0 additions & 4 deletions charts/aws-ebs-csi-driver/templates/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,7 @@ spec:
image: {{ printf "%s%s:%s" (default "" .Values.image.containerRegistry) .Values.image.repository (default (printf "v%s" .Chart.AppVersion) (.Values.image.tag | toString)) }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
{{- if ne .Release.Name "kustomize" }}
- controller
{{- else }}
# - {all,controller,node} # specify the driver mode
{{- end }}
- --endpoint=$(CSI_ENDPOINT)
{{- if .Values.controller.extraVolumeTags }}
{{- include "aws-ebs-csi-driver.extra-volume-tags" . | nindent 12 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ metadata:
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if eq .Release.Name "kustomize" }}
#Enable if EKS IAM roles for service accounts (IRSA) is used. See https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html for details.
#annotations:
# eks.amazonaws.com/role-arn: arn:<partition>:iam::<account>:role/ebs-csi-role
{{- end }}
{{- if .Values.controller.serviceAccount.automountServiceAccountToken }}
automountServiceAccountToken: {{ .Values.controller.serviceAccount.automountServiceAccountToken }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion deploy/kubernetes/base/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ spec:
image: public.ecr.aws/ebs-csi-driver/aws-ebs-csi-driver:v1.34.0
imagePullPolicy: IfNotPresent
args:
# - {all,controller,node} # specify the driver mode
- controller
- --endpoint=$(CSI_ENDPOINT)
- --batching=true
- --logging-format=text
Expand Down
3 changes: 0 additions & 3 deletions deploy/kubernetes/base/serviceaccount-csi-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,4 @@ metadata:
name: ebs-csi-controller-sa
labels:
app.kubernetes.io/name: aws-ebs-csi-driver
#Enable if EKS IAM roles for service accounts (IRSA) is used. See https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html for details.
#annotations:
# eks.amazonaws.com/role-arn: arn:<partition>:iam::<account>:role/ebs-csi-role
automountServiceAccountToken: true
3 changes: 2 additions & 1 deletion hack/e2e/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ else

set -x
set +e
"${BIN}/kubetest2" noop \
# kubetest2 looks for deployers/testers in $PATH
PATH="${BIN}:${PATH}" "${BIN}/kubetest2" noop \
--run-id="e2e-kubernetes" \
--test=ginkgo \
-- \
Expand Down
17 changes: 11 additions & 6 deletions pkg/cloud/devicemanager/allocator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,22 @@ func TestNameAllocatorLikelyBadName(t *testing.T) {
})
}

// Test likely bad name fallback when it is the only device name available
// We should receive the likely bad device name because it is the only option left
lastName, _ := allocator.GetNext(existingNames, likelyBadNames)
if lastName != skippedNameNew {
t.Errorf("test %q: expected %q, got %q (likelyBadNames fallback)", skippedNameNew, skippedNameNew, lastName)
}
existingNames[skippedNameNew] = ""

// Test likely bad name fallback when the likely bad device name already exists
// Because the device name already exists, this should return an error
onlyExisting := new(sync.Map)
onlyExisting.Store(skippedNameExisting, struct{}{})
_, err := allocator.GetNext(existingNames, onlyExisting)
if err != nil {
if err == nil {
t.Errorf("got nil when error expected (likelyBadNames with only existing names)")
}

lastName, _ := allocator.GetNext(existingNames, likelyBadNames)
if lastName != skippedNameNew {
t.Errorf("test %q: expected %q, got %q (likelyBadNames fallback)", skippedNameNew, skippedNameNew, lastName)
}
}

func TestNameAllocatorError(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/expiringcache/expiring_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
)

const (
testExpiration = time.Millisecond * 50
testSleep = time.Millisecond * 35
testExpiration = time.Millisecond * 100
testSleep = time.Millisecond * 80
testKey = "key"
)

Expand Down
Loading