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
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -151,6 +151,16 @@ 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`. The default architecture for
157
+
which the binaries are built are `linux-amd64`, but you can override it with `export TARGET_ARCH=${YOUR_ARCH}`. Then,
158
+
you can simply `oc port-forward ${POD} 50000:50000` and connect to them with your favorite IDE. The services that are
159
+
built like that are:
160
+
** The registration service.
161
+
** The host operator controller manager.
162
+
** The member operator controller manager.
163
+
154
164
* `make dev-deploy-e2e` - deploys the same resources as `make test-e2e` in dev environment but doesn't run tests.
155
165
156
166
* `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
+7-2Lines changed: 7 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 Enables debug builds. The operator is built and pushed to quay with the Delve executable included in the image"
Copy file name to clipboardExpand all lines: scripts/ci/manage-member-operator.sh
+6-1Lines changed: 6 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 Enables debug builds. The operator is built and pushed to quay with the Delve executable included in the image"
14
15
echo"-h, --help To show this help text"
15
16
echo""
16
17
exit 0
@@ -67,6 +68,10 @@ read_arguments() {
67
68
FORCED_TAG=$1
68
69
shift
69
70
;;
71
+
-dm|--debug-mode)
72
+
DEBUG_MODE=$1
73
+
shift
74
+
;;
70
75
*)
71
76
echo"$1 is not a recognized flag!">> /dev/stderr
72
77
user_help
@@ -95,7 +100,7 @@ if [[ -n "${CI}${MEMBER_REPO_PATH}" ]] && [[ $(echo ${REPO_NAME} | sed 's/"//g')
95
100
set_tags
96
101
97
102
if [[ ${PUBLISH_OPERATOR}=="true" ]];then
98
-
push_image
103
+
push_image"${DEBUG_MODE}"
99
104
100
105
OPERATOR_IMAGE_LOC=${IMAGE_LOC}
101
106
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