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

When running an on-prem catalog server, empty values aren't patched #60

Open
asachs01 opened this issue Feb 16, 2023 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@asachs01
Copy link

For context, see internal ref: https://secure.helpscout.net/conversation/2152482078/30839?folderId=5845954.

The main thrust of the issue is this:

Building integrations for our own on-prem Catalog server, I've found that an empty value prevents resource patching. Let me give you an example.

I've added questions which supply parameters to a check command. Many of these parameters are optional, and I'd like to supply empty values ("") to the check command if the question is left blank.

They've provided this example with details:

I have a certificate expiration check, and I'd like to give the user the option to skip CA validation and just look at the expiration dates.

- type: question
name: extra
required: false
input:
type: string
title: Any extra parameters?
description: >-
For example, add "-k" to ignore certificate validation and just check the expiration
default: ""

It would have been cool to make this a boolean instead of a string and automagically add -k to the check command when the user opts for true, but that's a whole other ticket. Instead, I made my question a text string where the user can type in "-k".

Under resource_patches: I have:

- path: /spec/command
op: replace
value: >-
check-cert
-u [[ location ]]
-w [[ warning ]] -c [[ critical ]]
[[ extra ]]

If extra is left blank, the check command is unchanged from sensu-resources.yaml, ignoring values from location and warning and critical. I can kind of work around this one by setting default: " " for extra, as the extra space is harmless to check-cert.

In an internal conversation, the team suggested that instead of doing --warning "[[ warning ]]", to do [[ warning ]] and have it include the warning flag with a default.

However, they provided the following feedback:

Technically, yes, that should work, and I think I'll take this approach for now. However, I believe it presents a poor user experience, since one must carefully position the insertion cursor, instead of just, you know, clicking anywhere in the box and typing what you want. See the attached screeenshot for an example of how this would look.

Screenshot 2023-02-10 at 16-49-58 Sensu

@asachs01 asachs01 added the enhancement New feature or request label Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant