Skip to content

Commit

Permalink
refactor: Revert changes for container registry made by mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
adeatcu-ionos committed Jan 28, 2025
1 parent 2170cd7 commit a15eb21
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion ionoscloud/data_source_container_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ func dataSourceContainerRegistry() *schema.Resource {
}
}

//nolint:gocyclo
func dataSourceContainerRegistryRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
client := meta.(services.SdkBundle).ContainerClient

Expand Down
2 changes: 1 addition & 1 deletion services/containerregistry/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func NewClient(username, password, token, url, version, terraformVersion string,
newConfigRegistry.HTTPClient = &http.Client{Transport: utils.CreateTransport(insecure)}
newConfigRegistry.UserAgent = fmt.Sprintf(
"terraform-provider/%s_ionos-cloud-sdk-go-container-cr/%s_hashicorp-terraform/%s_terraform-plugin-sdk/%s_os/%s_arch/%s",
version, cr.Version, terraformVersion, meta.SDKVersionString(), runtime.GOOS, runtime.GOARCH) //nolint:staticcheck
version, cr.Version, terraformVersion, meta.SDKVersionString(), runtime.GOOS, runtime.GOARCH)

return &Client{
sdkClient: cr.NewAPIClient(newConfigRegistry),
Expand Down
4 changes: 2 additions & 2 deletions services/containerregistry/registries.go
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ func GetScopes(d *schema.ResourceData) *[]cr.Scope {
if actions, ok := scopeContent["actions"]; ok {
actions := actions.([]interface{})
var actionsToAdd []string
if len(actions) > 0 {
if actions != nil && len(actions) > 0 {
for _, action := range actions {
actionsToAdd = append(actionsToAdd, action.(string))
}
Expand Down Expand Up @@ -444,7 +444,7 @@ func SetCredentials(credentials cr.Credentials) map[string]interface{} {

func SetScopes(scopes []cr.Scope) []interface{} {

var tokenScopes []interface{} //nolint:prealloc
var tokenScopes []interface{}
for _, scope := range scopes {
scopeEntry := make(map[string]interface{})

Expand Down

0 comments on commit a15eb21

Please sign in to comment.