Skip to content

Commit

Permalink
Add AWSCluster (#942)
Browse files Browse the repository at this point in the history
* Update cluster-api dep to master

Signed-off-by: Andy Goldstein <goldsteina@vmware.com>

* Add AWSCluster

Signed-off-by: Andy Goldstein <goldsteina@vmware.com>

* correct cluster log names

Signed-off-by: Andy Goldstein <goldsteina@vmware.com>

* code review + remove unused code

Signed-off-by: Andy Goldstein <goldsteina@vmware.com>

* remove commented out code

Signed-off-by: Andy Goldstein <goldsteina@vmware.com>

* remove unused mocks. fix integration test. remove unused crd yaml

Signed-off-by: Andy Goldstein <goldsteina@vmware.com>

* try to fix jsonpatch in go.sum

Signed-off-by: Andy Goldstein <goldsteina@vmware.com>

* try to fix integration

Signed-off-by: Andy Goldstein <goldsteina@vmware.com>
  • Loading branch information
ncdc authored and k8s-ci-robot committed Aug 1, 2019
1 parent 93afeea commit e3b2ce1
Show file tree
Hide file tree
Showing 141 changed files with 2,271 additions and 3,667 deletions.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ generate-go: ## Runs go generate

.PHONY: generate-mocks
generate-mocks: clean-bazel-mocks ## Generate mocks, CRDs and runs `go generate` through Bazel
bazel build $(BAZEL_ARGS) //pkg/cloud/services/mocks:mocks \
//pkg/cloud/services/ec2/mock_ec2iface:mocks \
bazel build $(BAZEL_ARGS) //pkg/cloud/services/ec2/mock_ec2iface:mocks \
//pkg/cloud/services/elb/mock_elbiface:mocks
./hack/copy-bazel-mocks.sh

Expand Down
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

This file was deleted.

Loading

0 comments on commit e3b2ce1

Please sign in to comment.