use empty struct for UserAssignedIdentities map value; omitempty
This commit is contained in:
parent
c5e2eff847
commit
b334458b91
|
@ -100,14 +100,10 @@ type Properties struct {
|
|||
}
|
||||
|
||||
// Template > Resource > Identity
|
||||
// The map values are simplified to struct{} since they are read-only and cannot be set
|
||||
type Identity struct {
|
||||
Type *string `json:"type,omitempty"`
|
||||
UserAssignedIdentities map[string]*UserAssignedIdentitiesValue `json:"userAssignedIdentities"`
|
||||
}
|
||||
|
||||
type UserAssignedIdentitiesValue struct {
|
||||
PrincipalId *string `json:"principalId,omitempty"`
|
||||
ClientId *string `json:"clientId,omitempty"`
|
||||
Type *string `json:"type,omitempty"`
|
||||
UserAssignedIdentities map[string]struct{} `json:"userAssignedIdentities,omitempty"`
|
||||
}
|
||||
|
||||
type AccessPolicies struct {
|
||||
|
|
|
@ -115,10 +115,10 @@ func (s *TemplateBuilder) SetIdentity(userAssignedManagedIdentities []string) er
|
|||
s.setVariable("apiVersion", "2018-06-01") // Required for user assigned managed identity
|
||||
id = &Identity{
|
||||
Type: to.StringPtr("UserAssigned"),
|
||||
UserAssignedIdentities: make(map[string]*UserAssignedIdentitiesValue),
|
||||
UserAssignedIdentities: make(map[string]struct{}),
|
||||
}
|
||||
for _, uid := range userAssignedManagedIdentities {
|
||||
id.UserAssignedIdentities[uid] = &UserAssignedIdentitiesValue{}
|
||||
id.UserAssignedIdentities[uid] = struct{}{}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue