-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
volumecontext
package for accessing volume context from CSI (#340)
Splitted out of #328. This might not make sense since it's moved out of its original context, but the original motivation was that these constants was spread out to different packages and that was causing circular dependencies. For example, if you need to use `VolumeCtxBucketName` in `pkg/driver/node/mounter` package, you'd need to import `pkg/driver/node` package which would cause a circular dependency as `pkg/driver/node` imports `pkg/driver/node/mounter`. In situations like that, it's best to extract common things into a leaf package that doesn't import anything, which is what this PR does with `pkg/driver/node/volumecontext` package. It also makes finding these volume context keys easier by placing them into a singular place. --- By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. --------- Signed-off-by: Burak Varlı <[email protected]>
- Loading branch information
Showing
3 changed files
with
39 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Package volumecontext provides utilities for accessing volume context passed via CSI RPC. | ||
package volumecontext | ||
|
||
const ( | ||
BucketName = "bucketName" | ||
AuthenticationSource = "authenticationSource" | ||
STSRegion = "stsRegion" | ||
|
||
CSIServiceAccountName = "csi.storage.k8s.io/serviceAccount.name" | ||
CSIServiceAccountTokens = "csi.storage.k8s.io/serviceAccount.tokens" | ||
CSIPodNamespace = "csi.storage.k8s.io/pod.namespace" | ||
CSIPodUID = "csi.storage.k8s.io/pod.uid" | ||
) |