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

Support oc process --local to do local transformation #12996

Merged
merged 2 commits into from
Feb 19, 2017

Conversation

smarterclayton
Copy link
Contributor

Allows oc to be used against a kubernetes server

@bparees as discussed

[test]

if err != nil {
return err
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

this looks redundant?

# 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"
Copy link
Contributor

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"
Copy link
Contributor

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

@smarterclayton
Copy link
Contributor Author

smarterclayton commented Feb 17, 2017 via email

@smarterclayton
Copy link
Contributor Author

smarterclayton commented Feb 17, 2017 via email

@bparees
Copy link
Contributor

bparees commented Feb 17, 2017 via email

@smarterclayton
Copy link
Contributor Author

Comments addressed

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"'
Copy link
Contributor

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... :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy pasta ftl

@@ -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
Copy link
Contributor

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 -
@bparees
Copy link
Contributor

bparees commented Feb 18, 2017

lgtm [test]

@smarterclayton
Copy link
Contributor Author

smarterclayton commented Feb 18, 2017 via email

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to 8ee72b0

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin_future/337/) (Base Commit: b78f927)

@smarterclayton
Copy link
Contributor Author

[merge], flake in image build

@smarterclayton
Copy link
Contributor Author

[merge] openshift/origin-gce#14

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to 8ee72b0

@openshift-bot
Copy link
Contributor

openshift-bot commented Feb 19, 2017

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants