Skip to content

Use interfaces when testing conditions so we don't need versioned methods#1120

Merged
knative-prow-robot merged 1 commit into
knative:masterfrom
dprotaso:duck-hunt
Feb 24, 2020
Merged

Use interfaces when testing conditions so we don't need versioned methods#1120
knative-prow-robot merged 1 commit into
knative:masterfrom
dprotaso:duck-hunt

Conversation

@dprotaso
Copy link
Copy Markdown
Member

@dprotaso dprotaso commented Feb 24, 2020

Downstream PRs

@knative-prow-robot knative-prow-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 24, 2020
@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Feb 24, 2020
@knative-prow-robot knative-prow-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 24, 2020
@dprotaso dprotaso changed the title Use interfaces so we don't need versioned methods Use interfaces when testing conditions so we don't need versioned methods Feb 24, 2020
@dprotaso
Copy link
Copy Markdown
Member Author

hmm
/test pull-knative-pkg-unit-tests

// DEPRECATED: Use versioned test helper
func CheckCondition(s *duckv1b1.Status, c apis.ConditionType, cs corev1.ConditionStatus) error {
cond := s.GetCondition(c)
func CheckCondition(a apis.ConditionAccessor, c apis.ConditionType, cs corev1.ConditionStatus) error {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why not use the condtionManager interface?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That interface is huge for what these helpers need

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

secondly we're passing duck.Status types here

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You might also want gettoplevel in the new interface

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

duck.Status doesn't have that method so don't want to add it

@dprotaso
Copy link
Copy Markdown
Member Author

knative/eventing doesn't use these helpers so that's done

@dprotaso
Copy link
Copy Markdown
Member Author

knative/eventing-contrib doesn't use these helpers so that's done

@dprotaso
Copy link
Copy Markdown
Member Author

knative/sample-controller doesn't use these helpers so that's done

@dprotaso
Copy link
Copy Markdown
Member Author

knative/sample-source doesn't use these helpers so that's done

@dprotaso dprotaso marked this pull request as ready for review February 24, 2020 16:13
@knative-prow-robot knative-prow-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 24, 2020
@dprotaso
Copy link
Copy Markdown
Member Author

@n3wscott PTAL again

@dprotaso
Copy link
Copy Markdown
Member Author

/assign @n3wscott

@n3wscott
Copy link
Copy Markdown
Contributor

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 24, 2020
@n3wscott
Copy link
Copy Markdown
Contributor

/approve

@knative-prow-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dprotaso, n3wscott

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

The pull request process is described here

Details 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 Feb 24, 2020
@knative-prow-robot knative-prow-robot merged commit 5bc49f2 into knative:master Feb 24, 2020
@dprotaso dprotaso deleted the duck-hunt branch February 24, 2020 17:28
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. cla: yes Indicates the PR's author has signed the CLA. 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.

4 participants