Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow for the disabling of memory intensive admin monitors via env va… #551

Merged
merged 1 commit into from Mar 19, 2018
Merged

allow for the disabling of memory intensive admin monitors via env va… #551

merged 1 commit into from Mar 19, 2018

Conversation

gabemontero
Copy link
Contributor

…r and template param

@openshift/sig-developer-experience ptal

while these update center admin monitors are on by default, these changes will allow us to explicitly turn them off minimally in our extended tests, and possibly in online starter if we chose to do so

Details in openshift/origin#19008

@openshift-ci-robot openshift-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Mar 19, 2018
DOLLAR='$'
if [[ "${DISABLE_ADMINISTRATIVE_MONITORS}" == "true" ]]; then
echo "
<string>hudson.model.UpdateCenter${DOLLAR}CoreUpdateMonitor</string>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this ${DOLLAR} right? this value represents something that's being substituted into the config.xml. I wouldn't expect it to need to be escaped.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or rather, you can use echo with single quotes to avoid variable resolution here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this works.

And so does hudson.model.UpdateCenter\$CoreUpdateMonitor, without setting of DOLLAR='$' on the same line as the envsubst call

I employed the current approach based on the discussion that occurred in the original PR, but am perfectly find just switching to hudson.model.UpdateCenter\$CoreUpdateMonitor

What does not work: A string of hudson.model.UpdateCenter$CoreUpdateMonitor

Followed later on by DOLLAR='$' envsubst.... ... the $ is lost on the above echo even and then there is nothing for DOLLAR='$' envsubst ...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the $ is lost on the above echo

single quotes would solve that.

#!/bin/sh
  
function foo() {
  echo 'a$b'
}
export bar=$(foo)
envsubst < file.json
$ cat file.json 
a
$bar
foo
$ ./t.sh 
a
a$b
foo

echo "Disabling administrative monitors that contact the update center"
if [ -e "${JENKINS_HOME}/init.groovy.d/update-center-init.groovy" ]; then
echo "Turning off startup groovy init update center administrative monitor initialization"
mv "${JENKINS_HOME}/init.groovy.d/update-center-init.groovy" "${JENKINS_HOME}/init.groovy.d/update-center-init.save"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/save/disabled/

echo "Administrative monitors that contact the update center will remain active"
if [ -e "${JENKINS_HOME}/init.groovy.d/update-center-init.save" ]; then
echo "Turning on startup groovy init update center administrative monitor initialization"
mv "${JENKINS_HOME}/init.groovy.d/update-center-init.save" "${JENKINS_HOME}/init.groovy.d/update-center-init.groovy"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/save/disabled/

fi
else
echo "Administrative monitors that contact the update center will remain active"
if [ -e "${JENKINS_HOME}/init.groovy.d/update-center-init.save" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/save/disabled/

@gabemontero
Copy link
Contributor Author

updates pushed @bparees

i'll squash if you are good

Copy link
Contributor

@bparees bparees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typos and then lgtm

{
"name": "DISABLE_ADMINISTRATIVE_MONITORS",
"displayName": "Disable memory intensive administrative monitors",
"description": "Whether to perform memory intensive, possibly slow, synchronization with the Jenkins Update Center on starte. If true, the Jenkins core update monitor and site warnings monitor are disabled.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/starte/start/

{
"name": "DISABLE_ADMINISTRATIVE_MONITORS",
"displayName": "Disable memory intensive administrative monitors",
"description": "Whether to perform memory intensive, possibly slow, synchronization with the Jenkins Update Center on starte. If true, the Jenkins core update monitor and site warnings monitor are disabled.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

starte typo

@gabemontero
Copy link
Contributor Author

cool thanks ... fixed typos and squashed

@bparees
Copy link
Contributor

bparees commented Mar 19, 2018

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 19, 2018
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bparees, gabemontero

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [bparees,gabemontero]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 7a7ca67 into openshift:master Mar 19, 2018
@gabemontero gabemontero deleted the turn-off-update-sync branch March 20, 2018 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants