Skip to content

Commit

Permalink
feat: add argocd
Browse files Browse the repository at this point in the history
  • Loading branch information
ajgon committed Sep 27, 2024
1 parent 13774e0 commit ac9b50e
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"github>deedee-ops/containers//.github/renovate/autoMerge.json5",
"github>deedee-ops/containers//.github/renovate/commitMessage.json5",
"github>deedee-ops/containers//.github/renovate/customManagers.json5",
"github>deedee-ops/containers//.github/renovate/customVersions.json5",
"github>deedee-ops/containers//.github/renovate/labels.json5",
"github>deedee-ops/containers//.github/renovate/semanticCommits.json5"
],
Expand Down
10 changes: 10 additions & 0 deletions .github/renovate/customVersions.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"packageRules": [
{
"matchPackageNames": ["argocd"],
"allowedVersions": "/^[0-9]+\\.[0-9]+\\.[0-9]+(\\.[0-9]+)?$/"
}
]
}

29 changes: 29 additions & 0 deletions apps/argocd/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
ARG TARGETPLATFORM
ARG VERSION

FROM ghcr.io/deedee-ops/ubuntu:22.04 AS builder

WORKDIR /usr/src

#hadolint ignore=DL3008
RUN apt-get update \
&& apt-get install --yes --no-install-recommends bash build-essential git gnupg2 software-properties-common \
&& add-apt-repository ppa:longsleep/golang-backports -y \
&& apt-get update \
&& apt-get install --yes --no-install-recommends golang-go \
&& git clone --depth 1 --branch release-3.16 https://github.com/helm/helm

WORKDIR /usr/src/helm

COPY nullify-subchart-values.patch /usr/src/helm/

RUN patch -p1 < nullify-subchart-values.patch \
&& make

FROM quay.io/argoproj/argocd:v${VERSION}

COPY --chmod=0755 --chown=0:0 --from=builder /usr/src/helm/bin/helm /usr/local/bin/helm

ENTRYPOINT ["/usr/bin/tini", "--"]

LABEL org.opencontainers.image.source="https://github.com/argoproj/argo-cd/"
17 changes: 17 additions & 0 deletions apps/argocd/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"app": "argocd",
"base": false,
"testMuteCmd": true,
"channels": [
{
"name": "stable",
"renovate::dataSource": "docker",
"renovate::depName": "quay.io/argoproj/argocd",
"version": "2.12.4",
"platforms": [
"linux/amd64",
"linux/arm64"
]
}
]
}
40 changes: 40 additions & 0 deletions apps/argocd/nullify-subchart-values.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
From 5a58751a053ea59b88399487a5f0f8f5c27b9461 Mon Sep 17 00:00:00 2001
From: Ryan Hockstad <[email protected]>
Date: Wed, 13 Mar 2024 18:17:00 -0400
Subject: [PATCH] merge null child chart objects

Signed-off-by: Ryan Hockstad <[email protected]>
---
pkg/chartutil/coalesce.go | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/pkg/chartutil/coalesce.go b/pkg/chartutil/coalesce.go
index f0272fd6abc..40bce2a68e4 100644
--- a/pkg/chartutil/coalesce.go
+++ b/pkg/chartutil/coalesce.go
@@ -237,6 +237,9 @@ func coalesceValues(printf printFn, c *chart.Chart, v map[string]interface{}, pr
printf("warning: skipped value for %s.%s: Not a table.", subPrefix, key)
}
} else {
+ // If the key is a child chart, coalesce tables with Merge set to true
+ merge := childChartMergeTrue(c, key, merge)
+
// Because v has higher precedence than nv, dest values override src
// values.
coalesceTablesFullKey(printf, dest, src, concatPrefix(subPrefix, key), merge)
@@ -249,6 +252,15 @@ func coalesceValues(printf printFn, c *chart.Chart, v map[string]interface{}, pr
}
}

+func childChartMergeTrue(chrt *chart.Chart, key string, merge bool) bool {
+ for _, subchart := range chrt.Dependencies() {
+ if subchart.Name() == key {
+ return true
+ }
+ }
+ return merge
+}
+
// CoalesceTables merges a source map into a destination map.
//
// dest is considered authoritative.

0 comments on commit ac9b50e

Please sign in to comment.