Skip to content

Commit 654e0d2

Browse files
committed
slight refactor
1 parent 3f2f439 commit 654e0d2

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

internal/controller/conduit_containers.go

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package controller
22

33
import (
44
"fmt"
5-
"log"
65
"path"
76
"path/filepath"
87
"strings"
@@ -77,7 +76,6 @@ func (c *commandBuilder[T]) renderScript() string {
7776
for _, build := range c.builds {
7877
final = append(final, build.steps()...)
7978
}
80-
log.Println(strings.Join(final, " && "))
8179
return strings.Join(final, " && ")
8280
}
8381

@@ -124,6 +122,7 @@ func ConduitInitContainers(cc []*v1alpha.ConduitConnector, cp []*v1alpha.Conduit
124122
},
125123
}
126124

125+
allProcessors := cp
127126
for _, c := range cc {
128127
if !strings.HasPrefix(c.Plugin, "builtin") {
129128
builder.addBuild(connectorBuild{
@@ -134,14 +133,12 @@ func ConduitInitContainers(cc []*v1alpha.ConduitConnector, cp []*v1alpha.Conduit
134133
ldflags: fmt.Sprintf(`-ldflags "-X 'github.com/%s.version=%s'"`, c.Plugin, c.PluginVersion),
135134
})
136135
}
137-
for _, p := range c.Processors {
138-
if !strings.HasPrefix(p.Plugin, "builtin") && p.ProcessorURL != "" {
139-
pBuilder.addBuild(processorBuild{name: p.Plugin, procUrl: p.ProcessorURL, targetDir: v1alpha.ConduitProcessorsPath})
140-
}
136+
if len(c.Processors) > 0 {
137+
allProcessors = append(allProcessors, c.Processors...)
141138
}
142139
}
143-
// handles processors that are not part of a connector
144-
for _, p := range cp {
140+
// handles standalone processors that need WASM downloaded
141+
for _, p := range allProcessors {
145142
if !strings.HasPrefix(p.Plugin, "builtin") && p.ProcessorURL != "" {
146143
pBuilder.addBuild(processorBuild{name: p.Plugin, procUrl: p.ProcessorURL, targetDir: v1alpha.ConduitProcessorsPath})
147144
}

internal/controller/conduit_containers_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ func Test_ConduitInitProcessorsContainers(t *testing.T) {
496496
Args: []string{
497497
"sh", "-xe",
498498
"-c",
499-
"wget -O /conduit.storage/processors/processor http://example.com/processor && wget -O /conduit.storage/processors/processor1 http://example.com/processor1",
499+
"wget -O /conduit.storage/processors/processor1 http://example.com/processor1 && wget -O /conduit.storage/processors/processor http://example.com/processor",
500500
},
501501
VolumeMounts: []corev1.VolumeMount{
502502
{

0 commit comments

Comments
 (0)