You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feature: Make targets for debugging services and operators
Adds a new Make target which triggers build in the underlying services
and operators which end up building the images without any code
optimizations and with Delve on them.
Once pushed and deployed to the local OpenShift cluster, it patches the
host operator, the member operator and the registration service to
launch them with the Delve executable, which allows debugging them on
port 50000 after port-forwarding to those pods.
SANDBOX-1561
Copy file name to clipboardExpand all lines: README.adoc
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -151,6 +151,14 @@ All e2e resources (host operator, member operator, registration-service, CRDs, e
151
151
152
152
* `make dev-deploy-e2e-local` - deploys the same resources as `make test-e2e-local` in dev environment but doesn't run tests.
153
153
154
+
* `make dev-deploy-e2e-local-debug` - deploys the same resources as `make test-e2e-local` in the local OpenShift
155
+
instance, but builds the services and the operators without any code optimizations. It also ships Delve in the images,
156
+
and launches those services with it, which leaves the debugger listening on port `50000`. Then, you can simply `oc
157
+
port-forward ${POD} 50000:50000` and connect to them with your favorite IDE. The services that are built like that are:
158
+
** The registration service.
159
+
** The host operator controller manager.
160
+
** The member operator controller manager.
161
+
154
162
* `make dev-deploy-e2e` - deploys the same resources as `make test-e2e` in dev environment but doesn't run tests.
155
163
156
164
* `make deploy-single-member-e2e-latest` - deploys the same resources (using the latest and greatest images of Toolchain operators) as `make test-e2e` but with only one member and doesn't run tests.
# Get the CSVs for the host and member operators, in order to be able to
53
+
# patch them.
54
+
HOST_CSV_NAME=$$(oc get --namespace="${DEFAULT_HOST_NS}" --output name ClusterServiceVersion)
55
+
MEMBER_CSV_NAME=$$(oc get --namespace="${DEFAULT_MEMBER_NS}" --output name ClusterServiceVersion)
56
+
57
+
# Patch the host operator indicating which command the registration
58
+
# service should be run with. The command simply adds an environment
59
+
# variable to the operator which then makes sure that the registration
60
+
# service is run with Delve, in case the user wants to connect to it.
61
+
if ! oc get "${HOST_CSV_NAME}" --output jsonpath="{.spec.install.spec.deployments[0].spec.template.spec.containers[1].env}" | grep -q "REGISTRATION_SERVICE_COMMAND"; then \
Copy file name to clipboardExpand all lines: scripts/ci/manage-host-operator.sh
+8-2Lines changed: 8 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@ user_help () {
11
11
echo"-rr, --reg-repo-path Path to the registation service repo"
12
12
echo"-ds, --date-suffix Date suffix to be added to some resources that are created"
13
13
echo"-ft, --forced-tag Forces a tag to be set to all built images. In the case deployment the tag is used for index image in the created CatalogSource"
14
+
echo"-dm, --debug-mode Builds and pushes the operator to quay, including a Delve debugger to be able to launch the operator with it"
Copy file name to clipboardExpand all lines: scripts/ci/manage-member-operator.sh
+7-1Lines changed: 7 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@ user_help () {
11
11
echo"-mr, --member-repo-path Path to the member operator repo"
12
12
echo"-ds, --date-suffix Date suffix to be added to some resources that are created"
13
13
echo"-ft, --forced-tag Forces a tag to be set to all built images. In the case deployment the tag is used for index image in the created CatalogSource"
14
+
echo"-dm, --debug-mode Builds and pushes the operator to quay, including a Delve debugger to be able to launch the operator with it"
14
15
echo"-h, --help To show this help text"
15
16
echo""
16
17
exit 0
@@ -67,6 +68,11 @@ read_arguments() {
67
68
FORCED_TAG=$1
68
69
shift
69
70
;;
71
+
-dm|--debug-mode)
72
+
shift
73
+
DEBUG_MODE=$1
74
+
shift
75
+
;;
70
76
*)
71
77
echo"$1 is not a recognized flag!">> /dev/stderr
72
78
user_help
@@ -95,7 +101,7 @@ if [[ -n "${CI}${MEMBER_REPO_PATH}" ]] && [[ $(echo ${REPO_NAME} | sed 's/"//g')
95
101
set_tags
96
102
97
103
if [[ ${PUBLISH_OPERATOR}=="true" ]];then
98
-
push_image
104
+
push_image"${DEBUG_MODE}"
99
105
100
106
OPERATOR_IMAGE_LOC=${IMAGE_LOC}
101
107
make -C ${REPOSITORY_PATH} publish-current-bundle INDEX_IMAGE_TAG=${BUNDLE_AND_INDEX_TAG} BUNDLE_TAG=${BUNDLE_AND_INDEX_TAG} QUAY_NAMESPACE=${QUAY_NAMESPACE} IMAGE=${OPERATOR_IMAGE_LOC}
0 commit comments