GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Embed Notice

HTML Code

Corresponding Notice

  1. Embed this notice
    varx/tech (varx@infosec.exchange)'s status on Tuesday, 27-Jun-2023 00:05:40 JSTvarx/techvarx/tech
    in reply to

    OK, here we go: A way to inject a string value inside a #YAML string in #Helm chart templates!

    You won't like this.

    "... {{ $someValue | quote | substr 1 (int (sub ($someValue | quote | len) 1)) }} ..."

    I promise you that this is one of *less* terrible ways of performing this extremely fundamental operation.

    EDIT: Good news! I've golfed it down to just two function calls:

    "... {{ regexReplaceAll "^\"|\"$" (quote $someValue) "" }} ..."

    This quotes and escapes the value, then uses a regex to remove just the beginning and ending quote, and finally interpolates it into the larger double-quoted flow scalar.

    In conversationTuesday, 27-Jun-2023 00:05:40 JST from infosec.exchangepermalink
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.