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

Add test for advanced CRUD for apiextensions #46624

Closed
wants to merge 1 commit into from

Conversation

nikhita
Copy link
Member

@nikhita nikhita commented May 30, 2017

What this PR does / why we need it: Add test for advanced CRUD for apiextensions i.e. check if kubectl commands work right. Added a spec field for CRDs.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): for #45511

Special notes for your reviewer:

Release note:

NONE

/cc @sttts

@k8s-ci-robot k8s-ci-robot requested a review from sttts May 30, 2017 14:29
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 30, 2017
@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: nikhita
We suggest the following additional approver: ixdy

Assign the PR to them by writing /assign @ixdy in a comment when ready.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-github-robot k8s-github-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. release-note-none Denotes a PR that doesn't merit a release note. labels May 30, 2017
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 30, 2017
@k8s-ci-robot
Copy link
Contributor

Hi @nikhita. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with @k8s-bot ok to test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.


# teardown
kubectl delete customresourcedefinitions/foos.company.com "${kube_flags_with_token[@]}"
kubectl delete customresourcedefinitions/bars.company.com "${kube_flags_with_token[@]}"
}

run_tpr_tests() {
run_TPR_CRD_tests() {
Copy link
Member Author

Choose a reason for hiding this comment

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

oops, will fix this.

Copy link
Member Author

Choose a reason for hiding this comment

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

done

* modify the run_crd_tests and run_tpr_tests
such that both can be run.
* add a spec field for crds

Fix wrong rename
@nikhita nikhita force-pushed the crd-advanced-crud branch from dfb8500 to 5a16743 Compare May 30, 2017 14:37
# Set spec field for CRDs
if [ $1 == CRD ]; then
SPEC=spec.
else
Copy link
Member Author

@nikhita nikhita May 30, 2017

Choose a reason for hiding this comment

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

I'm thinking the else condition should be redundant...

Copy link
Contributor

Choose a reason for hiding this comment

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

would leave it. makes it clearer. Maybe add to the comment: "For TRPs this is the empty string because TPRs don't have spec and status, but are flat."

kubectl "${kube_flags[@]}" get foos/test -o "jsonpath={.someField}" --allow-missing-template-keys=false
kubectl "${kube_flags[@]}" get foos -o "go-template={{range .items}}{{.someField}}{{end}}" --allow-missing-template-keys=false
kubectl "${kube_flags[@]}" get foos/test -o "go-template={{.someField}}" --allow-missing-template-keys=false
kubectl "${kube_flags[@]}" get foos -o "jsonpath={.items[*].${SPEC}someField}" --allow-missing-template-keys=false
Copy link
Contributor

Choose a reason for hiding this comment

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

Wondering, aren't these the CRs, not the CRDs? The CRs don't have the spec, do they?

Copy link
Member Author

Choose a reason for hiding this comment

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

@nikhita
Copy link
Member Author

nikhita commented May 30, 2017

Looks like this PR is not needed because the status/spec field for CRs does not exist.
The CRDs were created and then run_non_native_resource_tests was called which ran kubectl commands on the CRs before.

@deads2k do you think anything needs to be done for checking the kubectl commands here? Or else, I'll close the PR.

@ixdy
Copy link
Member

ixdy commented Jun 2, 2017

/assign @deads2k @sttts

@cblecker
Copy link
Member

cblecker commented Jun 6, 2017

/unassign

@nikhita nikhita closed this Jun 6, 2017
@nikhita nikhita deleted the crd-advanced-crud branch June 6, 2017 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants