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

Write replaceCoreV1NamespacedPodTemplate test - +1 endpoint coverage #108286

Merged
merged 1 commit into from
Mar 1, 2022

Conversation

riaankleinhans
Copy link
Contributor

@riaankleinhans riaankleinhans commented Feb 23, 2022

What type of PR is this?
/kind cleanup

What this PR does / why we need it:
This PR adds a test to test the following untested endpoint:

  • replaceCoreV1NamespacedPodTemplate

Which issue(s) this PR fixes:
Fixes #108285
Testgrid Link:
Testgid

Special notes for your reviewer:
Adds +1 endpoint test coverage (good for conformance)

Does this PR introduce a user-facing change?:

NONE

Release note:

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

NONE

/sig testing
/sig architecture
/area conformance

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. sig/testing Categorizes an issue or PR as relevant to SIG Testing. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. area/conformance Issues or PRs related to kubernetes conformance tests needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 23, 2022
@riaankleinhans
Copy link
Contributor Author

/triage accepted

@k8s-ci-robot k8s-ci-robot added sig/node Categorizes an issue or PR as relevant to SIG Node. triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Feb 23, 2022
@riaankleinhans riaankleinhans added this to In Progress /Active Issues in conformance-definition Feb 23, 2022
@heyste
Copy link
Member

heyste commented Feb 23, 2022

/test pull-kubernetes-unit
unrelated flake

=== Failed
=== FAIL: pkg/kubelet/nodeshutdown  (0.00s)
=== CONT  
    testing.go:1152: race detected during execution of test
FAIL
FAIL	k8s.io/kubernetes/pkg/kubelet/nodeshutdown	2.708s 

@heyste
Copy link
Member

heyste commented Feb 23, 2022

/test pull-kubernetes-node-e2e-containerd
unrelated flake [It] should report resource usage through the stats api

W0223 01:05:57.907] Looking for address 'bootstrap-e2e-master-ip'
W0223 01:05:58.667] ERROR: (gcloud.compute.addresses.describe) Could not fetch resource:
W0223 01:05:58.668]  - The resource 'projects/k8s-infra-e2e-boskos-010/regions/us-west1/addresses/bootstrap-e2e-master-ip' was not found

@heyste
Copy link
Member

heyste commented Feb 23, 2022

/test pull-kubernetes-e2e-kind-ipv6
unrelated flake Pod Container lifecycle should not create extra sandbox if all containers are done

/home/prow/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/test/e2e/node/pods.go:484
Feb 23 01:11:58.548: Unexpected error:     
<*errors.errorString \| 0xc000210250>: {
         s: "timed out waiting for the condition",
     }
     timed out waiting for the condition
occurred
/home/prow/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/test/e2e/node/pods.go:528

@SergeyKanzhelev SergeyKanzhelev moved this from Triage to PRs - Needs Reviewer in SIG Node CI/Test Board Feb 23, 2022
@SergeyKanzhelev
Copy link
Member

/priority backlog

@k8s-ci-robot k8s-ci-robot added priority/backlog Higher priority than priority/awaiting-more-evidence. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Feb 23, 2022
@SergeyKanzhelev
Copy link
Member

/cc @endocrimes

Copy link
Member

@endocrimes endocrimes left a comment

Choose a reason for hiding this comment

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

Took a quick first pass - Seems like an ok happy-path test, we might want to add a failure case test too? (that some field cannot be updated for example)

})

