Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
32cfcfc
feat: added central caching
fritzduchardt Mar 24, 2024
667822a
Merge branch 'main' into central-cache
fritzduchardt Mar 24, 2024
18b4e05
Formatting
fritzduchardt Mar 24, 2024
8c9e116
Merge branch 'central-cache' of github.com:mykso/myks into central-cache
fritzduchardt Mar 24, 2024
6cdf637
Merge branch 'main' into central-cache
Zebradil Mar 31, 2024
fd8eb38
Ensure that all service files are stored under .myks
fritzduchardt Mar 31, 2024
5907433
Ignore .myks and .vendor
fritzduchardt Mar 31, 2024
1b5c412
Remove obsolete service files
fritzduchardt Mar 31, 2024
0df9421
Adressed some linting issues
fritzduchardt Mar 31, 2024
7663d7b
Merge branch 'central-cache' of github.com:mykso/myks into central-cache
fritzduchardt Mar 31, 2024
d62def2
Remove obsolete service files
fritzduchardt Mar 31, 2024
c8bc474
Adressed some more linting issues
fritzduchardt Mar 31, 2024
873571a
Switch hash function for shorter safer hash value
fritzduchardt Mar 31, 2024
8db1af3
Fix test
fritzduchardt Mar 31, 2024
9014544
Move and rename cache dir
fritzduchardt Apr 7, 2024
b82632f
Made cached directory names more readable
fritzduchardt Apr 7, 2024
4b6648e
Added global flag to disable cache
fritzduchardt Apr 7, 2024
6845a1e
fix hash calculation
Zebradil Apr 7, 2024
fba69cb
Merge remote-tracking branch 'origin/main' into central-cache
Zebradil Apr 7, 2024
8677cf2
fix hash calculation stronger
Zebradil Apr 7, 2024
3eb64cc
small refactoring
Zebradil Apr 7, 2024
2517d3a
change variable name to avoid shadowing one from outer scope
Zebradil Apr 7, 2024
f56c255
fix hash in tests
Zebradil Apr 7, 2024
0421c9d
sync only one contents item per directory in vendir config
Zebradil Apr 7, 2024
0bded65
fix multi-chart vendir configs, simplify code
Zebradil Apr 8, 2024
8a8559e
linter warnings
Zebradil Apr 8, 2024
40e7baf
Merge branch 'main' into central-cache
Zebradil Apr 11, 2024
a9a3a3c
Ensure sync is always run after cache invalidation.
fritzduchardt Apr 14, 2024
b39e452
Merge remote-tracking branch 'origin/main' into central-cache
Zebradil Apr 20, 2024
e5dc74b
Merge remote-tracking branch 'origin/main' into central-cache
Zebradil Apr 20, 2024
46ca903
Merge remote-tracking branch 'origin/main' into central-cache
Zebradil Apr 20, 2024
c4934cc
move integration tests charts deeper into _lib
Zebradil Apr 21, 2024
63d4ff1
add currently failing test case with multiple sources
Zebradil Apr 21, 2024
5d2e288
fix integration tests
Zebradil Apr 22, 2024
4eb84a5
fix integration tests
Zebradil Apr 22, 2024
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
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ bin/*
dist
.idea
.run
/myks
**/.myks/tmp
.myks
.vendor
coverage.txt
vendor/
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kind: rendering
metadata:
name: render-test
name: helm-{{ .Release.Name }}
outputYaml:
{{ toYaml .Values.outputYaml | indent 2 }}
4 changes: 4 additions & 0 deletions examples/_lib/ytt/render-test-1/all.ytt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
kind: rendering
metadata:
name: ytt-render-test-1
4 changes: 4 additions & 0 deletions examples/_lib/ytt/render-test-2/all.ytt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
kind: rendering
metadata:
name: ytt-render-test-2

This file was deleted.

12 changes: 0 additions & 12 deletions examples/default/envs/mykso/dev/_apps/argocd/.myks/vendir.yaml

This file was deleted.

This file was deleted.

20 changes: 0 additions & 20 deletions examples/default/envs/mykso/dev/_apps/goldpinger/.myks/vendir.yaml

This file was deleted.

This file was deleted.

This file was deleted.

