Skip to content
This repository has been archived by the owner on Jun 14, 2018. It is now read-only.

[wip] Proxy cfg validation & route generation #68

Closed
wants to merge 16 commits into from
2 changes: 2 additions & 0 deletions cmd/manager/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ go_library(
srcs = ["main.go"],
visibility = ["//visibility:private"],
deps = [
"//model:go_default_library",
"//platform/kube:go_default_library",
"//proxy/envoy:go_default_library",
"@com_github_golang_glog//:go_default_library",
"@com_github_hashicorp_go_multierror//:go_default_library",
"@com_github_spf13_cobra//:go_default_library",
"@com_github_golang_protobuf//proto:go_default_library",
],
)

Expand Down
12 changes: 11 additions & 1 deletion cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (

"github.com/golang/glog"
"github.com/spf13/cobra"
"istio.io/manager/model"
)

type args struct {
Expand Down Expand Up @@ -57,7 +58,16 @@ Istio Manager provides management plane functionality to the Istio proxy mesh an
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
glog.V(2).Infof("flags: %#v", flags)

client, err := kube.NewClient(flags.kubeconfig, nil)
km := model.KindMap{
"istio.proxy.v1alpha.config": model.ProtoSchema{
MessageName: "ProxyConfig",
Description: "Proxy configuration",
StatusMessageName: "ProxyRuleStatus",
Validate: model.ValidateProxyConfig,
},
}

client, err := kube.NewClient(flags.kubeconfig, km)
if err != nil {
return multierror.Prefix(err, "Failed to connect to Kubernetes API.")
}
Expand Down
1 change: 1 addition & 0 deletions model/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ go_library(
],
visibility = ["//visibility:public"],
deps = [
"//model/proxy/alphav1/config:go_default_library",
"@com_github_golang_protobuf//proto:go_default_library",
"@com_github_hashicorp_go_multierror//:go_default_library",
],
Expand Down
15 changes: 15 additions & 0 deletions model/proxy/alphav1/config/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "go_default_library",
srcs = [
"cfg.pb.go",
],
visibility = ["//visibility:public"],
deps = [
"@com_github_golang_protobuf//proto:go_default_library",
"@com_github_golang_protobuf//ptypes/any:go_default_library",
"@com_github_golang_protobuf//ptypes/wrappers:go_default_library",
"@com_github_hashicorp_go_multierror//:go_default_library",
],
)
Loading