Skip to content

Commit

Permalink
chore: Remove installer code
Browse files Browse the repository at this point in the history
  • Loading branch information
alexec committed May 14, 2021
1 parent 8c2dd33 commit 2a44fcb
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 287 deletions.
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ RUN --mount=type=cache,target=/root/.cache/go-build CGO_ENABLED=0 go build -a -l
FROM gcr.io/distroless/static:nonroot AS controller
WORKDIR /
COPY --from=controller-builder /workspace/bin/manager .
COPY config/kafka-default.yaml /config/
COPY config/stan-default.yaml /config/
USER 9653:9653
ENTRYPOINT ["/manager"]

Expand Down
248 changes: 0 additions & 248 deletions manager/controllers/bus/installer.go

This file was deleted.

13 changes: 0 additions & 13 deletions manager/controllers/bus/installer_test.go

This file was deleted.

19 changes: 0 additions & 19 deletions manager/controllers/pipeline_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"

dfv1 "github.com/argoproj-labs/argo-dataflow/api/v1alpha1"
"github.com/argoproj-labs/argo-dataflow/manager/controllers/bus"
"github.com/argoproj-labs/argo-dataflow/shared/containerkiller"
"github.com/argoproj-labs/argo-dataflow/shared/util"
)
Expand All @@ -43,7 +42,6 @@ type PipelineReconciler struct {
Log logr.Logger
Scheme *runtime.Scheme
ContainerKiller containerkiller.Interface
Installer bus.Installer
}

// +kubebuilder:rbac:groups=dataflow.argoproj.io,resources=pipelines,verbs=get;list;watch;create;update;patch;delete
Expand All @@ -68,23 +66,6 @@ func (r *PipelineReconciler) Reconcile(ctx context.Context, req ctrl.Request) (c
return ctrl.Result{}, nil
}

if r.Installer != nil && pipeline.Status == nil {
r.Log.Info("first reconciliation, installing requisite buses")
for _, step := range pipeline.Spec.Steps {
for _, x := range step.Sources {
if y := x.Kafka; y != nil {
if err := r.Installer.Install(ctx, "kafka-"+y.Name, req.Namespace); err != nil {
return ctrl.Result{}, fmt.Errorf("failed to install kafka: %w", err)
}
} else if y := x.STAN; y != nil {
if err := r.Installer.Install(ctx, "stan-"+y.Name, req.Namespace); err != nil {
return ctrl.Result{}, fmt.Errorf("failed to install stan: %w", err)
}
}
}
}
}

log.Info("reconciling", "steps", len(pipeline.Spec.Steps))

for _, step := range pipeline.Spec.Steps {
Expand Down
6 changes: 1 addition & 5 deletions manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@ import (
"fmt"
"os"

"k8s.io/client-go/kubernetes"

"github.com/argoproj-labs/argo-dataflow/manager/controllers/bus"

"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/kubernetes"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
_ "k8s.io/client-go/plugin/pkg/client/auth"
ctrl "sigs.k8s.io/controller-runtime"
Expand Down Expand Up @@ -79,7 +76,6 @@ func main() {
Log: ctrl.Log.WithName("controllers").WithName("Pipeline"),
Scheme: mgr.GetScheme(),
ContainerKiller: containerKiller,
Installer: bus.NewInstaller(),
}).SetupWithManager(mgr); err != nil {
panic(fmt.Errorf("unable to create controller manager: %w", err))
}
Expand Down

0 comments on commit 2a44fcb

Please sign in to comment.