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

Allow K8s Services to be Subscription's Call. #489

Merged
merged 3 commits into from
Oct 5, 2018

Conversation

adamharwayne
Copy link
Contributor

Proposed Changes

  • Allow Subscription's call to call K8s Services.

Release Note

NONE

@adamharwayne
Copy link
Contributor Author

/assign @vaikas-google

@knative-prow-robot knative-prow-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 2, 2018
@scothis
Copy link
Contributor

scothis commented Oct 3, 2018

Generally looks good to me, but I'd rather disable the test than enforce a known wrong result.

return "", err
}

if t.Status.Targetable != nil {
return t.Status.Targetable.DomainInternal, nil
}
return "", fmt.Errorf("status does not contain targetable")

// K8s Services are special cased.
Copy link
Contributor

Choose a reason for hiding this comment

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

If we are going to special case them and need to check for them like so below, I think my preference would be to just fetch them directly as Service objects above Line 171, so see if the reference is to a Service object and if so fetch it as such. Rather than pretend they are duck types.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@adamharwayne
Copy link
Contributor Author

Generally looks good to me, but I'd rather disable the test than enforce a known wrong result.

@scothis In general I agree. However I am following the pattern already present in the file. And even this test with the known wrong result has shown bugs in my implementation (got the wrong error message), so has been useful.

I'll leave it to @vaikas-google to decide if he wants the test disabled or enforce this known wrong result.

@adamharwayne
Copy link
Contributor Author

/retest

Copy link
Contributor

@vaikas vaikas left a comment

Choose a reason for hiding this comment

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

Thanks much, couple of tiny requests to ask while you're changing things.

@@ -178,7 +194,7 @@ func (r *reconciler) resolveCall(namespace string, callable v1alpha1.Callable) (
//t := duckv1alpha1.Target{}
Copy link
Contributor

Choose a reason for hiding this comment

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

not your doing (mine), but I neglected to to remove this TODO even though I already did this. Could you remove L193,194.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

getK8sService(),
},
ReconcileKey: fmt.Sprintf("%s/%s", testNS, subscriptionName),
// TODO: JSON patch is not working for some reason. Is this the array vs. non-array, or
Copy link
Contributor

Choose a reason for hiding this comment

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

I figured out what the problem is a few days ago, if you could update these comments with a pointer to this bug:
kubernetes/client-go#478

Then I'd rather leave them here as is for the reasons you already mentioned, it does do quite a few tests and covers most of the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@knative-metrics-robot
Copy link

The following is the coverage report on pkg/.
Say /test pull-knative-eventing-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/controller/eventing/subscription/reconcile.go 77.6% 77.5% -0.1

@scothis
Copy link
Contributor

scothis commented Oct 5, 2018

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 5, 2018
@vaikas
Copy link
Contributor

vaikas commented Oct 5, 2018

/lgtm
/approve

@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adamharwayne, vaikas-google

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

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 5, 2018
@vaikas
Copy link
Contributor

vaikas commented Oct 5, 2018

Retrying the test, failed with:
W1005 09:28:50.173] 2018/10/05 09:28:50 pushed blob sha256:23a3c98e8ffc8b16c00bb8757b1073c65654cdd013d81dd99f1890a1dfac8790
W1005 09:28:50.546] 2018/10/05 09:28:50 gcr.io/knative-boskos-05/keventing-e2e-img/github.com/knative/eventing/pkg/sources/k8sevents:latest: digest: sha256:ad392600d9bea562a13fba9f01c5cda07f9f9128d77f224ede4b2bbbb4b0d193 size: 752
W1005 09:28:50.546] 2018/10/05 09:28:50 Published gcr.io/knative-boskos-05/keventing-e2e-img/github.com/knative/eventing/pkg/sources/k8sevents@sha256:ad392600d9bea562a13fba9f01c5cda07f9f9128d77f224ede4b2bbbb4b0d193
I1005 09:28:51.011] Tagging gcr.io/knative-boskos-05/keventing-e2e-img/github.com/knative/eventing/pkg/sources/k8sevents:sha256:ad392600d9bea562a13fba9f01c5cda07f9f9128d77f224ede4b2bbbb4b0d193
I1005 09:28:51.011] sha256:fd5eb9a8035df5ebf95ab41e4b39585946332ea4eb42fc748e5b437f73d54a06 with e2e
W1005 09:28:51.319] ERROR: (gcloud.container.images.add-tag) A Docker registry domain must be specified.

@vaikas
Copy link
Contributor

vaikas commented Oct 5, 2018

/retest

@knative-prow-robot knative-prow-robot merged commit 90b64fa into knative:master Oct 5, 2018
@Harwayne Harwayne deleted the sub-controller-svc branch January 29, 2019 22:47
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. lgtm Indicates that a PR is ready to be merged. 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.

6 participants