Comments (10)
Yep, we don't currently parse the json/yaml for namespace specifications and adjust the REST call accordingly. Same goes for the resource deletion steps.
We minimally need to document the behavior, if not change the implementation to handle this.
@bparees - any initial opinions on what we want to do here (I'm leaning toward code change, but with the background around create/delete, I don't think it is a given)
from jenkins-plugin.
not certain i understand the behavior.
if the resource being created does NOT itself define a namespace in the metadata, does it get created in the namespace defined by the build step (and defaults to the current jenkins namespace)?
and if the resource does define a namespace in the metadata, does it get created in that namespace?
from jenkins-plugin.
On Fri, Jul 1, 2016 at 11:32 AM, Ben Parees [email protected]
wrote:
not certain i understand the behavior.
if the resource being created does NOT itself define a namespace in the
metadata, does it get created in the namespace defined by the build step
(and defaults to the current jenkins namespace)?and if the resource does define a namespace in the metadata, does it get
created in that namespace?
Right now the create build step always creates all resources in the
namespace specified in the create build step config (or if none is
specified there, it uses the namespace of the jenkins service mounted into
the pod
for all objects it creates), using the auth token specified (where if if
none is specified, it using the one for the service account mounted into
the pod).
It ignores any specification of resource in the JSON/YAML. Aside from
doing basic JSON/YAML format verification, we stop parsing the JSON at the
'kind' (we need to know the 'kind'
to know which REST endpoint to hit).
Manipulating resources in other namespaces of course gets into either
giving the jenkins serivce account edit access to those namespaces, or
providing auth tokens for any namespace
noted in the JSON/YAML.
If we want to go down this path, the timing of any changes is also a
consideration (at some point we'll want to move to a newer version of the
openshift-restclient-java component, where they
have improved the API around generic resource creation, which we might want
to switch to).
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
#45 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ADbadP4XwcAx5-FO40lyrbJLnMmYJdIXks5qRTMTgaJpZM4JDF2B
.
from jenkins-plugin.
what does "oc create -f foo.yaml -n somenamespace" do when foo.yaml specifies a namespace? we should expect to align with that.
from jenkins-plugin.
On Fri, Jul 1, 2016 at 2:34 PM, Ben Parees [email protected] wrote:
what does "oc create -f foo.yaml -n somenamespace" do when foo.yaml
specifies a namespace? we should expect to align with that.Good point. Unless someone beats me to it, I'll give it a go next chance I
get, report back, and we'll go from there.—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
#45 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ADbadKZiGr7jV73R12wudEyzGopf-miDks5qRV2rgaJpZM4JDF2B
.
from jenkins-plugin.
Note that in this case I did NOT set a namespace in the yaml text field.
I did however put a namespace/projectname in the text filed that say "The name of the project to create the resource in". I would have thought that this was the equivalent to having "-n demo" on the commandline when calling the oc binary. However this namespace/projectname is ignored.
So it is not (at least not in my case) a problem where the "-n" say one thing and the yaml another.
from jenkins-plugin.
FYI - I've reproduced this and am working on a fix.
from jenkins-plugin.
So I believe the problem where the namespace specified in the build step field was not used was introduced with commit 373afaa (from about 4 weeks ago).
This bug actually affects all the build steps, not just the create resources one. So I'm bumping the priority to p2.
With the fix I will soon commit, if you specify a project that is different from the project jenkins is running in, as well as the associated default service account token for said project, and as well as providing the default service account token edit access for said project, you can create resources.
For honoring the namespace within the json/yaml, I'm going to look into a fix of the following form:
- the token provided to the step has been given edit access to any project listed in the json/yaml (the doc will be updated with this requirement); I don't want to introduce a change where we specify multiple tokens for each project
- i'll then fetch a rest client to the specific namespace as part of processing each resource
If this change proves straightforward, I'll include it in the fix as well. Otherwise, I'll just incorporate the fix to honor the namespace, and document the restriction of not honoring the namespace in the json/yaml for now, and track lifting this restriction our trello card that is handling rebasing the plugin on the newer version of the rest client.
from jenkins-plugin.
OK, I got the pulling of the namespace from the json/yaml working easily enough. Will include this change, along with the doc updates mentioned previously around permissions for the service account.
from jenkins-plugin.
Delivered fixes with 895c47b
Built, pre-release version of the plugin with this change can be found here
When it comes out, V1.0.21 will be the official release with the fix.
Closing this out - please reopen if something does not seem right wrt the fix provided.
from jenkins-plugin.
Related Issues (20)
- Patch / Update resources HOT 9
- jenkins template using spec.clusterIP instead of spec.portalIP HOT 2
- Build output sometimes not shown in jenkins console output HOT 2
- Deployments don't work HOT 3
- Environment Variables don't respect Parameterised Builds HOT 6
- Timeout of builds HOT 3
- Unable to do openshiftTag() in pipeline HOT 1
- FR: Support of variables inside Openshift Exec HOT 9
- BUG: "Test connection" always returns "Connections successful" HOT 11
- BUG: OpenshiftExec ignores timeout HOT 12
- Confusing print statement if openshiftVerifyDeployment fails HOT 1
- okhttp binary changes break plugin when others installed HOT 11
- Externalize the CERT_FILE = "/run/secrets/kubernetes.io/serviceaccount/ca.crt"; HOT 7
- Issue with Jenkin's Verify Build OpenShift plug-in functionality HOT 9
- Declarative pipeline support? HOT 4
- openshift-client-plugin really still a "tech preview" ? HOT 3
- Jenkins throws an error when using the openhiftBuild with the buildConfig parameter HOT 3
- Resulting GDSL is Broken HOT 2
- openshiftBuild should support binary build type. HOT 10
- Add deprecation warning and link to new plugin as first thing in repo
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jenkins-plugin.