Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get rid of .git-credentials and switch to GCS #300

Merged
merged 40 commits into from
Jun 7, 2019
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
94e8d7e
Merge pull request #1 from kudobuilder/master
fabianbaier May 1, 2019
26fbd5c
cli-improvement: deprecating github client, instead having local repo…
fabianbaier May 7, 2019
1eb4035
made install work with kudo-registry and google cloud storage repo
fabianbaier May 16, 2019
d201bba
Merge pull request #2 from kudobuilder/master
fabianbaier May 30, 2019
58a7ce1
Merge remote-tracking branch 'origin/master' into fabi/cli-improvement
fabianbaier May 30, 2019
a776fad
re-adding repopath and adding repo constant
fabianbaier May 31, 2019
74db7ab
fixed failing install test due to missing .git-credential file
fabianbaier May 31, 2019
d68c6db
fixed linter
fabianbaier May 31, 2019
bfd4c51
fixed staticcheck
fabianbaier May 31, 2019
dbd2983
fixed goimports
fabianbaier May 31, 2019
50a2787
fixed install test by adding index.yaml
fabianbaier May 31, 2019
4f55987
addressed some review items, mainly inlines, github client related cl…
fabianbaier May 31, 2019
4db20b0
addressed reviews for a const with fmt.Sprintf and renaming client to…
fabianbaier Jun 1, 2019
afa1e27
Reduce the scope of the cli improvement branch
alenkacz Jun 4, 2019
8b61926
More refactoring
alenkacz Jun 4, 2019
aa660b0
Merge pull request #3 from alenkacz/av/less-scope
fabianbaier Jun 4, 2019
2390947
check.RepoPath: refactored creation of repopath out of caller method
fabianbaier Jun 4, 2019
a759b5b
golinting, goimporting and staticchecking to make tests pass
fabianbaier Jun 5, 2019
3b62267
Remove remaining git-credentials stuff
alenkacz Jun 5, 2019
b3b76ef
Various improvements
alenkacz Jun 5, 2019
87d0951
Minor cleanup
alenkacz Jun 5, 2019
ec221d7
Bundle from memory
alenkacz Jun 5, 2019
fe819bf
Merge pull request #4 from alenkacz/av/git-credentials-cleanup
fabianbaier Jun 5, 2019
322e666
Drop some stuf
alenkacz Jun 5, 2019
9bd491c
Fixes
alenkacz Jun 5, 2019
2c4a199
Linter
alenkacz Jun 5, 2019
e0c8c19
Formatting
alenkacz Jun 5, 2019
53ec610
Merge pull request #5 from alenkacz/av/cli-improvement-improvement
fabianbaier Jun 5, 2019
32ae0fa
fixing goimports of vars.go
fabianbaier Jun 5, 2019
041b436
Merge
alenkacz Jun 5, 2019
64b140d
fixed nil pointer, inlined error and switched to official kudo-reposi…
fabianbaier Jun 5, 2019
0277866
Fixe from code review
alenkacz Jun 6, 2019
6a7616d
Fixe from code review
alenkacz Jun 6, 2019
1578cba
Add basic docs
alenkacz Jun 6, 2019
55a2447
Merge branch 'cli-improvement' of github.com:kudobuilder/kudo into cl…
alenkacz Jun 6, 2019
d43681c
Merge
alenkacz Jun 6, 2019
5d13972
code review comments
alenkacz Jun 6, 2019
03e2528
Formatting
alenkacz Jun 6, 2019
8a7a1b4
code review feedback
alenkacz Jun 6, 2019
3cf728e
Do not introduce logging package right now
alenkacz Jun 7, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ jobs:
machine: true
steps:
- checkout
- run: echo "https://$GITHUB_USERNAME:$GITHUB_PASSWORD@github.com" > "test/.git-credentials"
- run: ./test/run_tests.sh
- run: |
git config user.name "Circle CI"
Expand Down
4 changes: 1 addition & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ After updating CRD manifests, use `make deploy` to apply the new CRDs to your cl
### Build and run tests using docker
If you don't want to install kubebuilder and other dependencies of KUDO locally, you can optionally run build and tests inside a docker container which is what our CI does.

