-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more scripts to ease local debug, dev and testing (#97)
* Add more scripts to ease local debug, dev and testing * Restore scheduler * Fix shell check * Shell format * Update readme * PR remarks * Fix debug config Co-authored-by: Matteo Ruina <[email protected]> Co-authored-by: Dimitar Hristov <[email protected]>
- Loading branch information
1 parent
73c9162
commit acc5800
Showing
13 changed files
with
172 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -165,3 +165,4 @@ hack/.hack.* | |
|
||
# Ignore .env files | ||
.env.local | ||
__debug_bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Debug", | ||
"type": "go", | ||
"request": "launch", | ||
"mode": "debug", | ||
"remotePath": "", | ||
"port": 2345, | ||
"host": "127.0.0.1", | ||
"program": "${workspaceRoot}", | ||
"envFile": "${workspaceFolder}/.env.local", | ||
"args": [], | ||
"showLog": true | ||
}, | ||
{ | ||
"name": "Integration tests - controller", | ||
"type": "go", | ||
"request": "launch", | ||
"mode": "test", | ||
"program": "${workspaceFolder}/controllers", | ||
}, | ||
{ | ||
"name": "Unit tests - scheduler", | ||
"type": "go", | ||
"request": "launch", | ||
"mode": "test", | ||
"program": "${workspaceFolder}/internal/scheduler", | ||
} | ||
{ | ||
"name": "Unit tests - utils", | ||
"type": "go", | ||
"request": "launch", | ||
"mode": "test", | ||
"program": "${workspaceFolder}/internal/utils", | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
root=$(dirname "${BASH_SOURCE[0]}") | ||
|
||
# shellcheck disable=SC1091 | ||
source .env.local | ||
|
||
bash "$root/redeploy-dev-resources.sh" | ||
dlv --listen=:2345 --headless=true --api-version=2 debug main.go -- --zap-devel=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
root=$(dirname "${BASH_SOURCE[0]}") | ||
|
||
prevcontext=$(kubectl config current-context) | ||
kubectl config use-context kind-argocd-control-plane | ||
|
||
# Remove finalizer to allow deletion to complete | ||
kubectl patch progressivesync -n argocd goinfra -p '{"metadata":{"finalizers":null}}' --type=merge || echo "Not found. Continuing..." | ||
|
||
kubectl delete progressivesync -n argocd goinfra || echo "Not found. Continuing..." | ||
kubectl apply -f "$root"/dev/test-progsync.yml | ||
|
||
kubectl config use-context "$prevcontext" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
apiVersion: argoproj.skyscanner.net/v1alpha1 | ||
kind: ProgressiveSync | ||
metadata: | ||
labels: | ||
argocd.argoproj.io/instance: goinfra | ||
name: goinfra | ||
namespace: argocd | ||
spec: | ||
sourceRef: | ||
apiGroup: argoproj.io/v1alpha1 | ||
kind: ApplicationSet | ||
name: appset-goinfra | ||
stages: | ||
- maxParallel: 1 | ||
maxTargets: 1 | ||
name: one cell as canary in eu-west-1 | ||
targets: | ||
clusters: | ||
selector: | ||
matchLabels: | ||
region: eu-west-1 | ||
- maxParallel: 2 | ||
maxTargets: 100% | ||
name: rollout to remaining cells in every other region | ||
targets: | ||
clusters: | ||
selector: | ||
matchExpressions: | ||
- key: region | ||
operator: NotIn | ||
values: | ||
- eu-west-1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# On mac delve refuses to die, so call this script to kill it and the actual go process it spawned | ||
pgrep __debug_bin | xargs kill -SIGINT | ||
pgrep dlv | xargs kill -SIGKILL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
root=$(dirname "${BASH_SOURCE[0]}") | ||
|
||
make install | ||
|
||
bash "$root/deploy-test-appset.sh" | ||
bash "$root/deploy-test-progsync.sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters