-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add a Stripe settings secret to server #10308
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
Conversation
a914b16
to
85f8bb9
Compare
Whoops,
🤔 |
3008967
to
ce76080
Compare
Aha, maybe it's because payment is disabled? Let's try: /werft run with-payment=true 👍 started the job as gitpod-build-jx-stripe-secret.4 EDIT: Nope, that wasn't it -- still crash-looping. |
ce76080
to
ea4d03e
Compare
@jankeromnes Does not have the volume mounted: Possible reasons:
|
Aha, good point! 🎯 Many thanks @geropl. Will re-trigger Werft with the config from my branch. EDIT: Re-triggered like so:
https://werft.gitpod-dev.com/job/gitpod-custom-jx-stripe-secret.0 |
Stripe secret successfully mounted! 🎉
(Also, Chargebee still works. ✅) Now testing a build without payment... |
Without payment,
and
EDIT: I see that the Chargebee error is just a warning, while the Stripe error is the one that makes However, when payment is disabled (for example in Self-Hosted), I think it would be much nicer to not even try to load Chargebee or Stripe secrets, as opposed to trying + failing + logging (potentially confusing) warnings about payment-related stuff. Attempting to fix this like so: |
ea4d03e
to
9b2df29
Compare
Alright, seems to work fine now! 🎉 Without paymenthttps://werft.gitpod-dev.com/job/gitpod-build-jx-stripe-secret.6 Build succeeded ✅
With paymenthttps://werft.gitpod-dev.com/job/gitpod-custom-jx-stripe-secret.3 Build succeeded ✅
|
Name: "stripe-config", | ||
VolumeSource: corev1.VolumeSource{ | ||
Secret: &corev1.SecretVolumeSource{ | ||
SecretName: stripeSecret, | ||
}, | ||
}, | ||
}) | ||
|
||
volumeMounts = append(volumeMounts, corev1.VolumeMount{ | ||
Name: "stripe-config", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Name: "stripe-config", | |
VolumeSource: corev1.VolumeSource{ | |
Secret: &corev1.SecretVolumeSource{ | |
SecretName: stripeSecret, | |
}, | |
}, | |
}) | |
volumeMounts = append(volumeMounts, corev1.VolumeMount{ | |
Name: "stripe-config", | |
stripeConfigVolumeName = "stripe-config" | |
// ... | |
Name: stripeConfigVolumeName, | |
VolumeSource: corev1.VolumeSource{ | |
Secret: &corev1.SecretVolumeSource{ | |
SecretName: stripeSecret, | |
}, | |
}, | |
}) | |
volumeMounts = append(volumeMounts, corev1.VolumeMount{ | |
Name: stripeConfigVolumeName, |
Because they need to match, they should reference the same variable.
@@ -208,8 +216,9 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) { | |||
ImageBuilderAddr: "image-builder-mk3:8080", | |||
CodeSync: CodeSync{}, | |||
VSXRegistryUrl: fmt.Sprintf("https://open-vsx.%s", ctx.Config.Domain), // todo(sje): or "https://{{ .Values.vsxRegistry.host | default "open-vsx.org" }}" if not using OpenVSX proxy | |||
EnablePayment: chargebeeSecret != "", | |||
EnablePayment: chargebeeSecret != "" || stripeSecret != "", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why put this behind payment? Can we not enable this by default? I'm assuming the secret we have would only go into a test mode of stripe anyway so there's no risk enabling. This would also help remove yet another config option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we want to enable anything Stripe-related in Self-Hosted, where payment is disabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense. However, currently the stripe config is in experimental mode and only configured for preview. That alone should be enough for it to not be deployed in self-hosted. Am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually the other way around, right? I.e. we set EnablePayment
to true if either the chargebeeSecret
or the stripeSecret
is set. 💭
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, that makes more sense. Would it make sense to separate them then? We may want to keep Chargbee enabled, but disable Stripe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the code makes sense as-is. "enablePayment" is a legacy field that we should aim to remove when we kill the chargbee integration. Until we're there, and especially in the context of this PR, it make sense to keep it.
Might make sense to try and remove it from the config surface altogether (and only keep it internall where it make sense) in a separate PR.
@jankeromnes in Self-Hosted neither stripe nor chargebee files are configured, so this is a non-issue. But am ok with the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving changes in self-hosted owned file install/installer/pkg/config/v1/experimental/experimental.go
to unblock this pull request. 🛹
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Many thanks @geropl @easyCZ and @corneliusludmann for the quick & very helpful reviews! 💯
FYI I added the I assumed this would be the same behavior in Self-Hosted -- if I'm right, when you install Self-Hosted, you'll get a warning about Chargebee not being configured. (Not really a big issue though.) |
Description
Add a Stripe settings secret to server, in order to provide the secret key for API calls.
Related Issue(s)
Fixes #
How to test
server
pod)Release Notes
Documentation