Skip to content

Commit

Permalink
Add a launch.json for local development
Browse files Browse the repository at this point in the history
  • Loading branch information
mprahl authored and openshift-merge-bot[bot] committed Apr 15, 2024
1 parent 3bc0a9e commit 9340840
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ Session.vim
tags
### VisualStudioCode ###
.vscode/*
!.vscode/launch.json
.history
# End of https://www.gitignore.io/api/go,vim,emacs,visualstudiocode
__debug_bin
Expand Down
99 changes: 99 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
{
"version": "0.2.0",
"configurations": [
// Run `make kind-bootstrap-cluster-dev` before launching this.
{
"name": "Launch Package",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/main.go",
"env": {
"HUB_CONFIG": "${workspaceFolder}/kubeconfig_hub",
"MANAGED_CONFIG": "${workspaceFolder}/kubeconfig_managed",
"OSDK_FORCE_RUN_MODE": "local",
},
"args": [
"--leader-elect=false",
"--cluster-namespace=managed",
"--cluster-namespace-on-hub=managed",
"--log-level=3"
]
},
// Run `make kind-bootstrap-cluster-dev` before launching this.
{
"name": "Launch Package (Compliance API Tests)",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/main.go",
"env": {
"HUB_CONFIG": "${workspaceFolder}/kubeconfig_hub",
"MANAGED_CONFIG": "${workspaceFolder}/kubeconfig_managed",
"OSDK_FORCE_RUN_MODE": "local",
},
"args": [
"--leader-elect=false",
"--cluster-namespace=managed",
"--cluster-namespace-on-hub=managed",
"--log-level=3",
"--compliance-api-url=http://127.0.0.1:8385"
]
},
// Set FDescribe or FIt on the test to debug. Then set the desired breakpoint.
{
"name": "Launch Test Function (instructions in launch.json)",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/test/e2e/e2e_suite_test.go",
"args": [
"-ginkgo.debug",
"-ginkgo.v"
],
"env": {
"KUBECONFIG": "${workspaceFolder}/kubeconfig_managed_e2e"
}
},
// Set the correct path to the governance-policy-framework repo directory in the env section. If running
// on a self-managed hub, set the `--disable-spec-sync=true` and `--cluster-namespace=managed` arguments.
{
"name": "Launch Package (Framework E2E) (instructions in launch.json)",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/main.go",
"env": {
"HUB_CONFIG": "${userHome}/git/governance-policy-framework/kubeconfig_hub",
"MANAGED_CONFIG": "${userHome}/git/governance-policy-framework/kubeconfig_managed",
"KUBECONFIG": "${userHome}/git/governance-policy-framework/kubeconfig_managed",
"OSDK_FORCE_RUN_MODE": "local"
},
"args": [
"--leader-elect=false",
"--cluster-namespace=managed",
"--log-level=3"
// "--disable-spec-sync=true",
// "--cluster-namespace=local-cluster",
]
},
// Set the correct path to the governance-policy-addon-controller repo directory in the env section.
{
"name": "Launch Package (Addon Controller) (instructions in launch.json)",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/main.go",
"env": {
"HUB_CONFIG": "${userHome}/git/governance-policy-addon-controller-io/kubeconfig_cluster1_e2e.kubeconfig",
"MANAGED_CONFIG": "${userHome}/git/governance-policy-addon-controller-io/kubeconfig_cluster2_e2e.kubeconfig",
"OSDK_FORCE_RUN_MODE": "local"
},
"args": [
"--leader-elect=false",
"--cluster-namespace=cluster1",
"--log-level=3"
]
}
]
}

0 comments on commit 9340840

Please sign in to comment.