deis / controller-sdk-go Goto Github PK
View Code? Open in Web Editor NEWThe Go SDK for the Deis Controller API
License: MIT License
The Go SDK for the Deis Controller API
License: MIT License
We already have test and a .travis.yml
file setup, so a repo admin needs to flip the switch in the Travis CI interface to enable it.
See https://ci.deis.io/job/Deis/job/controller-sdk-go/job/master/68/console
Currently blocking any/all PRs
Right now we don't have any usage examples for the godoc.
deis/workflow#359 describes the need and approach for a pipeline to test commits in this repo. Current thought is the pipeline will consist of the following 3 jobs:
sdk
job which only really passes down relevant info (commit sha, repo name) tocli
job which looks like it does now but with added functionality to:
glide.yaml
with sha and repo name received from 1
glide up
make build upload-gcs
e2e
job which is already set up to look for binary deployed to gcs from 2
hereI believe github.com/deis/pkg/time
is only used in one place - for time formatting between the server and the client. However, this package comes with dependencies on k8s.io/kubernetes/pkg/...
, which is huge. This issue is for removing the dependency altogether, so that we don't have to pull in a 100MB+ (iirc) dependency to get 1 constant
Steps to reproduce:
deis apps
returns: Error: Unauthorized: Missing or Invalid Token
deis auth:regenerate
○ → deis auth:regenerate
panic: runtime error: invalid memory address or nil pointer dereference
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x160881]
goroutine 1 [running]:
panic(0x4e12a0, 0xc82000e100)
/usr/local/go/src/runtime/panic.go:481 +0x3e6
github.com/deis/workflow-cli/vendor/github.com/deis/controller-sdk-go/auth.Regenerate.func1(0x0)
/go/src/github.com/deis/workflow-cli/vendor/github.com/deis/controller-sdk-go/auth/auth.go:110 +0xb1
panic(0x4e12a0, 0xc82000e100)
/usr/local/go/src/runtime/panic.go:443 +0x4e9
github.com/deis/workflow-cli/vendor/github.com/deis/controller-sdk-go/auth.Regenerate(0xc8202100e0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/go/src/github.com/deis/workflow-cli/vendor/github.com/deis/controller-sdk-go/auth/auth.go:119 +0x4a1
github.com/deis/workflow-cli/cmd.Regenerate(0x0, 0x0, 0xc82011dc00, 0x0, 0x0)
/go/src/github.com/deis/workflow-cli/cmd/auth.go:279 +0xa4
github.com/deis/workflow-cli/parser.authRegenerate(0xc82006e090, 0x1, 0x1, 0x0, 0x0)
/go/src/github.com/deis/workflow-cli/parser/auth.go:238 +0x290
github.com/deis/workflow-cli/parser.Auth(0xc82006e090, 0x1, 0x1, 0x0, 0x0)
/go/src/github.com/deis/workflow-cli/parser/auth.go:40 +0x686
main.Command(0xc82006e090, 0x1, 0x1, 0x1a20b5)
/go/src/github.com/deis/workflow-cli/deis.go:93 +0xe47
main.main()
/go/src/github.com/deis/workflow-cli/deis.go:18 +0x60
cat ~/.deis/client.json
{"username":"admin","ssl_verify":false,"controller":"http://deis.example.com","token":"eb648a2fb4d5b9b8dccffd88ae585b84f4b5c475","response_limit":0}
Right now don't return any constant error type for SDK problems, making it very hard for libraries to check what type of error we are returning.
For example, this code from the CLI shows just how hard and ugly checking error types currently is:
err = auth.Delete(c, username)
cleanup := fmt.Errorf("\n%s %s\n\n", "409", "Conflict")
if reflect.DeepEqual(err, cleanup) {
fmt.Printf("%s still has application associated with it. Transfer ownership or delete them first\n", username)
return nil
}
As seen in #115 (comment), the assumption that the git commit author is the same as the user who owns the forked repo can be proven faulty. (Logic where this is used in CI to build a workflow-cli image with changes in a controller-sdk-go PR can be seen here)
We therefore seek an alternative way to fetch and inject a PR in this repo into a workflow-cli build artifact (via glide)
Currently for testing PRs in this repo, we check out the master branch of the workflow-cli
repo and build it from scratch with the controller-sdk-go changes.
We should create a mechanism for checking out a forked workflow-cli
repo at a certain commit if it is required by, for instance, Requires workflow-cli#<issue_number>
.
As https://ci.deis.io/job/Deis/pipeline-syntax/globals doesn't appear to expose the actual PR commit sha, we run an incantation along the lines of git rev-parse HEAD | git log --pretty=%P -n 1 | cut -c1-40
to derive it. (fwiw, we also have to use that first git rev-parse HEAD
command to grab the merge commit)
We should either find the best practice git
command fu to derive the PR commit or see about filing an issue upstream to the Jenkins Pipeline project about exposing it. (Also, the GitHub Pull Request Plugin gives us this info when used with the jobs defined in DSL in the https://github.com/deis/jenkins-jobs repo -- we also might consider seeing if this plugin can be used in a Jenkinsfile)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.