Skip to content
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

Move from @1debit to @chime #24

Merged
merged 4 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @1debit/infrastructure-eng
* @chime/maintainers
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# mani-diffy

![Tests](https://github.com/1debit/mani-diffy/actions/workflows/tests.yaml/badge.svg)
![Tests](https://github.com/chime/mani-diffy/actions/workflows/tests.yaml/badge.svg)

This program walks a hierarchy of Argo CD Application templates, renders Kubernetes manifests from the input templates, and posts the rendered files back for the user to review and validate.
This program walks a hierarchy of Argo CD Application templates, renders Kubernetes manifests from the input templates, and posts the rendered files back for the user to review and validate.

It is designed to be called from a CI job within a pull request, enabling the author to update templates and see the resulting manifests directly within the pull request before the changes are applied to the Kubernetes cluster.
It is designed to be called from a CI job within a pull request, enabling the author to update templates and see the resulting manifests directly within the pull request before the changes are applied to the Kubernetes cluster.

The rendered manifests are kept within the repository, making diffs between revisions easy to parse, dramatically improving safety when updating complex application templates.

Expand All @@ -19,8 +19,8 @@ The rendered manifests are kept within the repository, making diffs between revi

🫵 Submit a PR where you make a change to the overrides of the [`demo`](demo/README.md), and you'll see the [Github action]( [README](../../.github/workflows/generate-manifests-demos.yaml)) add a commit to your PR with the resulting changes.

<img width="1099" alt="1" src="https://github.com/1debit/mani-diffy/assets/9005904/6b6d9e45-57f7-43ff-906f-ebf4c0a03ad9">
<img width="1701" alt="2" src="https://github.com/1debit/mani-diffy/assets/9005904/03d4a49e-1fc9-40a1-9882-1c032b2d345b">
<img width="1099" alt="1" src="https://github.com/chime/mani-diffy/assets/9005904/6b6d9e45-57f7-43ff-906f-ebf4c0a03ad9">
<img width="1701" alt="2" src="https://github.com/chime/mani-diffy/assets/9005904/03d4a49e-1fc9-40a1-9882-1c032b2d345b">

# See it in action in a video !

Expand All @@ -29,7 +29,7 @@ In this screen recording a pull request is opened to make the following changes
1. Bump the count of pods for the `foo` service in the prod cluster
2. Add an annotation to all services

https://github.com/1debit/mani-diffy/assets/9005904/6c496996-f7af-4932-bf5d-01a5b57bbd99
https://github.com/chime/mani-diffy/assets/9005904/6c496996-f7af-4932-bf5d-01a5b57bbd99


## Post Renderers
Expand All @@ -44,7 +44,7 @@ The command will be called with the output directory as the first argument (e.g.

---

## Pre-requisites
## Pre-requisites

This is for a new user that is looking to use mani-diffy on a new repo.

Expand All @@ -55,7 +55,7 @@ In order to make use of mani-diffy on the repo that holds all of your ArgoCD app

`mani-diffy` itself makes no assumptions about how the repo is structured, as long as it can successfully render the charts it encounters while walking the Application tree.

However, you may find it useful to organize your repo similarly to the demo app, with 3 key directories :
However, you may find it useful to organize your repo similarly to the demo app, with 3 key directories :

1. a "root" or "bootstrap" directory that holds all the ArgoCD applications manifests.
2. a "charts" directory that contains all the helm charts needed for the ArgoCD applications.
Expand Down
4 changes: 2 additions & 2 deletions demo/.zz.auto-generated/prod-app-group-1/manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
server: https://kubernetes.default.svc
project: default
source:
repoURL: https://github.com/1debit/mani-diffy.git
repoURL: https://github.com/chime/mani-diffy.git
path: charts/service
helm:
version: v3
Expand All @@ -34,7 +34,7 @@ spec:
server: https://kubernetes.default.svc
project: default
source:
repoURL: https://github.com/1debit/mani-diffy.git
repoURL: https://github.com/chime/mani-diffy.git
path: charts/service
helm:
version: v3
Expand Down
2 changes: 1 addition & 1 deletion demo/.zz.auto-generated/prod-cluster/manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
server: https://kubernetes.default.svc
project: default
source:
repoURL: https://github.com/1debit/mani-diffy.git
repoURL: https://github.com/chime/mani-diffy.git
targetRevision: HEAD

path: charts/app-of-apps
Expand Down
6 changes: 3 additions & 3 deletions demo/.zz.auto-generated/test-app-group-1/manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
server: https://kubernetes.default.svc
project: default
source:
repoURL: https://github.com/1debit/mani-diffy.git
repoURL: https://github.com/chime/mani-diffy.git
path: charts/service
helm:
version: v3
Expand All @@ -34,7 +34,7 @@ spec:
server: https://kubernetes.default.svc
project: default
source:
repoURL: https://github.com/1debit/mani-diffy.git
repoURL: https://github.com/chime/mani-diffy.git
path: charts/service
helm:
version: v3
Expand All @@ -58,7 +58,7 @@ spec:
server: https://kubernetes.default.svc
project: default
source:
repoURL: https://github.com/1debit/mani-diffy.git
repoURL: https://github.com/chime/mani-diffy.git
path: charts/service
helm:
version: v3
Expand Down
2 changes: 1 addition & 1 deletion demo/.zz.auto-generated/test-cluster/manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
server: https://kubernetes.default.svc
project: default
source:
repoURL: https://github.com/1debit/mani-diffy.git
repoURL: https://github.com/chime/mani-diffy.git
targetRevision: HEAD

path: charts/app-of-apps
Expand Down
2 changes: 1 addition & 1 deletion demo/bootstrap/prod-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
valueFiles:
- ../../overrides/bootstrap/prod-cluster.yaml
path: charts/app-of-apps
repoURL: https://github.com/1debit/mani-diffy.git
repoURL: https://github.com/chime/mani-diffy.git
targetRevision: HEAD
syncPolicy:
syncOptions:
Expand Down
2 changes: 1 addition & 1 deletion demo/bootstrap/test-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
valueFiles:
- ../../overrides/bootstrap/test-cluster.yaml
path: charts/app-of-apps
repoURL: https://github.com/1debit/mani-diffy.git
repoURL: https://github.com/chime/mani-diffy.git
targetRevision: HEAD
syncPolicy:
syncOptions:
Expand Down
2 changes: 1 addition & 1 deletion demo/charts/app-of-apps/templates/app-of-apps.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
server: https://kubernetes.default.svc
project: default
source:
repoURL: https://github.com/1debit/mani-diffy.git
repoURL: https://github.com/chime/mani-diffy.git
targetRevision: HEAD

path: charts/app-of-apps
Expand Down
2 changes: 1 addition & 1 deletion demo/charts/app-of-apps/templates/service.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
server: https://kubernetes.default.svc
project: default
source:
repoURL: https://github.com/1debit/mani-diffy.git
repoURL: https://github.com/chime/mani-diffy.git
path: charts/service
helm:
version: v3
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/1debit/mani-diffy
module github.com/chime/mani-diffy

go 1.20

Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"strings"
"time"

"github.com/1debit/mani-diffy/pkg/helm"
"github.com/1debit/mani-diffy/pkg/kustomize"
"github.com/chime/mani-diffy/pkg/helm"
"github.com/chime/mani-diffy/pkg/kustomize"

"github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/helm/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (
"strings"
"sync"

"github.com/1debit/mani-diffy/pkg/kustomize"
"github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1"
"github.com/chime/mani-diffy/pkg/kustomize"
yamlutil "k8s.io/apimachinery/pkg/util/yaml"
)

Expand Down
6 changes: 3 additions & 3 deletions pkg/helm/helm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ func TestGenerateHashOnCrd(t *testing.T) {
crd := data[0]

hash, err := generateHashOnCrd(crd)
if err != nil || hash != "fba38c4479874778a2e0bf38c2e94f83d57d9f24c9c7d71e123bc5c1961ed936" {
t.Error("Failed to generate correctly")
if err != nil || hash != "7bfd65e963e76680dc5160b6a55c04c3d9780c84aee1413ae710e4b5279cfe14" {
t.Errorf("Failed to generate correctly, got %s", hash)
}
}

Expand Down Expand Up @@ -300,7 +300,7 @@ func TestDifferenceInTwoDifferentFiles(t *testing.T) {
func TestGenerateHashOnChart(t *testing.T) {
hash, _ := generalHashFunction("demo/charts/app-of-apps")
h := hex.EncodeToString(hash)
actualHash := "95630c1ec9b835536a3056d4dcbbd6e023111c5e4340ac80b945c2e3a4f8fc42"
actualHash := "13aa148adefa3d633e5ce95584d3c95297a4417977837040cd67f0afbca17b5a"
if h != actualHash {
t.Errorf("Failed to generate a generic hash on a chart. got: %s wanted: %s", h, actualHash)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/helm/test_files/crdData_multiple_crd_testfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
valueFiles:
- ../../overrides/bootstrap/prod-cluster.yaml
path: charts/app-of-apps
repoURL: https://github.com/1debit/mani-diffy
repoURL: https://github.com/chime/mani-diffy
targetRevision: HEAD
syncPolicy:
syncOptions:
Expand All @@ -45,7 +45,7 @@ spec:
valueFiles:
- ../../overrides/bootstrap/test-cluster.yaml
path: charts/app-of-apps
repoURL: https://github.com/1debit/mani-diffy
repoURL: https://github.com/chime/mani-diffy
targetRevision: HEAD
syncPolicy:
syncOptions:
Expand Down
2 changes: 1 addition & 1 deletion pkg/helm/test_files/crdData_testfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
valueFiles:
- ../../overrides/bootstrap/prod-cluster.yaml
path: demo/charts/app-of-apps
repoURL: https://github.com/1debit/mani-diffy
repoURL: https://github.com/chime/mani-diffy
targetRevision: HEAD
syncPolicy:
syncOptions:
Expand Down
2 changes: 1 addition & 1 deletion pkg/helm/test_files/crdData_testfile_2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
- ../../overrides/bootstrap/prod-cluster.yaml
- ../../overrides/bootstrap/fake_file.yaml
path: charts/app-of-apps
repoURL: https://github.com/1debit/mani-diffy
repoURL: https://github.com/chime/mani-diffy
targetRevision: HEAD
syncPolicy:
syncOptions:
Expand Down
Loading