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

Implement resources and data sources for GitLab Agent for Kubernetes API #1073

Merged

Conversation

timofurrer
Copy link
Member

This change set adds the following new resources / data sources:

  • resource gitlab_project_cluster_agent
  • data gitlab_project_cluster_agent
  • data gitlab_project_cluster_agents

Corresponding to the new API here: https://docs.gitlab.com/ee/api/cluster_agents.html

This PR is currently blocked by:

@nagyv I had quite some discussions about the naming of that API over at GitLab. In the provider we usually name resources / data sources similar to the API path, thus /projects/:id/cluster_agents becomes gitlab_project_cluster_agent ... Is that okay with you, too? Or do you have any other preference for that particular resource name?

@timofurrer timofurrer added this to the v3.15.0 milestone May 5, 2022
@timofurrer timofurrer requested review from nagyv and armsnyder May 5, 2022 06:56
@timofurrer timofurrer self-assigned this May 5, 2022
@github-actions github-actions bot added data-source Adds or modifies a data-source documentation provider resource Adds or modifies a resource tests size/L labels May 5, 2022
@timofurrer timofurrer added blocked We are currently blocked to implement this go-gitlab Is related to go-gitlab. Maybe be combined with other labels, like `blocked`. labels May 5, 2022
@timofurrer timofurrer requested a review from RicePatrick May 5, 2022 07:18
@RicePatrick
Copy link
Collaborator

Hey @timofurrer - I saw you requested a review after flagging this as blocked. Are you looking for a first round review?

@timofurrer
Copy link
Member Author

@PatrickRice-KSC Yes, please. The code shouldn't be affected by the draft state ;)

@nagyv
Copy link
Collaborator

nagyv commented May 10, 2022

@timofurrer Good question. I don't have a very strong opinion, but a would prefer to call it gitlab_cluster_agent.

The project relationship is there really only to store the agent configurations and management views. The idea is to have agents that maintain a connection with a cluster, and this is independent of the concept of a project.

At the same time, to keep consistency, I don't mind the gitlab_project_cluster_agent resource name.

Copy link
Collaborator

@RicePatrick RicePatrick left a comment

Choose a reason for hiding this comment

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

I didn't make it though all the files yet, but I have a couple comments/questions so far 🙂

@timofurrer timofurrer force-pushed the feature/gitlab_project_cluster_agent branch 2 times, most recently from ad36bf6 to 15e37d0 Compare May 13, 2022 10:11
Copy link
Collaborator

@RicePatrick RicePatrick left a comment

Choose a reason for hiding this comment

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

One one (more general) comment, otherwise it's a bit difficult to confirm with all the compile issues, but it overall looks solid to me :)

internal/provider/schema_gitlab_project_cluster_agent.go Outdated Show resolved Hide resolved
@timofurrer
Copy link
Member Author

@timofurrer Good question. I don't have a very strong opinion, but a would prefer to call it gitlab_cluster_agent.

The project relationship is there really only to store the agent configurations and management views. The idea is to have agents that maintain a connection with a cluster, and this is independent of the concept of a project.

At the same time, to keep consistency, I don't mind the gitlab_project_cluster_agent resource name.

@armsnyder you've put a 👍 there ... What was your preference, gitlab_cluster_agent or gitlab_project_cluster_agent ? Or both would be okay?

@armsnyder
Copy link
Collaborator

@timofurrer Good question. I don't have a very strong opinion, but a would prefer to call it gitlab_cluster_agent.
The project relationship is there really only to store the agent configurations and management views. The idea is to have agents that maintain a connection with a cluster, and this is independent of the concept of a project.
At the same time, to keep consistency, I don't mind the gitlab_project_cluster_agent resource name.

@armsnyder you've put a 👍 there ... What was your preference, gitlab_cluster_agent or gitlab_project_cluster_agent ? Or both would be okay?

Both are okay. 👍 If I had to choose I would go with gitlab_cluster_agent.

@timofurrer timofurrer force-pushed the feature/gitlab_project_cluster_agent branch from 15e37d0 to c267422 Compare May 22, 2022 13:31
@timofurrer
Copy link
Member Author

I've renamed the resources to gitlab_cluster_agent 👍

@timofurrer timofurrer force-pushed the feature/gitlab_project_cluster_agent branch 2 times, most recently from e2b14bb to ac4bd8c Compare May 22, 2022 13:34
@timofurrer timofurrer removed blocked We are currently blocked to implement this go-gitlab Is related to go-gitlab. Maybe be combined with other labels, like `blocked`. labels May 22, 2022
@timofurrer timofurrer requested a review from RicePatrick May 22, 2022 17:23
@timofurrer
Copy link
Member Author

blocked by: #1095

@timofurrer timofurrer added the blocked We are currently blocked to implement this label May 22, 2022
armsnyder
armsnyder previously approved these changes May 22, 2022
Copy link
Collaborator

@armsnyder armsnyder left a comment

Choose a reason for hiding this comment

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

lgtm!

@RicePatrick
Copy link
Collaborator

We're green across the board, I assume you're still waiting for 1095 though before you merge, is that the plan?

RicePatrick
RicePatrick previously approved these changes May 23, 2022
@timofurrer timofurrer dismissed stale reviews from RicePatrick and armsnyder via b86a179 May 27, 2022 09:14
@timofurrer timofurrer force-pushed the feature/gitlab_project_cluster_agent branch from ac4bd8c to b86a179 Compare May 27, 2022 09:14
@timofurrer timofurrer removed the blocked We are currently blocked to implement this label May 27, 2022
@timofurrer timofurrer force-pushed the feature/gitlab_project_cluster_agent branch from b86a179 to d2b37fd Compare May 27, 2022 09:47
@timofurrer timofurrer force-pushed the feature/gitlab_project_cluster_agent branch from d2b37fd to 0f4b954 Compare May 27, 2022 10:13
@timofurrer timofurrer merged commit 5ef55c7 into gitlabhq:main May 28, 2022
@github-actions
Copy link

This functionality has been released in v3.15.0 of the Terraform GitLab Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue. Thank you!

@github-actions github-actions bot locked and limited conversation to collaborators Nov 9, 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.

4 participants