Repository navigation
perf(gateway): raise upstream DNS cache TTL #3596
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
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: theopenco/llmgateway
Length of output: 200
🏁 Script executed:
Repository: theopenco/llmgateway
Length of output: 50376
🏁 Script executed:
Repository: theopenco/llmgateway
Length of output: 10796
🌐 Web query:
Helm official documentationtoStringempty string unset valueifnumeric zero💡 Result:
In Helm templates, both numeric zero (0) and an empty string ("") are treated as "empty" or "false" in conditional
ifstatements and by functions likedefault[1][2][3]. This behavior originates from the Gotext/templateengine and the Sprig library, which define "empty" values to include numeric zero, empty strings, booleanfalse, andnil[4][5]. Key technical details: 1. ConditionalifEvaluation: A pipeline in anifblock is evaluated asfalseif the value is a numeric0, an empty string"",false,nil, or an empty collection [1][3]. Consequently,{{ if .Values.myValue }}will evaluate to false ifmyValueis set to0or""[2][3]. 2.defaultFunction: Thedefaultfunction considers both0and""to be "unset" or "empty" [6][5]. If you providedefault "my-default" 0, the output will be"my-default"because the function treats0as a value that needs to be replaced [6][2]. 3.toStringBehavior: ThetoStringfunction converts its input into a string representation [4][7]. Importantly, callingtoStringon a numeric0results in the string"0". Since"0"is a non-empty string, it is considered "truthy" in a conditionalifstatement [3]. Workarounds: To differentiate between a missing value and a numeric zero, you cannot rely on simpleifchecks [2]. Common strategies include: * Explicit Type Checks: Useeq .Values.myValue 0(if type compatibility allows) or explicit equality checks againstnil(e.g.,{{ if not (eq .Values.myValue nil) }}) [2][8]. * String Conversion Trick: Convert the value to a string first to check its existence, as"0"evaluates to true while""evaluates to false [9][10]. For example:{{ if or (eq (toString .Values.myValue) "0") .Values.myValue }}[9]. * DirectnilComparison: Use{{ eq .Values.myValue nil }}to verify if the value was provided at all, regardless of whether it is zero or empty [8].Citations:
defaulttemplate function treats 0 value as unspecified helm/helm#13036🏁 Script executed:
Repository: theopenco/llmgateway
Length of output: 237
Preserve numeric zero overrides.
When either setting is
0, Helm treats the currentifcondition as false and omits the environment variable.envIntaccepts0, and a DNS TTL of0disables the DNS interceptor. Usene (toString .value) ""for both settings and add a Helm render test for numeric0.🤖 Prompt for AI Agents
Source: MCP tools