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

feat: extends mounted secret api #5707

Merged
merged 8 commits into from
Sep 12, 2023

Conversation

TomChv
Copy link
Member

@TomChv TomChv commented Aug 28, 2023

Resolves: #3323

@TomChv TomChv added the area/engine About dagger core engine label Aug 28, 2023
@TomChv TomChv requested review from vito and sipsma August 28, 2023 21:48
@TomChv TomChv self-assigned this Aug 28, 2023
@TomChv TomChv requested a review from a team as a code owner August 28, 2023 21:48
@TomChv
Copy link
Member Author

TomChv commented Aug 28, 2023

Only netlify failed, not related to the PR, I add the release note and we're good to merge

@TomChv TomChv requested a review from a team as a code owner August 28, 2023 22:41
@helderco
Copy link
Contributor

@TomChv, don't create changie logs in SDKs if it's just the auto-generated code. This should just be an engine change. Each SDK release points to the engine release it's compatible with, and the change will be listed there.

@TomChv TomChv force-pushed the feat/extends-mounted-secret-api branch from d5e763e to 187d879 Compare August 31, 2023 11:58
@TomChv
Copy link
Member Author

TomChv commented Aug 31, 2023

@wingyplus PR updated, I switched back to camelcase
@helderco changelogs removed

Copy link
Contributor

@wingyplus wingyplus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a little change.

core/schema/container.graphqls Outdated Show resolved Hide resolved
@TomChv
Copy link
Member Author

TomChv commented Aug 31, 2023

Just a little change.

I regenerate all clients and we shall be good to merge

@wingyplus
Copy link
Contributor

LGTM. 🚀

"""
Permission given to the mounted secret (e.g., 0600).

Default: 0644.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Default: 0644.
Default: 0400.

Copy link
Contributor

@vito vito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation LGTM, just some issues with the GraphQL docs and test.

Optional: true,
})

_, err := ctr.WithExec([]string{"sh", "-c", "test $(cat /secret) = 'secret'"}).Sync(ctx)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can tell, this test doesn't actually check whether the secret was optional, or that the configured mode was respected. I think we need a test for each. You can run stat to see the mode, and test -z "$(cat /secret)" to test that it's empty.

Copy link
Member Author

@TomChv TomChv Sep 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed the test and doc, but I'm not sure about optional? How can I mount an actual optional secret? @vito

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it seems like you can't, so I wouldn't bother including an API for it. In Buildkit this is a thing because secret names are configured in a Dockerfile and optionally provided by the user separately, but Dagger handles both together; an optional secret would probably just amount to passing an empty string to SetSecret.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then should I remove the option?

Copy link
Contributor

@vito vito Sep 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, if we can't come up with a test for it, to me that proves that we don't need it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in e833f5d

TomChv and others added 8 commits September 11, 2023 22:20
Resolves: dagger#3323
Signed-off-by: Vasek - Tom C <tom@epitech.eu>
Signed-off-by: Vasek - Tom C <tom@epitech.eu>
Signed-off-by: Vasek - Tom C <tom@epitech.eu>
Signed-off-by: Vasek - Tom C <tom@epitech.eu>
Co-authored-by: Thanabodee Charoenpiriyakij <wingyminus@gmail.com>
Signed-off-by: Vasek - Tom C <tom@quartz.technology>
Signed-off-by: Vasek - Tom C <tom@epitech.eu>
Signed-off-by: Vasek - Tom C <tom@epitech.eu>
Signed-off-by: Vasek - Tom C <tom@epitech.eu>
@TomChv TomChv force-pushed the feat/extends-mounted-secret-api branch from 49f2752 to e833f5d Compare September 11, 2023 20:40
Copy link
Contributor

@vito vito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@TomChv TomChv merged commit 1ddf4ea into dagger:main Sep 12, 2023
32 checks passed
@gerhard gerhard added this to the v0.8.5 milestone Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/engine About dagger core engine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support configuring additional options for secrets
5 participants