-
Notifications
You must be signed in to change notification settings - Fork 90
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
Can't manage private projects with the harbor_project resource #350
Comments
Hello, |
Hi, |
indeed, we can improve it |
should this simply handle the 401 error (which imho is the wrong error, it should be 403) or should it also hint towards this problem? |
Signed-off-by: flbla <[email protected]>
fixes #350 Signed-off-by: flbla <[email protected]>
Describe the bug
When creating a project with "public = true" I receive an "Error: Resource not found /projects/123"
The project is actually created in harbor. I assume it fails when trying to get the info of the just-created project.
When I set the project to "public = true" it works just fine.
Same behavior when trying to import an existing harbor_project into the tf state:
It works if public and fails if private.
To Reproduce
Create project with "public = false" (default).
or
Import project which is already private.
Expected behavior
I would expect this to not fail.
Additional context
Example log:
harbor_project.main: Creating...
2023-07-20T15:44:15.536+0200 [INFO] Starting apply for harbor_project.main
2023-07-20T15:44:15.536+0200 [DEBUG] harbor_project.main: applying the planned Create change
2023-07-20T15:44:15.537+0200 [INFO] provider.terraform-provider-harbor_v3.9.4: 2023/07/20 15:44:15 [DEBUG] []: timestamp=2023-07-20T15:44:15.537+0200
2023-07-20T15:44:15.781+0200 [ERROR] provider.terraform-provider-harbor_v3.9.4: Response contains error diagnostic: tf_proto_version=5.3 tf_rpc=ApplyResourceChange @module=sdk.proto diagnostic_severity=ERROR diagnostic_detail= diagnostic_summary="Resource not found /projects/1136" tf_provider_addr=provider tf_req_id=88f28883-acf6-3564-5cbd-59f82c9dc3ed tf_resource_type=harbor_project @caller=github.com/hashicorp/[email protected]/tfprotov5/internal/diag/diagnostics.go:55 timestamp=2023-07-20T15:44:15.781+0200
2023-07-20T15:44:15.784+0200 [DEBUG] State storage *statemgr.Filesystem declined to persist a state snapshot
2023-07-20T15:44:15.784+0200 [ERROR] vertex "harbor_project.main" error: Resource not found /projects/1136
│ Error: Resource not found /projects/1136
│
│ with harbor_project.main,
│ on main.tf line 38, in resource "harbor_project" "main":
│ 38: resource "harbor_project" "main" {
not sure if this is an issue for the terraform provider or the main harbor project. I didn't try to reproduce it manually through the API.
The text was updated successfully, but these errors were encountered: