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

lndinit: add ability to write to k8s configmap #38

Merged
merged 1 commit into from
Jan 19, 2024

Conversation

calvinrzachman
Copy link
Contributor

This PR equips lndinit with the ability to write arbitrary key/value data to a Kubernetes Configmap object.

  • Modeled heavily of existing store-secret command.
  • Leverage the fact that secret/configmap entries are very similar save for secrets are base64 encoded.
  • TODO: See if we can slim the diff and cut down on similarity between processing for secrets & configmaps.

@calvinrzachman calvinrzachman self-assigned this Jan 16, 2024
@calvinrzachman calvinrzachman force-pushed the store-configmap branch 3 times, most recently from a9c7110 to 60df4b7 Compare January 16, 2024 15:57
ObjectTypeConfigMap k8sObjectType = "ConfigMap"
)

type k8sObjectOptions struct {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the rename of the CLI flag to the more general --k8s.name is not preferred, we could just make a separate k8sConfigmapOptions struct.

Copy link
Member

@guggero guggero left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!
Very useful new function.

Main comment is about not breaking existing users by renaming flags. So we'd rather have some duplicated code.
I'll do a full review with manual tests once the diff is updated.

cmd_init_wallet.go Outdated Show resolved Hide resolved
cmd_store_configmap.go Outdated Show resolved Hide resolved
example-init-wallet-k8s.sh Outdated Show resolved Hide resolved
@calvinrzachman calvinrzachman force-pushed the store-configmap branch 5 times, most recently from ba436e9 to d23278b Compare January 18, 2024 15:36
Copy link
Member

@guggero guggero left a comment

Choose a reason for hiding this comment

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

utACK, LGTM 🎉

k8s.go Show resolved Hide resolved
k8s.go Outdated Show resolved Hide resolved
We'll use this to write connection relateed information
for consumption by payment service proxy.
@guggero guggero merged commit b8348e3 into lightninglabs:main Jan 19, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants