mirror of https://github.com/kubernetes/kops.git
Update IAM Policy Principal.Service to stringorset
This commit is contained in:
parent
8f71e68d68
commit
3f74f21b7e
|
@ -278,12 +278,12 @@ func (s *Statement) MarshalJSON() ([]byte, error) {
|
|||
}
|
||||
|
||||
type Principal struct {
|
||||
Federated string `json:",omitempty"`
|
||||
Service string `json:",omitempty"`
|
||||
Federated string `json:",omitempty"`
|
||||
Service *stringorset.StringOrSet `json:",omitempty"`
|
||||
}
|
||||
|
||||
func (p *Principal) IsEmpty() bool {
|
||||
return *p == Principal{}
|
||||
return p.Federated == "" && (p.Service == nil || p.Service.IsEmpty())
|
||||
}
|
||||
|
||||
// Equal compares two IAM Statements and returns a bool
|
||||
|
|
|
@ -64,7 +64,7 @@ func TestRoundTrip(t *testing.T) {
|
|||
{
|
||||
IAM: &Statement{
|
||||
Effect: StatementEffectDeny,
|
||||
Principal: Principal{Service: "service"},
|
||||
Principal: Principal{Service: fi.PtrTo(stringorset.Of("service"))},
|
||||
Condition: map[string]interface{}{
|
||||
"bar": "baz",
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue