Skip to content

Accept optional strings as number arguments #3766

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

Merged
merged 2 commits into from
Jun 17, 2025
Merged

Conversation

ptodev
Copy link
Contributor

@ptodev ptodev commented Jun 3, 2025

PR Description

Currently, if you try to assign a non-secret optional secret to a number argument, you'll get an error should be number, got capsule. For example, this generates an error:

local.file "test" {
  filename  = "/Users/paulintodev/Desktop/test_input.txt"
  is_secret = false
}

prometheus.remote_write "mimir" {
  endpoint {
    ...
    queue_config {
        max_samples_per_send = local.file.samples.content
    }
  }
}

On the other hand, this wouldn't generate an error:

prometheus.remote_write "mimir" {
  endpoint {
    ...
    queue_config {
        max_samples_per_send = "1000"
    }
  }
}

The behaviour of a non-secret optional secret and that of a string needs to be consistent, so this PR will fix it.

PR Checklist

  • CHANGELOG.md updated
  • Documentation added
  • Tests updated
  • Config converters updated

@ptodev ptodev requested a review from a team as a code owner June 3, 2025 13:50
@ptodev ptodev force-pushed the ptodev/fix-optional branch from 9841a29 to 9fd5d67 Compare June 4, 2025 10:38
@ptodev ptodev force-pushed the ptodev/fix-optional branch from 9fd5d67 to 6e8558b Compare June 17, 2025 16:45
@ptodev ptodev merged commit 115dfef into main Jun 17, 2025
40 checks passed
@ptodev ptodev deleted the ptodev/fix-optional branch June 17, 2025 17:11
ptodev added a commit that referenced this pull request Jun 25, 2025
* Accept optional strings

* Use "tryCapsuleConvert" instead of "ConvertInto"
ptodev added a commit that referenced this pull request Jun 25, 2025
* Add livedebugging service to validator services list (#3785)

* Add livedebugging service to validator list

* Update changelog

* Accept optional strings as number arguments (#3766)

* Accept optional strings

* Use "tryCapsuleConvert" instead of "ConvertInto"

* fix(ebpf): python typecheck type before reading type name (#3797)

* Retry initializing informers to allow for network instability on node restart (#3688)

* Retry initializing informers to allow for network instability on node restart

* use dskit backoff

* return error on failure

* Run go mod tidy

---------

Co-authored-by: Sam DeHaan <[email protected]>
Co-authored-by: Tolya Korniltsev <[email protected]>
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