ginkgo.It("should replace a pod template", func() {

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

nit: rm extra line here

Copy link
Member

Choose a reason for hiding this comment

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

Fixed


err = retry.RetryOnConflict(retry.DefaultRetry, func() error {
ptResource, err = ptClient.Get(context.TODO(), ptName, metav1.GetOptions{})
framework.ExpectNoError(err, "Unable to pod template %s", ptName)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
framework.ExpectNoError(err, "Unable to pod template %s", ptName)
framework.ExpectNoError(err, "Unable to get pod template %s", ptName)

Copy link
Member

Choose a reason for hiding this comment

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

Fixed

ptResource, err := ptClient.Create(context.TODO(), &v1.PodTemplate{
ObjectMeta: metav1.ObjectMeta{
Name: ptName,
Labels: map[string]string{"podtemplate-set": "true"},
Copy link
Member

Choose a reason for hiding this comment

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

Copy/paste from the previous test? - should probably be removed here because we don't use it in the test.

Copy link
Member

Choose a reason for hiding this comment

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

Fixed. Removed Line 176 reference for Labels

Comment on lines 187 to 197
ptResource.Annotations = map[string]string{
"updated": "true",
}
updatedPT, err := ptClient.Update(context.TODO(), ptResource, metav1.UpdateOptions{})

err = retry.RetryOnConflict(retry.DefaultRetry, func() error {
ptResource, err = ptClient.Get(context.TODO(), ptName, metav1.GetOptions{})
framework.ExpectNoError(err, "Unable to get pod template %s", ptName)

updatedPT, err = ptClient.Update(context.TODO(), ptResource, metav1.UpdateOptions{})
return err
})
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
ptResource.Annotations = map[string]string{
"updated": "true",
}
updatedPT, err := ptClient.Update(context.TODO(), ptResource, metav1.UpdateOptions{})
err = retry.RetryOnConflict(retry.DefaultRetry, func() error {
ptResource, err = ptClient.Get(context.TODO(), ptName, metav1.GetOptions{})
framework.ExpectNoError(err, "Unable to get pod template %s", ptName)
updatedPT, err = ptClient.Update(context.TODO(), ptResource, metav1.UpdateOptions{})
return err
})
var updatedPT *v1.PodTemplate
err = retry.RetryOnConflict(retry.DefaultRetry, func() error {
ptResource, err = ptClient.Get(context.TODO(), ptName, metav1.GetOptions{})
framework.ExpectNoError(err, "Unable to get pod template %s", ptName)
ptResource.Annotations = map[string]string{
"updated": "true",
}
updatedPT, err = ptClient.Update(context.TODO(), ptResource, metav1.UpdateOptions{})
return err
})

Copy link
Member

Choose a reason for hiding this comment

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

Fixed


err = retry.RetryOnConflict(retry.DefaultRetry, func() error {
ptResource, err = ptClient.Get(context.TODO(), ptName, metav1.GetOptions{})
framework.ExpectNoError(err, "Unable to get pod template %s", ptName)
Copy link
Member

Choose a reason for hiding this comment

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

ptResource.Annotations will not contain updated=true annotation after the Get.

The test validates the following endpoint
- replaceCoreV1NamespacedPodTemplate
@heyste
Copy link
Member

heyste commented Feb 25, 2022

/test pull-kubernetes-unit
unrelated flake?

 === FAIL: vendor/k8s.io/client-go/metadata/metadatainformer TestMetadataSharedInformerFactory/scenario_1:_test_if_adding_an_object_triggers_AddFunc (3.00s)
...
     --- FAIL: TestMetadataSharedInformerFactory/scenario_1:_test_if_adding_an_object_triggers_AddFunc (3.00s)
=== FAIL: vendor/k8s.io/client-go/metadata/metadatainformer TestMetadataSharedInformerFactory (3.21s) 

@pacoxu
Copy link
Member

pacoxu commented Feb 25, 2022

@heyste
Copy link
Member

heyste commented Feb 25, 2022

/test pull-kubernetes-conformance-kind-ipv6-parallel
multiple unrelated flakes

 s: "timed out waiting for the condition",

@pacoxu
Copy link
Member

pacoxu commented Feb 25, 2022

/lgtm
/assign @SergeyKanzhelev

@pacoxu pacoxu moved this from Triage to Needs Approver in SIG Node PR Triage Feb 25, 2022
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 25, 2022
@pacoxu pacoxu moved this from PRs - Needs Reviewer to PRs - Needs Approver in SIG Node CI/Test Board Feb 25, 2022
@heyste
Copy link
Member

heyste commented Feb 25, 2022

/test pull-kubernetes-conformance-kind-ipv6-parallel
multiple unrelated flakes

Unexpected error:
    <*errors.errorString | 0xc000210250>: {
        s: "timed out waiting for the condition",
    }
    timed out waiting for the condition
occurred

@heyste
Copy link
Member

heyste commented Feb 25, 2022

/test pull-kubernetes-integration
unrelated flake

JUnit
133/133 Tests Passed!

Checking the end of build-log.txt

/entrypoint.Options.ExecuteProcess","level":"error","msg":"Process did not finish before 2h0m0s timeout","severity":"error","time":"2022-02-25T04:31:35Z"}

Copy link
Member

@endocrimes endocrimes left a comment

Choose a reason for hiding this comment

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

/lgtm

@dims
Copy link
Member

dims commented Feb 28, 2022

/approve
/hold

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 28, 2022
Copy link
Member

@SergeyKanzhelev SergeyKanzhelev left a comment

Choose a reason for hiding this comment

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

/unhold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 28, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dims, endocrimes, Riaankl, SergeyKanzhelev

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@mrunalp mrunalp moved this from Needs Approver to Done in SIG Node PR Triage Mar 1, 2022
@k8s-ci-robot k8s-ci-robot merged commit 1cc8edb into kubernetes:master Mar 1, 2022
conformance-definition automation moved this from In Progress /Active Issues to Done Mar 1, 2022
SIG Node CI/Test Board automation moved this from PRs - Needs Approver to Done Mar 1, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.24 milestone Mar 1, 2022
@riaankleinhans riaankleinhans moved this from Done to Promotion PRs Needing Two Weeks (flake free) in conformance-definition Mar 1, 2022
@riaankleinhans riaankleinhans moved this from Promotion PRs Needing Two Weeks (flake free) to Done in conformance-definition Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/conformance Issues or PRs related to kubernetes conformance tests area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/backlog Higher priority than priority/awaiting-more-evidence. release-note-none Denotes a PR that doesn't merit a release note. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Archived in project
Archived in project
Development

Successfully merging this pull request may close these issues.

Write replaceCoreV1NamespacedPodTemplate test - +1 endpoint coverage
7 participants