Right now, the project requires you to set-up `.git-credentials` file which the build expects to be located in the test directory inside this project (that's because for docker build to run, every file that we copy in has to be inside the passed build context).

If you have `.git-credentials` file set up, you can just run:
To run tests, you can just execute:

`./test/run_tests.sh`

Expand Down
4 changes: 0 additions & 4 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ This document demonstrates how to use the CLI but also shows what happens in `KU
### Requirements

- `kubectl` version `1.12.0` or newer
- Configure GitHub authentication to be able to pull from [kudobuilder/frameworks](https://github.com/kudobuilder/frameworks). See instructions for [git-credential-store](https://git-scm.com/docs/git-credential-store) and [creating a personal access token](https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line).
- GitHub personal access token in `$HOME/.git-credentials` or
- GitHub Basic Auth via `GIT_USER` and `GIT_PASSWORD` environment variables exposed
- KUDO CRDs installed to your cluster and KUDO controller is running. See the [getting started guide](/docs/getting-started/) for instructions
- `kubectl kudo` is running outside your cluster

Expand Down Expand Up @@ -63,7 +60,6 @@ Usage:
Flags:
--all-dependencies Installs all dependency packages. (default "false")
--auto-approve Skip interactive approval when existing version found. (default "false")
--githubcredential string The file path to GitHub credential file. (default "$HOME/.git-credentials")
-h, --help help for install
--instance string The instance name. (default to Framework name)
--kubeconfig string The file path to Kubernetes configuration file. (default "$HOME/.kube/config")
Expand Down
10 changes: 0 additions & 10 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,6 @@ minikube start --cpus=4 --memory=8192 --disk-size=40g
**Before** `kubectl apply -f config/crds` you will need to have:

* minikube running
* `~/.git-credentials` must exist with git credentials with details below.

### Setting up GitHub Credentials
In order to setup `~/.git-credentials` the file needs to have the format of:
```
https://<username>:<credential>@github.com
```

The username is your GitHub user name and the credential is your password. If you are using 2-factor authentication, the credentials will need to be an application [personal access token](https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line).


## Deploy your first Application

Expand Down
36 changes: 36 additions & 0 deletions docs/repository.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: Framework repository
type: docs
weight: 4
---
# Framework repository

KUDO CLI comes with built-in official repository of verified frameworks. Every time you use `kudo install ...` command, it always pulls package from this repository.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we remove the word always


## Repository implementation

KUDO can work with any repository exposed over HTTP that conforms the expected structure. The official repository is hosted on Google Cloud Storage.

In the root of the repository we expect `index.yaml` file similar to the following example:

```yaml
apiVersion: v1
entries:
yourframework:
- apiVersion: v1alpha1
appVersion: 7.0.0
name: yourframework
urls:
- https://kudo-repository.storage.googleapis.com/elastic-0.1.0.tgz
version: 0.1.0
```

The url leads to a location where the tarball package is hosted. It could be internal as well as external url (inside that repository or outside).

## How to add new package

All official packages right now are mirrored from the [github repository](https://github.com/kudobuilder/frameworks). To add new framework, create a PR against that repo.

## How to update package

The process here is the same as for adding new package. You need to create PR against the [github repository](https://github.com/kudobuilder/frameworks).
26 changes: 17 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ module github.com/kudobuilder/kudo
go 1.12

require (
cloud.google.com/go v0.36.0 // indirect
cloud.google.com/go v0.38.0 // indirect
github.com/Masterminds/goutils v1.1.0 // indirect
github.com/Masterminds/semver v1.4.2 // indirect
github.com/Masterminds/semver v1.4.2
github.com/appscode/jsonpatch v0.0.0-20190108182946-7c0e3b262f30 // indirect
github.com/emicklei/go-restful v2.9.0+incompatible // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-logr/logr v0.1.0 // indirect
github.com/go-logr/zapr v0.1.0 // indirect
github.com/go-openapi/jsonpointer v0.18.0 // indirect
Expand All @@ -19,13 +20,16 @@ require (
github.com/gobuffalo/envy v1.6.15 // indirect
github.com/gogo/protobuf v1.2.0 // indirect
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef // indirect
github.com/golang/protobuf v1.3.1 // indirect
github.com/google/btree v1.0.0 // indirect
github.com/google/go-github v17.0.0+incompatible
github.com/google/go-querystring v1.0.0 // indirect
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf // indirect
github.com/google/martian v2.1.0+incompatible
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to introduce this here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch. That was a PR feedback from Gerred, but I was supposed to use whatever controller uses and I screw it up :) Now that I see what controller uses (it's a controller-runtime kubernetes log libbrary) I would probably stick with printing out for now and introduce a logging library (like logrus maybe?) in a different PR :)

github.com/google/uuid v1.1.0 // indirect
github.com/googleapis/gnostic v0.2.0 // indirect
github.com/gregjones/httpcache v0.0.0-20190212212710-3befbb6ad0cc // indirect
github.com/hashicorp/golang-lru v0.5.0 // indirect
github.com/hashicorp/golang-lru v0.5.1 // indirect
github.com/huandu/xstrings v1.2.0 // indirect
github.com/imdario/mergo v0.3.7 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
Expand Down Expand Up @@ -53,14 +57,18 @@ require (
go.uber.org/atomic v1.3.2 // indirect
go.uber.org/multierr v1.1.0 // indirect
go.uber.org/zap v1.9.1 // indirect
golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67 // indirect
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd
golang.org/x/oauth2 v0.0.0-20190212230446-3e8b2be13635 // indirect
golang.org/x/sys v0.0.0-20190213121743-983097b1a8a3 // indirect
golang.org/x/tools v0.0.0-20190214195451-78f9822548c1
golang.org/x/crypto v0.0.0-20190424203555-c05e17bb3b2d // indirect
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3
golang.org/x/net v0.0.0-20190502183928-7f726cade0ab
golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a // indirect
golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82 // indirect
golang.org/x/text v0.3.2 // indirect
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138
google.golang.org/appengine v1.5.0 // indirect
gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
gopkg.in/go-playground/validator.v9 v9.27.0
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.2.2
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a
k8s.io/api v0.0.0-20181213150558-05914d821849
Expand Down
Loading