Skip to content

Commit

Permalink
WIP. Rename Konflux Pipeleines class to KonfluxProvider
Browse files Browse the repository at this point in the history
Signed-off-by: cmoulliard <[email protected]>
  • Loading branch information
cmoulliard committed Sep 19, 2024
1 parent 0399dd8 commit 154ddec
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
3 changes: 2 additions & 1 deletion src/main/java/dev/snowdrop/factory/WorkflowBuilder.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package dev.snowdrop.factory;

import dev.snowdrop.factory.konflux.KonfluxProvider;
import dev.snowdrop.factory.tekton.TektonProvider;

public class WorkflowBuilder {
Expand All @@ -11,7 +12,7 @@ public Builder withProvider(Type providerType) {
private static Provider createProvider(String provider) {
switch (provider.toUpperCase()) {
case "KONFLUX":
return new dev.snowdrop.factory.konflux.pipeline.Pipelines();
return new KonfluxProvider();
case "TEKTON":
return new TektonProvider();
default:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dev.snowdrop.factory.konflux.pipeline;
package dev.snowdrop.factory.konflux;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
Expand Down Expand Up @@ -30,9 +30,9 @@
import static dev.snowdrop.service.RemoteTaskSvc.BUNDLE_PREFIX;
import static dev.snowdrop.service.RemoteTaskSvc.fetchExtractTask;

public class Pipelines implements Provider {
public class KonfluxProvider implements Provider {

private static final Logger logger = LoggerFactory.getLogger(Pipelines.class);
private static final Logger logger = LoggerFactory.getLogger(KonfluxProvider.class);
private static Type TYPE = null;
private static final String BUILD_TASK_NAME = "build-container";

Expand Down
22 changes: 11 additions & 11 deletions src/main/java/dev/snowdrop/factory/tekton/PipelineRunBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ public static PipelineRun generatePipelineRun(Type TYPE, Configurator cfg, List<
// @formatter:off
PipelineRun pipelineRun = new io.fabric8.tekton.pipeline.v1.PipelineRunBuilder()
.withNewMetadata()
.withName(cfg.getJob().getName())
.withLabels(LabelsProviderFactory.getProvider(TYPE).getPipelineLabels(cfg))
.withAnnotations(AnnotationsProviderFactory.getProvider(TYPE).getPipelineAnnotations(cfg))
.withNamespace(cfg.getNamespace())
.withName(cfg.getJob().getName())
.withLabels(LabelsProviderFactory.getProvider(TYPE).getPipelineLabels(cfg))
.withAnnotations(AnnotationsProviderFactory.getProvider(TYPE).getPipelineAnnotations(cfg))
.withNamespace(cfg.getNamespace())
.endMetadata()
.withNewSpec()
.withParams(params)
.withWorkspaces(pipelineWorkspaces)
.withTimeouts(populateTimeOut(cfg.getJob().getTimeout()))
.withNewPipelineSpec()
.withResults(pipelineResults)
.withTasks(tasks)
.endPipelineSpec()
.withParams(params)
.withWorkspaces(pipelineWorkspaces)
.withTimeouts(populateTimeOut(cfg.getJob().getTimeout()))
.withNewPipelineSpec()
.withResults(pipelineResults)
.withTasks(tasks)
.endPipelineSpec()
.endSpec()
.build();
// @formatter:on
Expand Down

0 comments on commit 154ddec

Please sign in to comment.