Skip to content

Commit

Permalink
Add AWSCluster
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Goldstein <goldsteina@vmware.com>
  • Loading branch information
ncdc committed Jul 31, 2019
1 parent a97febc commit f7ca984
Show file tree
Hide file tree
Showing 51 changed files with 1,403 additions and 1,913 deletions.
4 changes: 0 additions & 4 deletions cmd/manager/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,11 @@ go_library(
visibility = ["//visibility:private"],
deps = [
"//pkg/apis:go_default_library",
"//pkg/cloud/actuators/cluster:go_default_library",
"//pkg/controller:go_default_library",
"//pkg/record:go_default_library",
"//vendor/k8s.io/client-go/kubernetes/typed/core/v1:go_default_library",
"//vendor/k8s.io/klog:go_default_library",
"//vendor/k8s.io/klog/klogr:go_default_library",
"//vendor/sigs.k8s.io/cluster-api/pkg/apis:go_default_library",
"//vendor/sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset:go_default_library",
"//vendor/sigs.k8s.io/cluster-api/pkg/controller/cluster:go_default_library",
"//vendor/sigs.k8s.io/controller-runtime/pkg/client/config:go_default_library",
"//vendor/sigs.k8s.io/controller-runtime/pkg/manager:go_default_library",
"//vendor/sigs.k8s.io/controller-runtime/pkg/runtime/log:go_default_library",
Expand Down
24 changes: 0 additions & 24 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,12 @@ import (
_ "net/http/pprof"
"time"

corev1 "k8s.io/client-go/kubernetes/typed/core/v1"
"k8s.io/klog"
"k8s.io/klog/klogr"
capa "sigs.k8s.io/cluster-api-provider-aws/pkg/apis"
"sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/actuators/cluster"
"sigs.k8s.io/cluster-api-provider-aws/pkg/controller"
"sigs.k8s.io/cluster-api-provider-aws/pkg/record"
capi "sigs.k8s.io/cluster-api/pkg/apis"
"sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset"
capicluster "sigs.k8s.io/cluster-api/pkg/controller/cluster"
"sigs.k8s.io/controller-runtime/pkg/client/config"
"sigs.k8s.io/controller-runtime/pkg/manager"
"sigs.k8s.io/controller-runtime/pkg/runtime/log"
Expand Down Expand Up @@ -78,27 +74,9 @@ func main() {
klog.Fatalf("Failed to set up overall controller manager: %v", err)
}

cs, err := clientset.NewForConfig(cfg)
if err != nil {
klog.Fatalf("Failed to create client from configuration: %v", err)
}

coreClient, err := corev1.NewForConfig(cfg)
if err != nil {
klog.Fatalf("Failed to create corev1 client from configuration: %v", err)
}

// Initialize event recorder.
record.InitFromRecorder(mgr.GetEventRecorderFor("aws-controller"))

// Initialize cluster actuator.
clusterActuator := cluster.NewActuator(cluster.ActuatorParams{
Client: mgr.GetClient(),
CoreClient: coreClient,
ClusterClient: cs.ClusterV1alpha2(),
LoggingContext: "[cluster-actuator]",
})

if err := capi.AddToScheme(mgr.GetScheme()); err != nil {
klog.Fatal(err)
}
Expand All @@ -107,8 +85,6 @@ func main() {
klog.Fatal(err)
}

capicluster.AddWithActuator(mgr, clusterActuator)

// Setup all Controllers.
if err := controller.AddToManager(mgr); err != nil {
klog.Fatal(err)
Expand Down
Loading

0 comments on commit f7ca984

Please sign in to comment.