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

[fix][fn] Support customizing TLS config for function download command #20482

Conversation

michaeljmarshall
Copy link
Member

Motivation

We support configuring custom TLS trusted certs when running functions, but not when downloading them. This PR fixes that by mapping the configuration in the same way we do with functions:

args.add("--use_tls");
args.add(Boolean.toString(authConfig.isUseTls()));
args.add("--tls_allow_insecure");
args.add(Boolean.toString(authConfig.isTlsAllowInsecureConnection()));
args.add("--hostname_verification_enabled");
args.add(Boolean.toString(authConfig.isTlsHostnameVerificationEnable()));
if (isNotBlank(authConfig.getTlsTrustCertsFilePath())) {
args.add("--tls_trust_cert_path");
args.add(authConfig.getTlsTrustCertsFilePath());
}

Modifications

  • Configure using TLS, allowing insecure TLS, hostname verification, and the custom trusted cert path

Verifying this change

I added a new test.

Documentation

  • doc-not-needed

@codecov-commenter
Copy link

Codecov Report

Merging #20482 (69c28fe) into master (e220a5d) will increase coverage by 0.34%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #20482      +/-   ##
============================================
+ Coverage     72.59%   72.94%   +0.34%     
- Complexity    31719    31907     +188     
============================================
  Files          1867     1867              
  Lines        138523   138529       +6     
  Branches      15204    15205       +1     
============================================
+ Hits         100555   101044     +489     
+ Misses        29955    29469     -486     
- Partials       8013     8016       +3     
Flag Coverage Δ
inttests 24.20% <0.00%> (+0.06%) ⬆️
systests 25.11% <0.00%> (+0.12%) ⬆️
unittests 72.21% <100.00%> (+0.36%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...unctions/runtime/kubernetes/KubernetesRuntime.java 38.96% <100.00%> (+0.61%) ⬆️

... and 118 files with indirect coverage changes

Copy link
Member

@tisonkun tisonkun left a comment

Choose a reason for hiding this comment

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

LGTM.

Although, I don't think such a new feature should be picked to any previous versions.

May or may not we loose the rule for 3.0 the LTS version, but at least not for 2.9 which is end of life.

Copy link
Member

@tisonkun tisonkun left a comment

Choose a reason for hiding this comment

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

Sorry. I notice that it respects existing passed values instead of new options. Then it's reasonable to pick, while still may not for 2.9 (and 2.10?) which is EOL.

@tisonkun
Copy link
Member

tisonkun commented Jun 2, 2023

Merging...

@tisonkun tisonkun merged commit ceed19c into apache:master Jun 2, 2023
@michaeljmarshall michaeljmarshall deleted the allow-function-download-with-custom-cert branch June 3, 2023 03:30
@michaeljmarshall
Copy link
Member Author

Sorry. I notice that it respects existing passed values instead of new options. Then it's reasonable to pick, while still may not for 2.9 (and 2.10?) which is EOL.

I haven't seen us declare 2.9 EOL, and the PIP 47 that would indicate that it is EOL hasn't really been followed. I'm going to cherry pick it, and then if it gets released, it's there.

@michaeljmarshall
Copy link
Member Author

Looks like it doesn't apply cleanly. I'll have to investigate cherry picking it a bit more.

michaeljmarshall added a commit that referenced this pull request Jun 7, 2023
### Motivation

#20482 broke the function download command with this error:

```
Expected a command, got false
Usage: pulsar-admin [options] [command] [command options]
  Options:
    --admin-url
      Admin Service URL to which to connect.
      Default: http://localhost:8080/
```

The problem is that the TLS args for hostname verification and for insecure TLS are zero arity, and therefore, we should not add the `false` or the `true` arguments.

### Modifications

* Correct the changes made to the TLS args passed to the `pulsar-admin` CLI tool

### Documentation

- [x] `doc-not-needed`
michaeljmarshall added a commit that referenced this pull request Jun 7, 2023
### Motivation

#20482 broke the function download command with this error:

```
Expected a command, got false
Usage: pulsar-admin [options] [command] [command options]
  Options:
    --admin-url
      Admin Service URL to which to connect.
      Default: http://localhost:8080/
```

The problem is that the TLS args for hostname verification and for insecure TLS are zero arity, and therefore, we should not add the `false` or the `true` arguments.

### Modifications

* Correct the changes made to the TLS args passed to the `pulsar-admin` CLI tool

### Documentation

- [x] `doc-not-needed`

(cherry picked from commit 50b9a93)
michaeljmarshall added a commit that referenced this pull request Jun 7, 2023
### Motivation

This PR is a combination of #20482 and #20513 because cherry picking those PRs produced too many conflicts.

### Modifications

* Made the same addition as the source PRs, though the code has changed a bit, so I had to make a few extra changes.
### Documentation

- [x] `doc-not-needed`
michaeljmarshall added a commit that referenced this pull request Jun 7, 2023
### Motivation

This PR is a combination of #20482 and #20513 because cherry picking those PRs produced too many conflicts.

### Modifications

* Made the same addition as the source PRs, though the code has changed a bit, so I had to make a few extra changes.
### Documentation

- [x] `doc-not-needed`

(cherry picked from commit 8c9c6e9)
michaeljmarshall added a commit that referenced this pull request Jun 7, 2023
### Motivation

This PR is a combination of #20482 and #20513 because cherry picking those PRs produced too many conflicts.

### Modifications

* Made the same addition as the source PRs, though the code has changed a bit, so I had to make a few extra changes.
### Documentation

- [x] `doc-not-needed`

(cherry picked from commit 8c9c6e9)
michaeljmarshall added a commit to datastax/pulsar that referenced this pull request Jun 7, 2023
michaeljmarshall added a commit to datastax/pulsar that referenced this pull request Jun 7, 2023
### Motivation

apache#20482 broke the function download command with this error:

```
Expected a command, got false
Usage: pulsar-admin [options] [command] [command options]
  Options:
    --admin-url
      Admin Service URL to which to connect.
      Default: http://localhost:8080/
```

The problem is that the TLS args for hostname verification and for insecure TLS are zero arity, and therefore, we should not add the `false` or the `true` arguments.

### Modifications

* Correct the changes made to the TLS args passed to the `pulsar-admin` CLI tool

### Documentation

- [x] `doc-not-needed`

(cherry picked from commit 50b9a93)
@michaeljmarshall
Copy link
Member Author

As discussed on the mailing list https://lists.apache.org/thread/w4jzk27qhtosgsz7l9bmhf1t7o9mxjhp, there is no plan to release 2.9.6, so I am going to remove the release/2.9.6 label

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants