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

Add support for gitlab project cluster #87

Merged
merged 4 commits into from
Feb 15, 2019
Merged

Add support for gitlab project cluster #87

merged 4 commits into from
Feb 15, 2019

Conversation

matejvelikonja
Copy link
Contributor

@matejvelikonja matejvelikonja commented Feb 11, 2019

Terraform resource for adding project cluster.

API Documentation: https://docs.gitlab.com/ee/api/project_clusters.html

Solves #46

Example usage

resource "gitlab_project" "foo" {
  name = "foo-project-1"
}

resource gitlab_project_cluster "foo" {
  project                       = "${gitlab_project.foo.id}"
  name                          = "foo-cluster-1"
  kubernetes_api_url            = "https://124.124.124"
  kubernetes_token              = "some-token"
  environment_scope             = "*"
  kubernetes_ca_cert            = "some-cert"
  kubernetes_namespace          = "changed-namespace"
  kubernetes_authorization_type = "abac"
}

The documentation has not yet been added, since I would like to receive feedback first.

There is currently an issue with enabled field, which has been already reported to GitLab: https://gitlab.com/gitlab-org/gitlab-ce/issues/57300

@ghost ghost added the size/XL label Feb 11, 2019
@matejvelikonja
Copy link
Contributor Author

matejvelikonja commented Feb 11, 2019

Build currently fails, since https://github.com/xanzy/go-gitlab has to release a new version. Support for the Project cluster is already in the master branch.

https://github.com/xanzy/go-gitlab/blob/master/project_clusters.go

@svanharmelen

@ghost ghost added the dependencies label Feb 11, 2019
@matejvelikonja
Copy link
Contributor Author

go-gitlab library has been updated

@roidelapluie
Copy link
Collaborator

please split vendor update to a 2nd PR

@matejvelikonja
Copy link
Contributor Author

done in #89

@matejvelikonja
Copy link
Contributor Author

@roidelapluie any other findings except missing documentation?

Copy link
Collaborator

@jorcau jorcau left a comment

Choose a reason for hiding this comment

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

Hi,

Could you please add import acceptance test? Also, it'd be great if you could post the acceptance tests results!

Thanks!

@matejvelikonja
Copy link
Contributor Author

@jorcau

The results of Acceptance Tests, some tests actually fail, but they fail also in 028e509.

For starting GitLab I was using script https://github.com/terraform-providers/terraform-provider-gitlab/blob/eb8a73c7f633ba95a34847c9344073f6f430110e/start-gitlab.sh from PR #58

=> Checking that code complies with gofmt requirements...
TF_ACC=1 GITLAB_BASE_URL="http://127.0.0.1:8080/api/v4" GITLAB_TOKEN=ACCTEST go test $(go list ./... |grep -v 'vendor') -v  -timeout 120m
?   	github.com/terraform-providers/terraform-provider-gitlab	[no test files]
=== RUN   TestAccDataGitlabProject_basic
--- PASS: TestAccDataGitlabProject_basic (6.51s)
=== RUN   TestAccDataGitlabUser_basic
--- PASS: TestAccDataGitlabUser_basic (0.65s)
=== RUN   TestAccDataSourceGitlabUsers_basic
--- PASS: TestAccDataSourceGitlabUsers_basic (1.52s)
=== RUN   TestProvider
--- PASS: TestProvider (0.00s)
=== RUN   TestProvider_impl
--- PASS: TestProvider_impl (0.00s)
=== RUN   TestAccGitlabDeployKey_basic
--- PASS: TestAccGitlabDeployKey_basic (7.61s)
=== RUN   TestAccGitlabDeployKey_suppressfunc
--- PASS: TestAccGitlabDeployKey_suppressfunc (6.16s)
=== RUN   TestAccGitlabGroupMembership_basic
--- PASS: TestAccGitlabGroupMembership_basic (2.11s)
=== RUN   TestAccGitlabGroup_basic
--- FAIL: TestAccGitlabGroup_basic (1.55s)
    testing.go:494: Error destroying resource! WARNING: Dangling resources
        may exist. The full state and error is shown below.

        Error: Check failed: Group still exists

        State: <no state>
=== RUN   TestAccGitlabGroup_import
--- FAIL: TestAccGitlabGroup_import (0.60s)
    testing.go:494: Error destroying resource! WARNING: Dangling resources
        may exist. The full state and error is shown below.

        Error: Check failed: Group still exists

        State: <no state>
=== RUN   TestAccGitlabGroup_nested
--- FAIL: TestAccGitlabGroup_nested (3.14s)
    testing.go:494: Error destroying resource! WARNING: Dangling resources
        may exist. The full state and error is shown below.

        Error: Check failed: Group still exists

        State: <no state>
=== RUN   TestAccGitlabGroupVariable_basic
--- PASS: TestAccGitlabGroupVariable_basic (1.88s)
=== RUN   TestAccGitlabLabel_basic
--- PASS: TestAccGitlabLabel_basic (8.00s)
=== RUN   TestAccGitlabPipelineTrigger_basic
--- PASS: TestAccGitlabPipelineTrigger_basic (7.30s)
=== RUN   TestAccGitlabProjectCluster_basic
--- PASS: TestAccGitlabProjectCluster_basic (7.90s)
=== RUN   TestAccGitlabProjectCluster_import
--- PASS: TestAccGitlabProjectCluster_import (7.03s)
=== RUN   TestAccGitlabProjectHook_basic
--- PASS: TestAccGitlabProjectHook_basic (8.41s)
=== RUN   TestAccGitlabProjectMembership_basic
--- PASS: TestAccGitlabProjectMembership_basic (7.77s)
=== RUN   TestAccGitlabProject_basic
--- PASS: TestAccGitlabProject_basic (13.00s)
=== RUN   TestAccGitlabProject_import
--- PASS: TestAccGitlabProject_import (6.07s)
=== RUN   TestAccGitlabProject_nestedImport
--- PASS: TestAccGitlabProject_nestedImport (7.22s)
=== RUN   TestAccGitlabProjectVariable_basic
--- PASS: TestAccGitlabProjectVariable_basic (10.89s)
=== RUN   TestAccGitlabUser_basic
--- PASS: TestAccGitlabUser_basic (3.43s)
=== RUN   TestGitlab_validation
--- PASS: TestGitlab_validation (0.00s)
=== RUN   TestGitlab_visbilityHelpers
--- PASS: TestGitlab_visbilityHelpers (0.00s)
FAIL
FAIL	github.com/terraform-providers/terraform-provider-gitlab/gitlab	118.766s
make: *** [testacc] Error 1

@jorcau
Copy link
Collaborator

jorcau commented Feb 15, 2019

Thanks!

It looks good to me!

@roidelapluie roidelapluie merged commit bbdb3ed into gitlabhq:master Feb 15, 2019
@roidelapluie
Copy link
Collaborator

Thanks!

@matejvelikonja
Copy link
Contributor Author

@roidelapluie should I add some docs to https://github.com/terraform-providers/terraform-provider-gitlab/tree/master/website/docs/r

@github-actions github-actions bot locked and limited conversation to collaborators Nov 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

3 participants