99
1010 "github.com/hashicorp/terraform-plugin-sdk/v2/diag"
1111 "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
12- cr "github.com/ionos-cloud/sdk-go-container-registry "
12+ cr "github.com/ionos-cloud/sdk-go-bundle/products/containerregistry/v2 "
1313
1414 "github.com/ionos-cloud/terraform-provider-ionoscloud/v6/services"
1515 crService "github.com/ionos-cloud/terraform-provider-ionoscloud/v6/services/containerregistry"
@@ -159,18 +159,17 @@ func dataSourceContainerRegistryRead(ctx context.Context, d *schema.ResourceData
159159 return diags
160160 }
161161
162- results = * registries .Items
162+ results = registries .Items
163163 if nameOk {
164164 partialMatch := d .Get ("partial_match" ).(bool )
165165
166166 log .Printf ("[INFO] Using data source for container registry by name with partial_match %t and name: %s" , partialMatch , name )
167167
168- if registries .Items != nil && len (* registries .Items ) > 0 {
168+ if registries .Items != nil && len (registries .Items ) > 0 {
169169 var registriesByName []cr.RegistryResponse
170- for _ , registryItem := range * registries .Items {
171- if registryItem .Properties != nil && registryItem .Properties .Name != nil &&
172- (partialMatch && strings .Contains (* registryItem .Properties .Name , name ) ||
173- ! partialMatch && strings .EqualFold (* registryItem .Properties .Name , name )) {
170+ for _ , registryItem := range registries .Items {
171+ if partialMatch && strings .Contains (registryItem .Properties .Name , name ) ||
172+ ! partialMatch && strings .EqualFold (registryItem .Properties .Name , name ) {
174173 registriesByName = append (registriesByName , registryItem )
175174 }
176175 }
@@ -185,7 +184,7 @@ func dataSourceContainerRegistryRead(ctx context.Context, d *schema.ResourceData
185184 if locationOk {
186185 var registriesByLocation []cr.RegistryResponse
187186 for _ , registryItem := range results {
188- if registryItem . Properties != nil && registryItem . Properties . Name != nil && strings .EqualFold (* registryItem .Properties .Location , location ) {
187+ if strings .EqualFold (registryItem .Properties .Location , location ) {
189188 registriesByLocation = append (registriesByLocation , registryItem )
190189 }
191190 }
0 commit comments