Skip to content

Commit

Permalink
fix: store secret for kaniko runs
Browse files Browse the repository at this point in the history
  • Loading branch information
matteo-s committed May 7, 2024
1 parent 31f299a commit 5ffba49
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
18 changes: 18 additions & 0 deletions modules/framework-k8s/.flattened-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,24 @@
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
<version>3.2.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-oauth2-resource-server</artifactId>
<version>6.2.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-oauth2-jose</artifactId>
<version>6.2.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import io.kubernetes.client.openapi.models.V1PodSpec;
import io.kubernetes.client.openapi.models.V1PodTemplateSpec;
import io.kubernetes.client.openapi.models.V1ResourceRequirements;
import io.kubernetes.client.openapi.models.V1Secret;
import io.kubernetes.client.openapi.models.V1Volume;
import io.kubernetes.client.openapi.models.V1VolumeMount;
import it.smartcommunitylabdhub.commons.annotations.infrastructure.FrameworkComponent;
Expand Down Expand Up @@ -79,6 +80,12 @@ public K8sKanikoFramework(ApiClient apiClient) {
@Override
public K8sKanikoRunnable run(K8sKanikoRunnable runnable) throws K8sFrameworkException {
V1Job job = build(runnable);

//secrets
V1Secret secret = buildRunSecret(runnable);
if (secret != null) {
storeRunSecret(secret);
}
job = create(job);

// Update runnable state..
Expand Down

0 comments on commit 5ffba49

Please sign in to comment.