Validate host sets when they are created or updated. (#5)
This commit is contained in:
3 files changed
+123
-10
No files matched your search
+2
-2
@@ -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)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user