-
Notifications
You must be signed in to change notification settings - Fork 56
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: update destination add to use api endpoint #3058
Conversation
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.
The Go changes LGTM, but I notice there is one test failing that needs to be updated for this new validation.
I guess using a heredoc with a values.yaml
file should make the command easier to copy.
@@ -2,8 +2,10 @@ import Head from 'next/head' | |||
import Link from 'next/link' | |||
import { useState, useEffect } from 'react' | |||
import copy from 'copy-to-clipboard' | |||
import yaml from 'js-yaml' |
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.
JSON is valid yaml, so we could potentially avoid this dependency by using JSON.stringify()
and writing it out as JSON.
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.
We could do that but IMO JSON is less user friendly with its quotes and braces and brackets. I don't think it's worth using JSON solely to avoid this dependency.
c2613b6
to
c75420b
Compare
ui/pages/destinations/add.js
Outdated
} | ||
|
||
const valuesYaml = yaml.dump(values) | ||
const command = `cat <<EOF | helm upgrade --install infra-connector infrahq/infra -f-\n${valuesYaml}EOF` |
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.
Can we just do this all with flags? The cat
piping to get multi-line input looks confusing imo
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.
We could. It would look like the previous command snippet. IMO it's actually harder to read and understand. Flags simulate a hierarchy which can easily be overlooked. This makes the relationship between the values clear while also making it easier to edit or append.
Additionally, the settings doesn't translate directly to a values file so if the user wants to adds the outputs to IAC, they'll need to transcribe it into YAML. This way, we can add an option to download the file instead of using a heredoc and the helm
command will remain the same.
8fd6a31
to
a8184ba
Compare
a8184ba
to
e0a26ed
Compare
Summary
api.{baseDomain}
when templating destination add command--set
upgrade --install
instead ofinstall
baseDomain
required when signup is enabled