Skip to content

[fix][fn] Supply download auth params when provided for k8s runtime - #20144

Merged
michaeljmarshall merged 1 commit into
apache:masterfrom
michaeljmarshall:fix-function-k8s-runtime
Apr 19, 2023
Merged

michaeljmarshall merged 1 commit into
apache:masterfrom
michaeljmarshall:fix-function-k8s-runtime

Conversation

@michaeljmarshall

@michaeljmarshall michaeljmarshall commented Apr 19, 2023 •

Copy link
Copy Markdown
Member

PIP: #19849

Motivation

The new KubernetesServiceAccountTokenAuthProvider introduced by #19888 does not configure the authentication for download because there is an unnecessary check that the getFunctionAuthenticationSpec is not null. Given that we do not use this spec in creating the auth, it is unnecessary to use here. Further, when we construct the function's authentication, we do not have this null check. See:

if (isNotBlank(authConfig.getClientAuthenticationPlugin())
&& isNotBlank(authConfig.getClientAuthenticationParameters())) {
args.add("--client_auth_plugin");
args.add(authConfig.getClientAuthenticationPlugin());
args.add("--client_auth_params");
args.add(authConfig.getClientAuthenticationParameters());
}

Modifications

  • Update the KubernetesRuntime to add authentication params to the download command when provided.

Verifying this change

A new test is added.

Documentation

  • doc-not-needed

Matching PR in forked repository

PR in forked repository: Skipping for this trivial PR

@michaeljmarshall michaeljmarshall added this to the 3.0.0 milestone Apr 19, 2023
@michaeljmarshall michaeljmarshall self-assigned this Apr 19, 2023
@michaeljmarshall michaeljmarshall changed the title [fix][fn] Supply download auth params when provided [fix][fn] Supply download auth params when provided for k8s runtime Apr 19, 2023
@michaeljmarshall
michaeljmarshall requested a review from dlg99 April 19, 2023 21:49

@dlg99 dlg99 left a comment

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.

LGTM

@michaeljmarshall
michaeljmarshall merged commit 4f2b8e2 into apache:master Apr 19, 2023
@michaeljmarshall
michaeljmarshall deleted the fix-function-k8s-runtime branch April 19, 2023 22:52
michaeljmarshall added a commit that referenced this pull request Apr 19, 2023
…20144)

PIP: #19849

### Motivation

The new `KubernetesServiceAccountTokenAuthProvider` introduced by #19888  does not configure the authentication for download because there is an unnecessary check that the `getFunctionAuthenticationSpec` is not `null`. Given that we do not use this spec in creating the auth, it is unnecessary to use here. Further, when we construct the function's authentication, we do not have this null check. See:

https://github.com/apache/pulsar/blob/ec102fb024a6ea2b195826778300f20e330dff06/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/RuntimeUtils.java#L411-L417

### Modifications

* Update the `KubernetesRuntime` to add authentication params to the download command when provided.

### Verifying this change

A new test is added.

### Documentation

- [x] `doc-not-needed`

### Matching PR in forked repository

PR in forked repository: Skipping for this trivial PR

(cherry picked from commit 4f2b8e2)
michaeljmarshall added a commit to michaeljmarshall/pulsar that referenced this pull request Apr 20, 2023
…pache#20144)

PIP: apache#19849

### Motivation

The new `KubernetesServiceAccountTokenAuthProvider` introduced by apache#19888  does not configure the authentication for download because there is an unnecessary check that the `getFunctionAuthenticationSpec` is not `null`. Given that we do not use this spec in creating the auth, it is unnecessary to use here. Further, when we construct the function's authentication, we do not have this null check. See:

https://github.com/apache/pulsar/blob/ec102fb024a6ea2b195826778300f20e330dff06/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/RuntimeUtils.java#L411-L417

### Modifications

* Update the `KubernetesRuntime` to add authentication params to the download command when provided.

### Verifying this change

A new test is added.

### Documentation

- [x] `doc-not-needed`

### Matching PR in forked repository

PR in forked repository: Skipping for this trivial PR

(cherry picked from commit 4f2b8e2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants