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

Move webhook #613

Merged
merged 9 commits into from
Mar 16, 2023
Merged

Move webhook #613

merged 9 commits into from
Mar 16, 2023

Conversation

jiangpengcheng
Copy link
Member

(If this PR fixes a github issue, please add Fixes #<xyz>.)

Fixes #612

(or if this PR is one task of a github issue, please add Master Issue: #<xyz> to link to the master issue.)

Master Issue: #

Motivation

Explain here the context, and why you're making that change. What is the problem you're trying to solve.

Modifications

Describe the modifications you've done.

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

Documentation

Check the box below.

Need to update docs?

  • doc-required

    (If you need help on updating docs, create a doc issue)

  • no-need-doc

    (Please explain why)

  • doc

    (If this PR contains doc changes)

@jiangpengcheng jiangpengcheng requested review from nlu90, freeznet and a team as code owners March 14, 2023 09:23
@github-actions github-actions bot added the no-need-doc This pr does not need any document label Mar 14, 2023
@tpiperatgod
Copy link
Contributor

How about putting utility code like webhooks into a pkg directory?

@jiangpengcheng
Copy link
Member Author

code

do you mean use below strcture?

pkg/
  api/
  controllers/
  webhook/
  ...

@tpiperatgod
Copy link
Contributor

tpiperatgod commented Mar 15, 2023

code

do you mean use below strcture?

pkg/
  api/
  controllers/
  webhook/
  ...

yes, something like this, but keep the apis and controllers outside

@jiangpengcheng
Copy link
Member Author

is there any reason to do that?

@tpiperatgod
Copy link
Contributor

I think this will help to keep the root directory more concise...

@jiangpengcheng
Copy link
Member Author

I think this will help to keep the root directory more concise...

I think pkg doesn't look more concise than webhook

move all go packages dir to the pkg seems more readable

any opinions @freeznet @nlu90 ?

@tpiperatgod
Copy link
Contributor

It seems to me that pkg could be used to store code used by /apis and /controllers, including webhook, not just replacing the name of the webhook directory.

freeznet
freeznet previously approved these changes Mar 16, 2023
@freeznet freeznet merged commit a232adf into streamnative:master Mar 16, 2023
@@ -285,19 +312,37 @@ func (r *Function) ValidateCreate() error {
return nil
}

return apierrors.NewInvalid(schema.GroupKind{Group: "compute.functionmesh.io", Kind: "Function"}, r.Name, allErrs)
return apierrors.NewInvalid(schema.GroupKind{Group: "compute.functionmesh.io", Kind: "FunctionWebhook"}, r.Name, allErrs)
Copy link
Contributor

Choose a reason for hiding this comment

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

This change is incorrect, should be reverted.

@@ -195,19 +223,37 @@ func (r *Source) ValidateCreate() error {
return nil
}

return apierrors.NewInvalid(schema.GroupKind{Group: "compute.functionmesh.io", Kind: "Source"}, r.Name, allErrs)
return apierrors.NewInvalid(schema.GroupKind{Group: "compute.functionmesh.io", Kind: "SourceWebhook"}, r.Name, allErrs)
Copy link
Contributor

Choose a reason for hiding this comment

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

This change is incorrect, should be reverted.

@@ -205,19 +233,37 @@ func (r *Sink) ValidateCreate() error {
return nil
}

return apierrors.NewInvalid(schema.GroupKind{Group: "compute.functionmesh.io", Kind: "Sink"}, r.Name, allErrs)
return apierrors.NewInvalid(schema.GroupKind{Group: "compute.functionmesh.io", Kind: "SinkWebhook"}, r.Name, allErrs)
Copy link
Contributor

Choose a reason for hiding this comment

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

This change is incorrect, should be reverted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
m/2023-03 no-need-doc This pr does not need any document
Projects
None yet
Development

Successfully merging this pull request may close these issues.

move webhook code out of api package
4 participants