Validate host sets when they are created or updated. (#5)

This commit is contained in:
Todd authored and GitHub committed 2021-11-23 08:57:08 -07:00
1 parent 6ac09ab032
commit bb02a6d0db
3 files changed
+123 -10

No files matched your search

+2 -2
View File
@@ -21,7 +21,7 @@ type AuthorizationInfo struct {
AuthParams AuthParams
}
type Attributes struct {
type CatalogAttributes struct {
SubscriptionId string `mapstructure:"subscription_id"`
ClientId string `mapstructure:"client_id"`
TenantId string `mapstructure:"tenant_id"`
@@ -55,7 +55,7 @@ func getAuthorizationInfo(hc *hostcatalogs.HostCatalog) (*AuthorizationInfo, err
}
hcFields := hc.GetAttributes().AsMap()
var attrs Attributes
var attrs CatalogAttributes
if err := mapstructure.Decode(hcFields, &attrs); err != nil {
return nil, fmt.Errorf("error decoding host catalog attribute fields: %w", err)
}