From 0ff06a0e257a9aa9a4be7e5a5e62187abbfdb2bf Mon Sep 17 00:00:00 2001 From: Jared Watts Date: Sat, 31 Aug 2019 19:17:35 -0700 Subject: [PATCH] port stack-aws build and source files from core crossplane Signed-off-by: Jared Watts --- .gitignore | 9 +- .golangci.yml | 11 +- CONTRIBUTING.md | 230 -------- GOVERNANCE.md | 133 ----- Gopkg.lock | 453 ++-------------- Gopkg.toml | 11 +- INSTALL.md | 139 +---- Makefile | 34 +- OWNERS.md | 31 -- PROJECT | 2 +- PendingReleaseNotes.md | 20 - README.md | 103 +--- ROADMAP.md | 161 ------ aws/apis/aws.go | 10 +- aws/apis/aws_test.go | 10 +- .../v1alpha1/replication_group_types_test.go | 3 +- aws/apis/compute/v1alpha1/types_test.go | 3 +- .../v1alpha1/rdsinstance_types_test.go | 3 +- .../storage/v1alpha1/bucket_types_test.go | 3 +- .../storage/v1alpha1/zz_generated.deepcopy.go | 3 +- aws/apis/v1alpha1/types_test.go | 3 +- .../{crossplane => stack-aws}/Dockerfile | 0 .../images/{crossplane => stack-aws}/Makefile | 4 +- cmd/crossplane/main.go | 93 +--- config/crd/aws.crossplane.io_providers.yaml | 80 +++ ...crossplane.io_replicationgroupclasses.yaml | 271 ++++++++++ ...e.aws.crossplane.io_replicationgroups.yaml | 428 +++++++++++++++ ...e.aws.crossplane.io_eksclusterclasses.yaml | 340 ++++++++++++ ...compute.aws.crossplane.io_eksclusters.yaml | 496 ++++++++++++++++++ ....aws.crossplane.io_rdsinstanceclasses.yaml | 131 +++++ ...tabase.aws.crossplane.io_rdsinstances.yaml | 273 ++++++++++ ...age.aws.crossplane.io_s3bucketclasses.yaml | 130 +++++ .../storage.aws.crossplane.io_s3buckets.yaml | 271 ++++++++++ pkg/clients/aws/aws.go | 7 +- pkg/clients/aws/eks/eks.go | 4 +- pkg/clients/aws/eks/fake/fake.go | 4 +- pkg/clients/aws/elasticache/elasticache.go | 4 +- .../aws/elasticache/elasticache_test.go | 4 +- pkg/clients/aws/iam/fake/client.go | 6 +- pkg/clients/aws/rds/fake/fake.go | 4 +- pkg/clients/aws/rds/rds.go | 2 +- pkg/clients/aws/s3/fake/fake.go | 4 +- .../operations/fake/create_bucket_request.go | 6 +- .../operations/fake/delete_bucket_request.go | 6 +- .../fake/get_bucket_versioning_request.go | 6 +- .../aws/s3/operations/fake/operations.go | 9 +- .../operations/fake/put_bucket_acl_request.go | 6 +- .../fake/put_bucket_versioning_request.go | 6 +- pkg/clients/aws/s3/s3.go | 7 +- pkg/clients/aws/s3/s3_test.go | 7 +- pkg/controller/aws/aws.go | 10 +- pkg/controller/aws/cache/claim.go | 3 +- pkg/controller/aws/cache/claim_test.go | 3 +- pkg/controller/aws/cache/managed.go | 9 +- pkg/controller/aws/cache/managed_test.go | 9 +- pkg/controller/aws/compute/claim.go | 3 +- pkg/controller/aws/compute/claim_test.go | 3 +- pkg/controller/aws/compute/eks.go | 12 +- pkg/controller/aws/compute/eks_test.go | 9 +- pkg/controller/aws/rds/claim.go | 3 +- pkg/controller/aws/rds/claim_test.go | 3 +- pkg/controller/aws/rds/rdsinstance.go | 9 +- pkg/controller/aws/rds/rdsinstance_test.go | 13 +- pkg/controller/aws/s3/claim.go | 3 +- pkg/controller/aws/s3/claim_test.go | 3 +- pkg/controller/aws/s3/s3bucket.go | 9 +- pkg/controller/aws/s3/s3bucket_test.go | 13 +- pkg/test/crds.go | 32 ++ 68 files changed, 2688 insertions(+), 1445 deletions(-) delete mode 100644 CONTRIBUTING.md delete mode 100644 GOVERNANCE.md delete mode 100644 OWNERS.md delete mode 100644 PendingReleaseNotes.md delete mode 100644 ROADMAP.md rename cluster/images/{crossplane => stack-aws}/Dockerfile (100%) rename cluster/images/{crossplane => stack-aws}/Makefile (91%) create mode 100644 config/crd/aws.crossplane.io_providers.yaml create mode 100644 config/crd/cache.aws.crossplane.io_replicationgroupclasses.yaml create mode 100644 config/crd/cache.aws.crossplane.io_replicationgroups.yaml create mode 100644 config/crd/compute.aws.crossplane.io_eksclusterclasses.yaml create mode 100644 config/crd/compute.aws.crossplane.io_eksclusters.yaml create mode 100644 config/crd/database.aws.crossplane.io_rdsinstanceclasses.yaml create mode 100644 config/crd/database.aws.crossplane.io_rdsinstances.yaml create mode 100644 config/crd/storage.aws.crossplane.io_s3bucketclasses.yaml create mode 100644 config/crd/storage.aws.crossplane.io_s3buckets.yaml create mode 100644 pkg/test/crds.go diff --git a/.gitignore b/.gitignore index 215aff7d59..47abc3bfaf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,8 @@ /.cache /.work /_output -/config/ -/config cover.out /vendor /.vendor-new -# gitlab example -# exclude files generate by running the example -external-dns-*.tgz -gitlab-*.tgz -gitlab-gcp.yaml -gitlab/ \ No newline at end of file +/stack-package diff --git a/.golangci.yml b/.golangci.yml index 5de4143fa9..67e244b9d7 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -35,7 +35,7 @@ linters-settings: goimports: # put imports beginning with prefix after 3rd-party packages; # it's a comma-separated list of prefixes - local-prefixes: github.com/crossplaneio/crossplane + local-prefixes: github.com/crossplaneio/stack-aws gocyclo: # minimal code complexity to report, 30 by default (but we recommend 10-20) @@ -171,13 +171,6 @@ issues: - gosec - gas - # The Azure AddToUserAgent method appends to the existing user agent string. - # It returns an error if you pass it an empty string lettinga you know the - # user agent did not change, making it more of a warning. - - text: \.AddToUserAgent - linters: - - errcheck - # Independently from option `exclude` we use default exclude patterns, # it can be disabled by this option. To list all # excluded by default patterns execute `golangci-lint run --help`. @@ -196,4 +189,4 @@ issues: max-per-linter: 0 # Maximum count of issues with the same text. Set to 0 to disable. Default is 3. - max-same-issues: 0 \ No newline at end of file + max-same-issues: 0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 5cf6312227..0000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,230 +0,0 @@ -## How to Contribute - -The Crossplane project is under [Apache 2.0 license](LICENSE). We accept contributions via -GitHub pull requests. This document outlines some of the conventions related to -development workflow, commit message formatting, contact points and other -resources to make it easier to get your contribution accepted. - -## Certificate of Origin - -By contributing to this project you agree to the Developer Certificate of -Origin (DCO). This document was created by the Linux Kernel community and is a -simple statement that you, as a contributor, have the legal right to make the -contribution. See the [DCO](DCO) file for details. - -Contributors sign-off that they adhere to these requirements by adding a -Signed-off-by line to commit messages. For example: - -``` -This is my commit message - -Signed-off-by: Random J Developer -``` - -Git even has a -s command line option to append this automatically to your -commit message: - -``` -git commit -s -m 'This is my commit message' -``` - -If you have already made a commit and forgot to include the sign-off, you can amend your last commit -to add the sign-off with the following command, which can then be force pushed. - -``` -git commit --amend -s -``` - -We use a [DCO bot](https://github.com/apps/dco) to enforce the DCO on each pull -request and branch commits. - -## Getting Started - -- Fork the repository on GitHub -- Read the [install](INSTALL.md) for build and test instructions -- Play with the project, submit bugs, submit patches! - -## Contribution Flow - -This is a rough outline of what a contributor's workflow looks like: - -1. Open an issue against this repository to propose your change. -1. Consider writing a [one-pager or design doc](design/) if your proposal seems - complex or controversial. -1. Create a branch from where you want to base your work (usually master). -1. Make your changes and arrange them in readable commits. -1. Make sure your commit messages are in the proper format (see below). -1. Push your changes to the branch in your fork of the repository. -1. Make sure all linters and tests pass, and add any new tests as appropriate. -1. Submit a pull request to the original repository. - -## Building - -Details about building crossplane can be found in [INSTALL.md](INSTALL.md). - -## Coding Style and Linting - -Crossplane projects are written in Go. Coding style is enforced by -[golangci-lint](https://github.com/golangci/golangci-lint). Crossplane's linter -configuration is [documented here](.golangci.yml). Builds will fail locally and -in CI if linter warnings are introduced: - -```bash -$ make build -==> Linting /REDACTED/go/src/github.com/crossplaneio/crossplane/cluster/charts/crossplane -[INFO] Chart.yaml: icon is recommended - -1 chart(s) linted, no failures -20:31:42 [ .. ] helm dep crossplane 0.1.0-136.g2dfb012.dirty -No requirements found in /REDACTED/go/src/github.com/crossplaneio/crossplane/cluster/charts/crossplane/charts. -20:31:42 [ OK ] helm dep crossplane 0.1.0-136.g2dfb012.dirty -20:31:42 [ .. ] golangci-lint -pkg/clients/azure/redis/redis.go:35:7: exported const `NamePrefix` should have comment or be unexported (golint) -const NamePrefix = "acr" - ^ -20:31:55 [FAIL] -make[2]: *** [go.lint] Error 1 -make[1]: *** [build.all] Error 2 -make: *** [build] Error 2 -``` - -Note that Jenkins builds will not output linter warnings in the build log. -Instead `upbound-bot` will leave comments on your pull request when a build -fails due to linter warnings. You can run `make lint` locally to help determine -whether you've fixed any linter warnings detected by Jenkins. - -In some cases linter warnings will be false positives. `golangci-lint` supports -`//nolint[:lintername]` comment directives in order to quell them. Please -include an explanatory comment if you must add a `//nolint` comment. You may -also submit a PR against [`.golangci.yml`](.golangci.yml) if you feel -particular linter warning should be permanently disabled. - -## Comments - -Comments should be added to all new methods and structures as is appropriate for the coding -language. Additionally, if an existing method or structure is modified sufficiently, comments should -be created if they do not yet exist and updated if they do. - -The goal of comments is to make the code more readable and grokkable by future developers. Once you -have made your code as understandable as possible, add comments to make sure future developers can -understand (A) what this piece of code's responsibility is within Crossplane's architecture and (B) why it -was written as it was. - -The below blog entry explains more the why's and how's of this guideline. -https://blog.codinghorror.com/code-tells-you-how-comments-tell-you-why/ - -For Go, Crossplane follows standard godoc guidelines. -A concise godoc guideline can be found here: https://blog.golang.org/godoc-documenting-go-code - -## Commits -### Commit Messages - -We follow a rough convention for commit messages that is designed to answer two -questions: what changed and why. The subject line should feature the what and -the body of the commit should describe the why. - -``` -aws: add support for RDS controller - -this commit enables controllers and apis for RDS. It -enables provisioning a RDS database. -``` - -The format can be described more formally as follows: - -``` -: - - - -