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

sets UserIdentity #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/main/java/io/kestra/plugin/azure/batch/models/Task.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

import com.microsoft.azure.batch.protocol.models.EnvironmentSetting;
import com.microsoft.azure.batch.protocol.models.TaskAddParameter;
import com.microsoft.azure.batch.protocol.models.AutoUserScope;
import com.microsoft.azure.batch.protocol.models.AutoUserSpecification;
import com.microsoft.azure.batch.protocol.models.UserIdentity;
import com.microsoft.azure.batch.protocol.models.ElevationLevel;

import io.kestra.core.exceptions.IllegalVariableEvaluationException;
import io.kestra.core.models.annotations.PluginProperty;
import io.kestra.core.runners.RunContext;
Expand Down Expand Up @@ -149,6 +154,14 @@ public class Task {
public TaskAddParameter to(RunContext runContext) throws IllegalVariableEvaluationException {
return new TaskAddParameter()
.withId(this.id == null ? IdUtils.create() : runContext.render(this.id))
.withUserIdentity(
new UserIdentity()
.withAutoUser(
new AutoUserSpecification()
.withElevationLevel(ElevationLevel.NON_ADMIN)
.withScope(AutoUserScope.TASK)
)
)
.withDisplayName(runContext.render(this.displayName))
.withCommandLine(runContext.render(this.commandLine(runContext)))
.withContainerSettings(this.containerSettings == null ? null : this.containerSettings.to(runContext))
Expand Down