11 changes: 0 additions & 11 deletions examples/default/envs/mykso/dev/_apps/httpbingo/.myks/vendir.yaml

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 1 addition & 0 deletions examples/integration-tests/envs/dev/env-data.ytt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ environment:
applications:
- proto: helm-render-test
name: helm-installation
- proto: multiple-sources
- proto: ytt-render-test
name: ytt-installation
- proto: static-test
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ directories:
contents:
- path: .
directory:
path: ../charts/render-test-chart
path: ../_lib/charts/render-test-chart
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: vendir.k14s.io/v1alpha1
kind: Config
directories:
- path: charts/render-test-1
contents:
- path: .
directory:
path: ../_lib/charts/render-test-chart
- path: charts/render-test-2
contents:
- path: .
directory:
path: ../_lib/charts/render-test-chart
- path: ytt/render-test-1
contents:
- path: .
directory:
path: ../_lib/ytt/render-test-1
- path: ytt/render-test-2
contents:
- path: .
directory:
path: ../_lib/ytt/render-test-2
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: app-mykso-dev-multiple-sources
namespace: system-argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: env-mykso-dev
destination:
name: mykso-dev
namespace: multiple-sources
source:
path: examples/integration-tests/rendered/envs/mykso-dev/multiple-sources
plugin:
name: argocd-vault-plugin-v1.0.0
repoURL: [email protected]:mykso/myks.git
targetRevision: main
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
- ServerSideApply=true
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
kind: rendering
metadata:
name: render-test
name: helm-render-test
outputYaml:
fromAppConfig: true
fromAppConfigAppData: true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kind: rendering
metadata:
name: helm-render-test-1
outputYaml:
fromChartDefaultValues: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kind: rendering
metadata:
name: helm-render-test-2
outputYaml:
fromChartDefaultValues: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: rendering
metadata:
name: ytt-render-test-1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: rendering
metadata:
name: ytt-render-test-2
10 changes: 0 additions & 10 deletions examples/simple/envs/dev/_apps/httpbingo/.myks/helm/httpbingo.yaml

This file was deleted.

This file was deleted.

11 changes: 0 additions & 11 deletions examples/simple/envs/dev/_apps/httpbingo/.myks/vendir.yaml

This file was deleted.

This file was deleted.

This file was deleted.

11 changes: 0 additions & 11 deletions examples/simple/envs/prod/_apps/httpbingo/.myks/vendir.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion internal/integration/render_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func findRepos(t *testing.T, basefolder string) []testRepo {
if !d.IsDir() {
continue
}
if d.Name() == "charts" {
if d.Name() == "_lib" {
continue
}
repos = append(repos, testRepo{
Expand Down
14 changes: 3 additions & 11 deletions internal/myks/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,26 +105,18 @@ func (a *Application) Init() error {
return nil
}

func (a *Application) expandPath(path string) string {
return filepath.Join(a.e.Dir, a.e.g.AppsDir, a.Name, path)
}

func (a *Application) expandServicePath(path string) string {
return filepath.Join(a.e.Dir, a.e.g.AppsDir, a.Name, a.e.g.ServiceDirName, path)
return filepath.Join(a.e.g.ServiceDirName, a.e.Dir, a.e.g.AppsDir, a.Name, path)
}

func (a *Application) expandTempPath(path string) string {
return a.expandServicePath(filepath.Join(a.e.g.TempDirName, path))
func (a *Application) expandVendirCache(path string) string {
return filepath.Join(a.e.g.ServiceDirName, a.e.g.VendirCache, path)
}

func (a *Application) writeServiceFile(name string, content string) error {
return writeFile(a.expandServicePath(name), []byte(content))
}

func (a *Application) writeTempFile(name string, content string) error {
return writeFile(a.expandTempPath(name), []byte(content))
}

func (a *Application) collectDataFiles() {
environmentDataFiles := a.e.collectBySubpath(a.e.g.EnvironmentDataFileName)
a.yttDataFiles = append(a.yttDataFiles, environmentDataFiles...)
Expand Down
5 changes: 5 additions & 0 deletions internal/myks/assets/data-schema.ytt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ yttPkg:
render:
#! If true, the render output file names will include the namespace
includeNamespace: false
#! Configuration options for caching during vendir sync step.
cache:
#! If true, the cache is enabled for all apps per default and can be selectively disabled with the vendir lazy flag.
#! If false, the cache is disabled for all apps per default and can be selectively enabled with the vendir lazy flag.
enabled: true
Comment on lines +115 to +119
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about moving this under the sync "namespace"?

Suggested change
#! Configuration options for caching during vendir sync step.
cache:
#! If true, the cache is enabled for all apps per default and can be selectively disabled with the vendir lazy flag.
#! If false, the cache is disabled for all apps per default and can be selectively enabled with the vendir lazy flag.
enabled: true
#! Configuration options for the sync step.
sync:
cache:
#! If true, the cache is enabled for all apps per default and can be selectively disabled with the vendir lazy flag.
#! If false, the cache is disabled for all apps per default and can be selectively enabled with the vendir lazy flag.
enabled: true

#! Myks configuration and runtime data.
#! Default values for these options are set by myks.
myks:
Expand Down
Loading