cdk8s-team / cdk8s-plus

A software development framework that provides high level abstractions for authoring Kubernetes applications.
https://cdk8s.io/docs/latest/plus/
Apache License 2.0
133 stars 33 forks source link

stronger typing for DockerConfigSecret #1243

Open PAStheLoD opened 1 year ago

PAStheLoD commented 1 year ago

Hi,

First of all thanks for this great library!

That said I managed to spend waaay too much time by fiddling around with DockerConfigSecret, before noticing I missed the outer "auths" object.

It would be very useful to have a more descriptive type than simply [key: string]: any for DockerConfigSecretProps.data.

Thanks for considering :)

iliapolo commented 1 year ago

@PAStheLoD What kind of typing do you imagine here? The field can essentially accept any JSON data.

PAStheLoD commented 1 year ago

Thanks for replying!

I understand that k8s accepts whatever, but registries only accept a certain structure. As de facto standardized by Docker. Or am I missing something?

vinayak-kukreja commented 1 year ago

Hey @PAStheLoD,

This is interesting, could you tell us what configuration did not work for you and what error did you see when trying that?

I am trying to understand if this validation could be moved left and we can do that in cdk8s.

github-actions[bot] commented 1 year ago

This issue has not received a response in a while and will be closed soon. If you want to keep it open, please leave a comment below @mentioning a maintainer.

PAStheLoD commented 1 year ago

I don't have access to the repo where I could dig for the code that didn't work, but essentially what it did is to create a "regcred" secret (as is tradition), with a DockerConfigSecret typed value. And I blindly created the data structure with the username and password, and since the TS compiler was happy initially I was too.

And when at the other end of the pipeline I found the usual ImagePullBackOff k8s error, I assumed it's going to be something sinister, like DNS, or ... token lifetime errors, or something like that.

I hope this context helps. Happy to elaborate, if it might be useful.

iliapolo commented 3 months ago

This would be a great addition to cdk8s-plus. Presumably we can codify the docker configuration file.

Marking as p2 and PRs are welcome.