-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from paninetworks/feature/443-445-merge
- Loading branch information
Showing
41 changed files
with
2,867 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
# Folders | ||
_obj | ||
_test | ||
.idea | ||
|
||
# Architecture specific extensions/prefixes | ||
*.[568vq] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
[submodule "vendor/github.com/spf13/viper"] | ||
path = vendor/github.com/spf13/viper | ||
url = https://github.com/spf13/viper | ||
[submodule "vendor/github.com/romana/core"] | ||
path = vendor/github.com/romana/core | ||
url = https://github.com/romana/core | ||
[submodule "vendor/k8s.io/client-go"] | ||
path = vendor/k8s.io/client-go | ||
url = https://github.com/kubernetes/client-go | ||
branch = release-1.5 | ||
[submodule "vendor/github.com/K-Phoen/negotiation"] | ||
path = vendor/github.com/K-Phoen/negotiation | ||
url = https://github.com/K-Phoen/negotiation | ||
[submodule "vendor/github.com/codegangsta/negroni"] | ||
path = vendor/github.com/codegangsta/negroni | ||
url = https://github.com/codegangsta/negroni | ||
[submodule "vendor/github.com/dgrijalva/jwt-go"] | ||
path = vendor/github.com/dgrijalva/jwt-go | ||
url = https://github.com/dgrijalva/jwt-go | ||
[submodule "vendor/github.com/go-sql-driver/mysql"] | ||
path = vendor/github.com/go-sql-driver/mysql | ||
url = https://github.com/go-sql-driver/mysql | ||
[submodule "vendor/github.com/go-yaml/yaml"] | ||
path = vendor/github.com/go-yaml/yaml | ||
url = https://github.com/go-yaml/yaml | ||
[submodule "vendor/github.com/gorilla/context"] | ||
path = vendor/github.com/gorilla/context | ||
url = https://github.com/gorilla/context | ||
[submodule "vendor/github.com/gorilla/mux"] | ||
path = vendor/github.com/gorilla/mux | ||
url = https://github.com/gorilla/mux | ||
[submodule "vendor/github.com/jinzhu/gorm"] | ||
path = vendor/github.com/jinzhu/gorm | ||
url = https://github.com/jinzhu/gorm | ||
[submodule "vendor/github.com/jinzhu/inflection"] | ||
path = vendor/github.com/jinzhu/inflection | ||
url = https://github.com/jinzhu/inflection | ||
[submodule "vendor/github.com/mattn/go-sqlite3"] | ||
path = vendor/github.com/mattn/go-sqlite3 | ||
url = https://github.com/mattn/go-sqlite3 | ||
[submodule "vendor/golang.org/x/net"] | ||
path = vendor/golang.org/x/net | ||
url = https://go.googlesource.com/net | ||
[submodule "vendor/github.com/pborman/uuid"] | ||
path = vendor/github.com/pborman/uuid | ||
url = https://github.com/pborman/uuid | ||
[submodule "vendor/github.com/spf13/cobra"] | ||
path = vendor/github.com/spf13/cobra | ||
url = https://github.com/spf13/cobra | ||
[submodule "vendor/github.com/spf13/pflag"] | ||
path = vendor/github.com/spf13/pflag | ||
url = https://github.com/spf13/pflag | ||
[submodule "vendor/github.com/fsnotify/fsnotify"] | ||
path = vendor/github.com/fsnotify/fsnotify | ||
url = https://github.com/fsnotify/fsnotify | ||
[submodule "vendor/github.com/pelletier/go-toml"] | ||
path = vendor/github.com/pelletier/go-toml | ||
url = https://github.com/pelletier/go-toml | ||
[submodule "vendor/github.com/pelletier/go-buffruneio"] | ||
path = vendor/github.com/pelletier/go-buffruneio | ||
url = https://github.com/pelletier/go-buffruneio | ||
[submodule "vendor/golang.org/x/sys"] | ||
path = vendor/golang.org/x/sys | ||
url = https://go.googlesource.com/sys/ | ||
[submodule "vendor/github.com/spf13/afero"] | ||
path = vendor/github.com/spf13/afero | ||
url = https://github.com/spf13/afero | ||
[submodule "vendor/golang.org/x/text"] | ||
path = vendor/golang.org/x/text | ||
url = https://go.googlesource.com/text/ | ||
[submodule "vendor/github.com/spf13/cast"] | ||
path = vendor/github.com/spf13/cast | ||
url = https://github.com/spf13/cast | ||
[submodule "vendor/github.com/spf13/jwalterweatherman"] | ||
path = vendor/github.com/spf13/jwalterweatherman | ||
url = https://github.com/spf13/jwalterweatherman | ||
[submodule "vendor/github.com/golang/glog"] | ||
path = vendor/github.com/golang/glog | ||
url = https://github.com/golang/glog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# | ||
# test: run unit tests with coverage turned on. | ||
# vet: run go vet for catching subtle errors. | ||
# lint: run golint. | ||
# | ||
|
||
services = $$GOPATH/bin/watchnodes\ | ||
$$GOPATH/bin/listener | ||
|
||
# glog changes flags, which causes listener to crash due to | ||
# multiple glog imports, get rid of secondary glog import | ||
# | ||
# TODO: get rid of glog :(, use a real logger instead. | ||
# | ||
GLOG_FIX=vendor/k8s.io/client-go/1.5/vendor/github.com/golang/glog | ||
|
||
UPX_VERSION := $(shell upx --version 2>/dev/null) | ||
|
||
install: | ||
rm -rf "$(GLOG_FIX)" | ||
go list -f '{{.ImportPath}}' "./..." | \ | ||
grep -v /vendor/ | xargs go install -ldflags \ | ||
"-X github.com/romana/kube/common.buildInfo=`git describe --always` \ | ||
-X github.com/romana/kube/common.buildTimeStamp=`date -u '+%Y-%m-%d_%I:%M:%S%p'`" | ||
|
||
all: install upx fmt vet test lint | ||
|
||
test: | ||
go list -f '{{.ImportPath}}' "./..." | \ | ||
grep -v /vendor/ | xargs go test -v -timeout=30s -cover | ||
|
||
vet: | ||
go list -f '{{.ImportPath}}' "./..." | \ | ||
grep -v /vendor/ | xargs go vet | ||
|
||
fmt: | ||
go list -f '{{.ImportPath}}' "./..." | \ | ||
grep -v /vendor/ | xargs go fmt | ||
|
||
lint: | ||
go list -f '{{.Dir}}' "./..." | \ | ||
grep -v /vendor/ | xargs -n 1 golint | ||
|
||
upx: | ||
ifndef UPX_VERSION | ||
$(error "No upx in $(PATH), consider doing apt-get install upx") | ||
endif | ||
upx $(services) | ||
|
||
clean: | ||
rm $(services) | ||
|
||
.PHONY: test vet lint all install clean fmt upx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Copyright (c) 2016 Pani Networks | ||
// All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
// not use this file except in compliance with the License. You may obtain | ||
// a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
// License for the specific language governing permissions and limitations | ||
// under the License. | ||
|
||
// Main entry point for Kubernetes listener | ||
package main | ||
|
||
import ( | ||
"flag" | ||
"fmt" | ||
|
||
rcommon "github.com/romana/core/common" | ||
kcommon "github.com/romana/kube/common" | ||
kubernetes "github.com/romana/kube/kubernetes/listener" | ||
) | ||
|
||
func main() { | ||
rootURL := flag.String("rootURL", "", "Romana Root service URL") | ||
version := flag.Bool("version", false, "Build Information.") | ||
username := flag.String("username", "", "Username") | ||
password := flag.String("password", "", "Password") | ||
|
||
flag.Parse() | ||
|
||
if *version { | ||
fmt.Println(kcommon.BuildInfo()) | ||
return | ||
} | ||
if *rootURL == "" { | ||
fmt.Println("Must specify rootURL.") | ||
return | ||
} | ||
cred := rcommon.MakeCredentialFromCliArgs(*username, *password) | ||
svcInfo, err := kubernetes.Run(*rootURL, cred) | ||
if err != nil { | ||
panic(err) | ||
} | ||
for { | ||
msg := <-svcInfo.Channel | ||
fmt.Println(msg) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright (c) 2016 Pani Networks | ||
// All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
// not use this file except in compliance with the License. You may obtain | ||
// a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
// License for the specific language governing permissions and limitations | ||
// under the License. | ||
|
||
package common | ||
|
||
// Build information support. | ||
|
||
import ( | ||
"fmt" | ||
) | ||
|
||
// Build Information and Timestamp. | ||
// Pass build information to the executable using go run as below: | ||
// | ||
// go run -ldflags \ | ||
// "-X github.com/romana/kube/common.buildInfo=`git describe --always` \ | ||
// -X github.com/romana/kube/common.buildTimeStamp=`date -u '+%Y-%m-%d_%I:%M:%S%p'`" \ | ||
// main.go -version | ||
// | ||
// or using go build as below: | ||
// | ||
// go build -ldflags \ | ||
// "-X github.com/romana/kube/common.buildInfo=`git describe --always` \ | ||
// -X github.com/romana/kube/common.buildTimeStamp=`date -u '+%Y-%m-%d_%I:%M:%S%p'`" \ | ||
// main.go | ||
// | ||
var buildInfo = "No Build Information Provided" | ||
var buildTimeStamp = "No Build Time Provided" | ||
|
||
// BuildInfo return build revision and time string. | ||
func BuildInfo() string { | ||
return fmt.Sprintf("Build Revision: %s\nBuild Time: %s", buildInfo, buildTimeStamp) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright (c) 2016 Pani Networks | ||
// All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
// not use this file except in compliance with the License. You may obtain | ||
// a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
// License for the specific language governing permissions and limitations | ||
// under the License. | ||
|
||
/* | ||
Package common contains various things common to all Romana services. | ||
*/ | ||
package common |
Oops, something went wrong.