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

Adding --tls option to domain create command #1419

Merged
merged 10 commits into from
Aug 10, 2021

Conversation

vyasgun
Copy link
Contributor

@vyasgun vyasgun commented Aug 5, 2021

Description

Support for TLS optionn in domain create using --tls flag

Changes

  • Added the new flag
  • Added unit tests for the new flag

Reference

Fixes #1408

@google-cla google-cla bot added the cla: yes Indicates the PR's author has signed the CLA. label Aug 5, 2021
Copy link
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

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

@vyasgun: 0 warnings.

In response to this:

Description

Support for TLS optionn in domain create

Changes

  • Added the new flag
  • Added unit tests for the new flag

Reference

Fixes #1408

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.

@knative-prow-robot knative-prow-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Aug 5, 2021
@codecov
Copy link

codecov bot commented Aug 5, 2021

Codecov Report

Merging #1419 (053d265) into main (4691210) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1419      +/-   ##
==========================================
+ Coverage   78.68%   78.70%   +0.02%     
==========================================
  Files         162      162              
  Lines        8359     8368       +9     
==========================================
+ Hits         6577     6586       +9     
  Misses       1098     1098              
  Partials      684      684              
Impacted Files Coverage Δ
pkg/kn/commands/domain/domain.go 95.45% <ø> (ø)
pkg/kn/commands/domain/create.go 79.48% <100.00%> (+3.01%) ⬆️
pkg/serving/v1alpha1/client.go 82.69% <100.00%> (+1.44%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4691210...053d265. Read the comment docs.

@knative-prow-robot knative-prow-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 5, 2021
vyasgun and others added 2 commits August 5, 2021 17:37
Co-authored-by: David Simansky <dsimansk@redhat.com>
@dsimansk
Copy link
Contributor

dsimansk commented Aug 5, 2021

Thanks @vyasgun!
/lgtm

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

@maximilien maximilien left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution
/ok-to-test

@knative-prow-robot knative-prow-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Aug 9, 2021
@maximilien
Copy link
Contributor

/lgtm

Copy link
Contributor

@rhuss rhuss left a comment

Choose a reason for hiding this comment

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

Thanks, looks good to me ! I have some minor proposal wrt/ to naming, maybe we could change this so that we can add this PR to the upcoming release 0.25 (due today :) ?

@@ -44,6 +44,7 @@ func NewDomainCommand(p *commands.KnParams) *cobra.Command {

type RefFlags struct {
reference string
tls string
Copy link
Contributor

Choose a reason for hiding this comment

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

happy to keep it, but maybe certSecret would be more appropriate ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think tls might be better because it corresponds to the flag name (--tls).

Co-authored-by: Roland Huß <rhuss@redhat.com>
@knative-prow-robot knative-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Aug 10, 2021
vyasgun and others added 2 commits August 10, 2021 12:29
@vyasgun vyasgun requested a review from rhuss August 10, 2021 07:19
Copy link
Contributor

@rhuss rhuss left a comment

Choose a reason for hiding this comment

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

Thanks !

/approve
/lgtm

@knative-prow-robot knative-prow-robot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Aug 10, 2021
@rhuss
Copy link
Contributor

rhuss commented Aug 10, 2021

/retest

Looks like there is some flake in the e2e tests, which might be due to recreating the same domain too fast after it has been deleted. @vyasgun good we adjust the test to use a different domain for the --tls test, so that we can avoid the race condition in the future ?

      ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
        🦆 kn domain delete hello.example.com --namespace kne2etests12
        ┃ Domain mapping 'hello.example.com' deleted in namespace 'kne2etests12'.
        ┃ 
        ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
        🦆 kn domain create hello.example.com --ref hello --tls tls-secret --namespace kne2etests12
        ┃ 
        🔥 Error: object is being deleted: domainmappings.serving.knative.dev "hello.example.com" already exists
        🔥 Run 'kn --help' for usage
        🔥 
        =================================================================

@knative-prow-robot knative-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Aug 10, 2021
@dsimansk
Copy link
Contributor

Thanks!

/approve
/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 10, 2021
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dsimansk, rhuss, vyasgun

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

@rhuss
Copy link
Contributor

rhuss commented Aug 10, 2021

The new error might be also a race condition, e.g. describe too quick after the domain has been created. I wonder whether we should also add a sync-wait when creating the domain in a future enhancement. For now, I would try to add some hardcoded delay between create and describe.

Also, I wonder whether the serving controller checks, if the referenced secret really exists (not sure if you have created in the test, too ?)

@vyasgun
Copy link
Contributor Author

vyasgun commented Aug 10, 2021

/retest

@dsimansk
Copy link
Contributor

dsimansk commented Aug 10, 2021

And maybe it's working well only for example.com? I wonder if newdomain.com shouldn't be rather e.g. new.example.com.

Because of ClusterDomainClaim???

@vyasgun
Copy link
Contributor Author

vyasgun commented Aug 10, 2021

@rhuss no it doesn't check if the secret exists. As per the referenced PR for the serving side change, the secret should be created if it doesn't exist. I haven't tested what happens in the backend but mentioning a TLS secret name in the spec changes the URL to https

@knative-prow-robot knative-prow-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed lgtm Indicates that a PR is ready to be merged. labels Aug 10, 2021
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 10, 2021
@knative-metrics-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-knative-client-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/kn/commands/domain/create.go 85.2% 87.1% 1.9
pkg/serving/v1alpha1/client.go 88.4% 89.4% 1.0

@dsimansk
Copy link
Contributor

/retest

@dsimansk
Copy link
Contributor

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 10, 2021
@knative-prow-robot knative-prow-robot merged commit ce790b4 into knative:main Aug 10, 2021
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

Support tls option for kn domain create
6 participants