From c1f6ece250395ff489889648e1c61bf36470cec5 Mon Sep 17 00:00:00 2001 From: Bobbins228 Date: Tue, 24 Oct 2023 17:24:27 +0100 Subject: [PATCH 1/4] Added launch.json for local debugging with VSCode --- .gitignore | 3 +++ .vscode/launch.json | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 .vscode/launch.json diff --git a/.gitignore b/.gitignore index 898d07796..3126962c1 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,6 @@ bundle.Dockerfile *~ .DS_STORE + +#VSCode +.vscode diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..7357bfc75 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,17 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Debug CodeFlare Operator", + "type": "go", + "request": "launch", + "mode": "auto", + "program": "${workspaceFolder}/main.go", + "env": { + "KUBECONFIG": "", + "NAMESPACE": "", + }, + "showLog": true + }, + ] + } From be7b816d13864d2373d203dec29cc425bdfbce5f Mon Sep 17 00:00:00 2001 From: Bobbins228 Date: Tue, 24 Oct 2023 17:33:46 +0100 Subject: [PATCH 2/4] Fixed Json --- .vscode/launch.json | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 7357bfc75..731487da5 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,17 +1,17 @@ { - "version": "0.2.0", - "configurations": [ - { - "name": "Debug CodeFlare Operator", - "type": "go", - "request": "launch", - "mode": "auto", - "program": "${workspaceFolder}/main.go", - "env": { - "KUBECONFIG": "", - "NAMESPACE": "", - }, - "showLog": true + "version": "0.2.0", + "configurations": [ + { + "name": "Debug CodeFlare Operator", + "type": "go", + "request": "launch", + "mode": "auto", + "program": "${workspaceFolder}/main.go", + "env": { + "KUBECONFIG": "", + "NAMESPACE": "" }, - ] - } + "showLog": true + } + ] +} From 16db0d5adb1fc8093264df25f39bf80ebf17790d Mon Sep 17 00:00:00 2001 From: Bobbins228 Date: Wed, 25 Oct 2023 09:30:01 +0100 Subject: [PATCH 3/4] Added instructions to CONTRIBUTING.md --- CONTRIBUTING.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 83edd2f9b..df63e1796 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -56,3 +56,9 @@ To write and inspect unit tests: - MCAD and InstaScale unit tests under `mcad_controller_test.go` and `instascale_controller_test.go` in the `controllers` dir - Unit test functions are defined in `suite_test.go` (with utils in `util/util.go`) in the `controllers dir` - Test cases defined under `controllers/testdata` + + ## Local debugging with VSCode + Steps outlining how to run the operator locally. + - Populate the `.vscode/launch.json` file with the location of your Kubernetes config file and desired namespace. + - In VSCode on the activity bar click `Run and Debug` or `CTRL + SHIFT + D` to start a local debugging session of the CodeFlare Operator. + The operator should be running as intended. From 779bfe7d50ecbc27b2b47b84270a2b47441add4e Mon Sep 17 00:00:00 2001 From: Bobbins228 Date: Wed, 1 Nov 2023 10:56:50 +0000 Subject: [PATCH 4/4] Review changes links, additional info --- .gitignore | 2 +- CONTRIBUTING.md | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 3126962c1..9be9b01b6 100644 --- a/.gitignore +++ b/.gitignore @@ -30,5 +30,5 @@ bundle.Dockerfile .DS_STORE -#VSCode +# VSCode .vscode diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index df63e1796..9fd4a3f8b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -59,6 +59,7 @@ To write and inspect unit tests: ## Local debugging with VSCode Steps outlining how to run the operator locally. - - Populate the `.vscode/launch.json` file with the location of your Kubernetes config file and desired namespace. + - Ensure you are authenticated to your Kubernetes/OpenShift Cluster. + - Populate the [.vscode/launch.json](https://github.com/project-codeflare/codeflare-operator/tree/main/.vscode/launch.json) file with the location of your Kubernetes config file and desired namespace. - In VSCode on the activity bar click `Run and Debug` or `CTRL + SHIFT + D` to start a local debugging session of the CodeFlare Operator. The operator should be running as intended.