Skip to content
Snippets Groups Projects

Add inline chart values

Merged Hordur Freyr Yngvason requested to merge add-inline-chart-values into master

Adds inline chart values, as discussed in gitlab-org/gitlab#372024 (closed)

  • Add tests?

Manual testing

I set up an agent with the following configuration:

# .gitlab/agents/test/config.yaml
gitops:
  charts:
    - release_name: test
      source:
        project:
          id: agent-playground/test # the agent config project
          path: chart
      values:
        - inline:
            body: the world is gonna

And a minimal chart with the following default values:

# chart/values.yaml
hello: world
body: once told me

and the following config map template:

# chart/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ .Values.hello | quote }}
data:
  some: {{ .Values.body | quote }}

Then, in my cluster, the rendered configmap was:

apiVersion: v1
data:
  some: the world is gonna
kind: ConfigMap
metadata:
  annotations:
    meta.helm.sh/release-name: test
    meta.helm.sh/release-namespace: default
  creationTimestamp: "2022-10-28T15:22:41Z"
  labels:
    app.kubernetes.io/managed-by: Helm
  name: world
  namespace: default
  resourceVersion: "1485"
  uid: 8af001df-555e-453b-871c-a72fb47eab20
Edited by Hordur Freyr Yngvason

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Hordur Freyr Yngvason changed the description

    changed the description

  • added 1 commit

    Compare with previous version

  • Hordur Freyr Yngvason resolved all threads

    resolved all threads

  • Hordur Freyr Yngvason marked this merge request as ready

    marked this merge request as ready

  • Hordur Freyr Yngvason changed the description

    changed the description

  • @Alexand can you please take the first review? Thanks!

  • requested review from @Alexand

  • João Alexandre Cunha
    • Resolved by Hordur Freyr Yngvason

      I've built an image and deployed it with the example shown here. I'm getting agentk logs:

      {"level":"warn","time":"2022-10-31T15:58:43.812Z","msg":"GetConfiguration.Recv failed","error":"rpc error: code = FailedPrecondition desc = Config: failed to parse agent configuration: protojson.Unmarshal: prot │
      │ o: (line 1:126): unknown field \"values\""}

      Agentk version when describing the pod looks ok:

      Image:         registry.gitlab.com/gitlab-org/cluster-integration/gitlab-agent/agentk:56caa6d-amd64-race

      Are we missing something?

      The only thing I've noticed is that I haven't added a Chart.yml. Were you able to deploy this without one, or just didn't mention it in the description?

      I'll also run the code locally instead of building an image to see what's the difference.

      Edited by João Alexandre Cunha
  • Thanks @Alexand! I've responded to all of your questions. Let me know if there's anything else :ping_pong:

  • João Alexandre Cunha resolved all threads

    resolved all threads

  • João Alexandre Cunha approved this merge request

    approved this merge request

  • Thanks, @hfyngvason. This LGTM! :bow_tone1:

    What is the guideline here? Should I forward the MR review to Mikhail after my first approval and vice versa?

  • João Alexandre Cunha removed review request for @Alexand

    removed review request for @Alexand

  • requested review from @ash2k

  • Mikhail Mazurskiy
  • Mikhail Mazurskiy
  • added 3 commits

    Compare with previous version

  • added 1 commit

    • f2dbda1e - Call loadValues before jobCancel

    Compare with previous version

  • added 2 commits

    Compare with previous version

  • Mikhail Mazurskiy
  • Mikhail Mazurskiy
  • added 1 commit

    Compare with previous version

  • added 1 commit

    • 5f756cf5 - Test that empty ChartValuesCF is invalid

    Compare with previous version

  • added 1 commit

    • cc9baf9e - Panic on unhandled ChartValuesCF.As type

    Compare with previous version

  • added 1 commit

    • 78c4f46d - Apply 1 suggestion(s) to 1 file(s)

    Compare with previous version

  • Mikhail Mazurskiy
  • added 1 commit

    • e2afb337 - Apply 1 suggestion(s) to 1 file(s)

    Compare with previous version

  • Mikhail Mazurskiy approved this merge request

    approved this merge request

  • Mikhail Mazurskiy resolved all threads

    resolved all threads

  • Mikhail Mazurskiy enabled automatic add to merge train when the pipeline for a82a9571 succeeds

    enabled automatic add to merge train when the pipeline for a82a9571 succeeds

  • Mikhail Mazurskiy started a merge train

    started a merge train

  • mentioned in commit 18b22d8c

  • Hordur Freyr Yngvason marked the checklist item Add tests? as completed

    marked the checklist item Add tests? as completed

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading