Skip to content
Permalink
Browse files

CAPA v1alpha2 🎉

Signed-off-by: Vince Prignano <vincepri@vmware.com>
  • Loading branch information...
vincepri committed Jul 11, 2019
1 parent 1032602 commit b7b7d9197b212864ceea80f7e2523e8a9f42fbd0
Showing 3,828 changed files with 209,760 additions and 130,514 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
@@ -48,16 +48,6 @@ filegroup(
],
)

workspace_binary(
name = "generate",
args = [
"generate",
"./pkg/...",
"./cmd/...",
],
cmd = "@go_sdk//:bin/go",
)

workspace_binary(
name = "lint",
args = ["run"],
@@ -113,7 +113,7 @@ check-install: ## Checks that you've installed this repository correctly

.PHONY: verify
verify: ## Runs verification scripts to ensure correct execution
./hack/verify_boilerplate.py
./hack/verify-boilerplate.sh

## --------------------------------------
## Manifests
@@ -142,19 +142,30 @@ gazelle: ## Run Bazel Gazelle
(which bazel && ./hack/update-bazel.sh) || true

.PHONY: generate
generate: ## Generate mocks, CRDs and runs `go generate` through Bazel
GOPATH=$(shell go env GOPATH) bazel run //:generate $(BAZEL_ARGS)
generate: ## Generate code
$(MAKE) generate-go
$(MAKE) generate-mocks
$(MAKE) generate-manifests
$(MAKE) gazelle

.PHONY: generate-go
generate-go: ## Runs go generate
go generate ./pkg/... ./cmd/...

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

.PHONY: generate-crds
generate-crds:
bazel build //config
cp -R bazel-genfiles/config/crds/* config/crds/
cp -R bazel-genfiles/config/rbac/* config/rbac/
.PHONY: generate-manifests
generate-manifests: ## Generate manifests e.g. CRD, RBAC etc.
go run vendor/sigs.k8s.io/controller-tools/cmd/controller-gen/main.go \
paths=./pkg/apis/infrastructure/... \
crd:trivialVersions=true \
rbac:roleName=manager-role \
output:crd:dir=./config/crds

## --------------------------------------
## Linting
@@ -1,3 +1,3 @@
version: "1"
domain: k8s.io
domain: cluster.sigs.k8s.io
repo: sigs.k8s.io/cluster-api-provider-aws
@@ -1,3 +1,5 @@
#!/usr/bin/env python

# Copyright 2018 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");

This file was deleted.

@@ -64,7 +64,7 @@ func homeDir() string {
func MachineInstanceID(name string) (string, error) {
c := NewClient()

m, err := c.ClusterV1alpha1().Machines("default").Get(name, v1.GetOptions{})
m, err := c.ClusterDeprecatedV1alpha1().Machines("default").Get(name, v1.GetOptions{})
if err != nil {
return "", err
}
@@ -26,15 +26,13 @@ go_library(
deps = [
"//pkg/apis:go_default_library",
"//pkg/cloud/aws/actuators/cluster:go_default_library",
"//pkg/cloud/aws/actuators/machine: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/sigs.k8s.io/cluster-api/pkg/apis:go_default_library",
"//vendor/sigs.k8s.io/cluster-api/pkg/apis/cluster/common: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/cluster-api/pkg/controller/machine: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/signals:go_default_library",
@@ -24,13 +24,11 @@ import (
"k8s.io/klog"
"sigs.k8s.io/cluster-api-provider-aws/pkg/apis"
"sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/actuators/cluster"
"sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/actuators/machine"
"sigs.k8s.io/cluster-api-provider-aws/pkg/record"
clusterapis "sigs.k8s.io/cluster-api/pkg/apis"
"sigs.k8s.io/cluster-api/pkg/apis/cluster/common"
"sigs.k8s.io/cluster-api/pkg/client/clientset_generated/clientset"
capicluster "sigs.k8s.io/cluster-api/pkg/controller/cluster"
capimachine "sigs.k8s.io/cluster-api/pkg/controller/machine"
"sigs.k8s.io/controller-runtime/pkg/client/config"
"sigs.k8s.io/controller-runtime/pkg/manager"
"sigs.k8s.io/controller-runtime/pkg/runtime/signals"
@@ -72,22 +70,15 @@ func main() {
}

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

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

// Initialize machine actuator.
machineActuator := machine.NewActuator(machine.ActuatorParams{
CoreClient: coreClient,
ClusterClient: cs.ClusterV1alpha1(),
LoggingContext: "[machine-actuator]",
})

// Register our cluster deployer (the interface is in clusterctl and we define the Deployer interface on the actuator)
common.RegisterClusterProvisioner("aws", clusterActuator)

@@ -99,7 +90,6 @@ func main() {
klog.Fatal(err)
}

capimachine.AddWithActuator(mgr, machineActuator)
capicluster.AddWithActuator(mgr, clusterActuator)

if err := mgr.Start(signals.SetupSignalHandler()); err != nil {
@@ -12,28 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load("//build:controller_gen.bzl", "controller_gen")

KUSTOMIZE = "@io_k8s_sigs_kustomize//:kustomize"

controller_gen(
name = "config",
api = [
{
"group": "awsprovider.k8s.io",
"version": "v1alpha1",
"types": [
"AWSClusterProviderSpec",
"AWSClusterProviderStatus",
"AWSMachineProviderSpec",
"AWSMachineProviderStatus",
],
},
],
importpath = "sigs.k8s.io/cluster-api-provider-aws",
visibility = ["//visibility:public"],
)

filegroup(
name = "kustomize-yaml",
srcs = glob([

0 comments on commit b7b7d91

Please sign in to comment.
You can’t perform that action at this time.