Repository navigation
feat(container-registry): onboard tf driver for container registry - #1870
martinezmo wants to merge 5 commits into
Conversation
Fyusel
left a comment
There was a problem hiding this comment.
Thank you for your contribution.
Only some small things at the start, will continue with a detailed review
| "credentials": types.ObjectType{AttrTypes: credentialsTypes}, | ||
| } | ||
|
|
||
| var descriptions = map[string]string{ //nolint:gosec // linter false positive |
There was a problem hiding this comment.
please describe what the false positive is
|
|
||
| type proxyItemModel struct { | ||
| Description types.String `tfsdk:"description"` | ||
|
|
| var proxyTypes = map[string]attr.Type{ | ||
|
|
||
| "description": types.StringType, | ||
|
|
| } | ||
|
|
||
| var artifactoryItemTypes = map[string]attr.Type{ | ||
|
|
There was a problem hiding this comment.
same here and the following as well please
| } | ||
|
|
||
| resp.Diagnostics.Append(req.Config.Get(ctx, &configModel)...) | ||
|
|
| @@ -0,0 +1,36 @@ | |||
| variable "project_id" { | |||
There was a problem hiding this comment.
please use the same structure as in the other services
| @@ -0,0 +1,12 @@ | |||
| variable "project_id" { | |||
| ImportState: true, | ||
| ImportStateVerify: true, | ||
| }, | ||
| }, |
| dockerUsername := os.Getenv("TF_ACC_CONTAINER_REGISTRY_DOCKER_USERNAME") | ||
| dockerPassword := os.Getenv("TF_ACC_CONTAINER_REGISTRY_DOCKER_PASSWORD") | ||
| if dockerUsername == "" || dockerPassword == "" { | ||
| t.Skip("Skipping TestAccContainerRegistryArtifactoryMax: TF_ACC_CONTAINER_REGISTRY_DOCKER_USERNAME or TF_ACC_CONTAINER_REGISTRY_DOCKER_PASSWORD not set") |
There was a problem hiding this comment.
Does this mean the max test can only run with a valid docker username an password?
So in order to test this ressource a docker account is needed?
Is there a possibility to run a max test without such external dependencies? We cannot provide a docker account in order to run this acceptance test (currently we run those locally but in the future this will be done by the CI).
| service_account_email = "abc@abc.de" | ||
| cdn_custom_endpoint = "https://cdn.api.eu01.stackit.cloud" | ||
| dns_custom_endpoint = "https://dns.api.stackit.cloud" | ||
| containerregistry_custom_endpoint = "https://registry.api.stackit.cloud" |
There was a problem hiding this comment.
mismatch: container_registry_custom_endpoint
| "region": schema.StringAttribute{ | ||
| Description: descriptions["region"], | ||
| Optional: true, | ||
| Computed: true, |
There was a problem hiding this comment.
| Computed: true, |
| Description: descriptions["artifactory_id"], | ||
| Required: true, | ||
| Validators: []validator.String{ | ||
| validate.NoSeparator(), |
| fmt.Sprintf("Calling API: %v", err), | ||
| map[int]string{ | ||
| http.StatusNotFound: fmt.Sprintf("Artifactory %q not found", artifactoryId), | ||
| }, |
There was a problem hiding this comment.
resp.State.RemoveResource(ctx) missing
| Description: descriptions["artifactory_id"], | ||
| Computed: true, | ||
| PlanModifiers: []planmodifier.String{ | ||
| stringplanmodifier.UseStateForUnknown(), |
There was a problem hiding this comment.
Validators: []validator.String{
validate.UUID(),
validate.NoSeparator(),
},
| Description: descriptions["create_time"], | ||
| Computed: true, | ||
| }, | ||
| "state": schema.StringAttribute{ |
|
|
||
| payload := registry.NewPatchArtifactoryPayload() | ||
|
|
||
| if !model.Proxy.IsNull() && !model.Proxy.IsUnknown() { |
| } | ||
| } | ||
|
|
||
| secret := getAccessSecret(&creds, nil, configCreds, false) |
There was a problem hiding this comment.
regarding credentials and the write only attribute: please have a look at e.g. the VPN resource and use the same implementation like it is there
| if !resp.Diagnostics.HasError() { | ||
| t.Error("expected diagnostics on delete error") | ||
| } | ||
| }) |
There was a problem hiding this comment.
TestSavesIDsOnError is missing (see CONTRIBUTION for more details)
| "registry_type": types.StringType, | ||
| } | ||
|
|
||
| var descriptions = map[string]string{ //nolint:gosec // linter false positive |
There was a problem hiding this comment.
same here: more details why false positive
| "region": schema.StringAttribute{ | ||
| Description: descriptions["region"], | ||
| Optional: true, | ||
| Computed: true, |
There was a problem hiding this comment.
| Computed: true, |
Description
relates to STACKITCRE-383
Checklist
make fmtexamples/directory)make generate-docs(will be checked by CI)make test(will be checked by CI)make lint(will be checked by CI)