-
Notifications
You must be signed in to change notification settings - Fork 231
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
Show environment variables coming from the builder image in the Environment tab #889
Conversation
Implemented for BCs but it is only supported for ImageStreamTag or ImageStreamImage. I hesitate to support this for DockerImage because it is going to put extra load onto the image import API. I didn't do this for individual builds for the same reason because they have already resolved to a particular DockerImage reference. |
pretty. |
We could do the same thing for DCs that have an ICT |
if (_.includes(["ImageStreamTag", "ImageStreamImage"], buildFrom.kind)) { | ||
lastLoadedBuildFromImageKey = buildFromImageKey; | ||
DataService.get(APIService.kindToResource(buildFrom.kind), buildFrom.name, {namespace: buildFrom.namespace || $scope.projectName}).then(function(imageStreamImage){ | ||
$scope.BCEnvVarsFromImage = _.map(_.get(imageStreamImage, 'image.dockerImageMetadata.Config.Env'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be able to use $filter('imageEnv')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind, that's looking for a specific key. We might generalize it though or add another filter
@@ -365,6 +365,21 @@ | |||
<uib-tab heading="Environment" active="selectedTab.environment" ng-if="buildConfig && !(buildConfig | isJenkinsPipelineStrategy)"> | |||
<uib-tab-heading>Environment</uib-tab-heading> | |||
<h3>Environment Variables</h3> | |||
<div style="margin-top: -5px;" ng-if="BCEnvVarsFromImage.length"> | |||
The builder image has additional environment variables defined. Variables defined below will overwrite any from the image with the same name. | |||
<a href="" ng-click="expand.imageEnv = true" ng-if="!expand.imageEnv">View image environment variables</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Show image environment variables"? To be consistent with other show/hide links
@@ -365,6 +365,21 @@ | |||
<uib-tab heading="Environment" active="selectedTab.environment" ng-if="buildConfig && !(buildConfig | isJenkinsPipelineStrategy)"> | |||
<uib-tab-heading>Environment</uib-tab-heading> | |||
<h3>Environment Variables</h3> | |||
<div style="margin-top: -5px;" ng-if="BCEnvVarsFromImage.length"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class="mar-top-sm"
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its negative margin, i dont think we have a class for applying negative margin?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right
I think we have the image stream image already to fill in the pod template details. |
02d266d
to
73bec0c
Compare
@spadgett as discussed this will just cover the BC env vars, will work on another PR for DCs |
var pair = entry.split('='); | ||
return { | ||
name: _.head(pair), | ||
value:_.last(pair) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a new problem, but this won't correctly handle env var values with a =
. Maybe
var index = entry.indexOf('=');
return {
name: entry.substring(0, index),
value: entry.substring(index + 1)
};
Yes we have an open / bug issue for that. I can look at fixing as part of On Nov 18, 2016 1:54 PM, "Sam Padgett" [email protected] wrote:
|
73bec0c
to
24e766a
Compare
@spadgett updated to handle env var values with = |
[merge] |
Evaluated for origin web console merge up to 24e766a |
[Test]ing while waiting on the merge queue |
Evaluated for origin web console test up to 24e766a |
Origin Web Console Test Results: SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin_web_console/737/) (Base Commit: 9686826) |
Origin Web Console Merge Results: SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin_web_console/740/) (Base Commit: 07653ad) |
Fixes openshift/origin#11388
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1357107