-
Notifications
You must be signed in to change notification settings - Fork 29
Is it possible to avoid specification of protocol twice? #24
Comments
Good observation @BlaineEXE |
@BlaineEXE without the name, we wouldn't be able to disambiguate between no options and default options. In case of pvc, the emptyDir you've specified is interpreted as a nil value. It only works because emptyDir is the default volume type (https://github.com/kubernetes/api/blob/master/core/v1/types.go#L43). This would give you the same result
In case of protocol, we cannot assume a default like that. |
I don't believe that is quite correct. I did an experiment in Rook with the Protocol. I think the secret is to set the I added the below CRD spec to Rook and types for the protocols to test. protocol:
properties:
azureBlob:
properties:
containerName:
type: string
storageAccount:
type: string
type: object
nullable: true
gcs:
properties:
bucketName:
type: string
privateKeyName:
type: string
projectID:
type: string
serviceAccount:
type: string
type: object
nullable: true
s3:
properties:
bucketName:
type: string
endpoint:
type: string
region:
type: string
signatureVersion:
enum:
- s3v2
- s3v4
type: string
type: object
nullable: true
type: object I put nothing in the manifest to get nil specs for all. (golang print
I put this in the manifest to get a non-nil S3 spec. protocol:
s3: {}
This should allow testing for non-nil to see if anything is present, even if nothing is actually specified. |
I see, tbh I'm not opposed to this - There is one more concern to address though. This protocol structure is going to be sent to the application that consumes the bucket. If the application parser cannot disambiguate between default and nil values, that would make drivers buggy and put extra load the vendors writing the driver. Is there someway we can address that? Note that the application parser will not understand CRD spec |
That's a good point. I think I have some questions to better understand COSI's operation around this since I don't have as deep an understanding. The whole Cursory thoughts: If it's sent via Go code, then COSI can still send nil for non-selected protocols. If it's sent to apps via k8s resource and is mostly an internal detail to COSI, then protocolName could be sent to applications additionally based on a Go If there are no longer any high-level options in the |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-contributor-experience at kubernetes/community. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-contributor-experience at kubernetes/community. |
Rotten issues close after 30d of inactivity. Send feedback to sig-contributor-experience at kubernetes/community. |
@k8s-triage-robot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
added kustomize template & k8s resources for sidecar
added kustomize template & k8s resources for sidecar
fake client: code gen added
https://github.com/kubernetes-sigs/container-object-storage-interface-api/blob/7c26b4fc1ed9e719cd3342f2666c855260930cc9/apis/objectstorage.k8s.io/v1alpha1/protocol_types.go#L28-L37
Do we need to include
Name
as well as the different protocol options? This makes it so that whenever options are included, users must specify their choice twice: once inName
and once implicitly in the protocol spec. E.g.,K8s volume claims use a syntax where the option itself implicitly specifies the option desired. E.g.,
Does it make sense to follow that pattern for the protocol also? Like below would be an S3 config with no options set.
The text was updated successfully, but these errors were encountered: