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 user-group permission to robot user #436

Open
steled opened this issue May 8, 2024 · 2 comments
Open

Add user-group permission to robot user #436

steled opened this issue May 8, 2024 · 2 comments
Labels
question Further information is requested

Comments

@steled
Copy link

steled commented May 8, 2024

Describe the bug
I want to add user-group permissions to one of my robot account.

But when I use the resource shown below I get the following error:

harbor_robot_account.terraform: Creating...
╷
│ Error: [ERROR] unexpected status code got: 400 expected: 201
│  {"errors":[{"code":"BAD_REQUEST","message":"bad request permission: user-group:delete"}]}
│
│
│   with harbor_robot_account.terraform,
│   on serviceaccount.tf line 6, in resource "harbor_robot_account" "terraform":
│    6: resource "harbor_robot_account" "terraform" {

But there is an delete action for the user-group resource as you can see here.

To Reproduce

  • create a harbor_robot_account resource as described below:
resource "harbor_robot_account" "terraform" {
  name        = "terraform"
  description = "system level robot account"
  level       = "system"
  secret      = "test"
  permissions {
    access {
      action   = "create"
      resource = "project"
    }
    access {
      action   = "list"
      resource = "project"
    }
    access {
      action   = "create"
      resource = "user-group"
    }
    access {
      action   = "delete"
      resource = "user-group"
    }
    access {
      action   = "read"
      resource = "user-group"
    }
    access {
      action   = "update"
      resource = "user-group"
    }
    kind      = "system"
    namespace = "/"
  }
  permissions {
    access {
      action   = "delete"
      resource = "project"
    }
    access {
      action   = "read"
      resource = "project"
    }
    access {
      action   = "update"
      resource = "project"
    }
    kind      = "project"
    namespace = "*"
  }
}

Expected behavior
A robot user that gets grants for user-group

Additional context

  • Provider Version: v3.10.9
  • Terraform Version: v1.8.0
  • Harbor Version: v2.10.1-b7b88476
@flbla
Copy link
Contributor

flbla commented May 13, 2024

with the 2.10 version harbor API support less robot rights
can you add your use case here : goharbor/harbor#20076 ?

I will update the doc of the provider

@flbla flbla added the question Further information is requested label May 13, 2024
@steled
Copy link
Author

steled commented May 14, 2024

can you add your use case here : goharbor/harbor#20076 ?

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants