Skip to content

Commit

Permalink
apps: included registry_credentials option for images (#1137)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewsomething committed Apr 11, 2024
1 parent 629bb3b commit 007c65e
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions digitalocean/app/app_spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,12 @@ func appSpecImageSourceSchema() map[string]*schema.Schema {
},
},
},
"registry_credentials": {
Type: schema.TypeString,
Required: true,
Description: "Access credentials for third-party registries",
Sensitive: true,
},
}
}

Expand Down Expand Up @@ -1377,10 +1383,11 @@ func expandAppImageSourceSpec(config []interface{}) *godo.ImageSourceSpec {
imageSourceConfig := config[0].(map[string]interface{})

imageSource := &godo.ImageSourceSpec{
RegistryType: godo.ImageSourceSpecRegistryType(imageSourceConfig["registry_type"].(string)),
Registry: imageSourceConfig["registry"].(string),
Repository: imageSourceConfig["repository"].(string),
Tag: imageSourceConfig["tag"].(string),
RegistryType: godo.ImageSourceSpecRegistryType(imageSourceConfig["registry_type"].(string)),
Registry: imageSourceConfig["registry"].(string),
Repository: imageSourceConfig["repository"].(string),
Tag: imageSourceConfig["tag"].(string),
RegistryCredentials: imageSourceConfig["registry_credentials"].(string),
}

docrPush := imageSourceConfig["deploy_on_push"].([]interface{})
Expand All @@ -1403,6 +1410,7 @@ func flattenAppImageSourceSpec(i *godo.ImageSourceSpec) []interface{} {
r["registry"] = (*i).Registry
r["repository"] = (*i).Repository
r["tag"] = (*i).Tag
r["registry_credentials"] = (*i).RegistryCredentials

if i.DeployOnPush != nil {
docrPush := make([]interface{}, 1)
Expand Down

0 comments on commit 007c65e

Please sign in to comment.