-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Support oc process --local
to do local transformation
#12996
Support oc process --local
to do local transformation
#12996
Conversation
pkg/cmd/cli/cmd/process.go
Outdated
if err != nil { | ||
return err | ||
} | ||
} |
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.
this looks redundant?
test/cmd/templates.sh
Outdated
# Processes the template locally | ||
os::cmd::expect_success_and_text "oc process -f '${guestbook_template}' --local -l app=guestbook -o yaml" "app: guestbook" | ||
# Does not even try to hit the server | ||
os::cmd::expect_success_and_text "oc process -f '${guestbook_template}' --local -l app=guestbook -o yaml --server 0.0.0.0:1" "app: guestbook" |
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.
how about processing the same template twice, once locally and once remotely, and verifying the result is identical? (can't have generated parameters, of course)
|
||
os::test::junit::declare_suite_start "cmd/templates/local-config" | ||
# Processes the template locally | ||
os::cmd::expect_success_and_text "oc process -f '${guestbook_template}' --local -l app=guestbook -o yaml" "app: guestbook" |
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.
JSONPath on every YAML lookup please
I'm testing that it's actually yaml
On Feb 17, 2017, at 8:30 AM, Steve Kuznetsov <[email protected]> wrote:
*@stevekuznetsov* commented on this pull request.
------------------------------
In test/cmd/templates.sh
<#12996 (comment)>:
@@ -46,6 +46,13 @@ guestbook_template="${OS_ROOT}/test/templates/testdata/guestbook.json"
os::cmd::expect_success "oc process -f '${guestbook_template}' -l
app=guestbook | oc create -f -"
os::cmd::expect_success_and_text 'oc status' 'frontend-service'
echo "template+config: ok"
+
+os::test::junit::declare_suite_start "cmd/templates/local-config"
+# Processes the template locally
+os::cmd::expect_success_and_text "oc process -f
'${guestbook_template}' --local -l app=guestbook -o yaml" "app:
guestbook"
JSONPath on every YAML lookup please
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#12996 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABG_p-SnkCXCUCb2RqEOQ2bgf4R3Hfa4ks5rdaD0gaJpZM4MD1iT>
.
|
Steve, is
https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin_networking_future/285/
something
new happening?
|
i'm fixing it here:
#12999
…On Fri, Feb 17, 2017 at 9:49 AM, Clayton Coleman ***@***.***> wrote:
Steve, is
https://ci.openshift.redhat.com/jenkins/job/test_pull_
requests_origin_networking_future/285/
something
new happening?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#12996 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEvl3iKJ3_jQ8nbsNz4KjPrCwO4HFTBlks5rdbN_gaJpZM4MD1iT>
.
--
Ben Parees | OpenShift
|
4b0a081
to
fd101b5
Compare
Comments addressed |
test/cmd/templates.sh
Outdated
os::cmd::expect_success_and_text "oc process -f '${guestbook_template}' --local -l app=guestbook -o yaml" "app: guestbook" | ||
new="$(mktemp -d)" | ||
os::cmd::expect_success 'oc process -f "${guestbook_template}" --local -l app=guestbook -o yaml ADMIN_USERNAME=au ADMIN_PASSWORD=ap REDIS_PASSWORD=rp > "${new}/localtemplate"' | ||
os::cmd::expect_success 'oc process -f "${guestbook_template}" --local -l app=guestbook -o yaml ADMIN_USERNAME=au ADMIN_PASSWORD=ap REDIS_PASSWORD=rp > "${new}/remotetemplate"' |
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.
it's not remote if you pass --local... :)
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.
Copy pasta ftl
test/cmd/templates.sh
Outdated
@@ -46,6 +46,17 @@ guestbook_template="${OS_ROOT}/test/templates/testdata/guestbook.json" | |||
os::cmd::expect_success "oc process -f '${guestbook_template}' -l app=guestbook | oc create -f -" | |||
os::cmd::expect_success_and_text 'oc status' 'frontend-service' | |||
echo "template+config: ok" | |||
|
|||
os::test::junit::declare_suite_start "cmd/templates/local-config" | |||
# Processes the template locally and get the same output in YAML |
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.
this comment belongs down a line.
Allow clients to process templates using the client, rather than the server. Allows process to be used for local files against a Kubernetes server. oc process --local -f template.json | kubectl create -f -
fd101b5
to
8ee72b0
Compare
lgtm [test] |
[test]
|
Evaluated for origin test up to 8ee72b0 |
continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin_future/337/) (Base Commit: b78f927) |
[merge], flake in image build |
[merge] openshift/origin-gce#14 |
Evaluated for origin merge up to 8ee72b0 |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin_future/343/) (Base Commit: 0aa6ba1) (Image: devenv-rhel7_5940) |
Allows oc to be used against a kubernetes server
@bparees as discussed
[test]