Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions api/types/accesslist/accesslist.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,8 @@ func (a *AccessList) MatchSearch(values []string) bool {
return types.MatchSearch(fieldVals, values, nil)
}

// CloneResource returns a copy of the resource as types.ResourceWithLabels.
func (a *AccessList) CloneResource() types.ResourceWithLabels {
// Clone returns a copy of the list.
func (a *AccessList) Clone() *AccessList {
var copy *AccessList
utils.StrictObjectToStruct(a, &copy)
return copy
Expand Down
7 changes: 7 additions & 0 deletions api/types/accesslist/member.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,10 @@ func (a *AccessListMember) MatchSearch(values []string) bool {
fieldVals := append(utils.MapToStrings(a.GetAllLabels()), a.GetName())
return types.MatchSearch(fieldVals, values, nil)
}

// Clone returns a copy of the member.
func (a *AccessListMember) Clone() *AccessListMember {
var copy *AccessListMember
utils.StrictObjectToStruct(a, &copy)
return copy
}
8 changes: 8 additions & 0 deletions api/types/accesslist/review.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/gravitational/teleport/api/types"
"github.com/gravitational/teleport/api/types/header"
"github.com/gravitational/teleport/api/types/header/convert/legacy"
"github.com/gravitational/teleport/api/utils"
)

// Review is an access list review resource.
Expand Down Expand Up @@ -114,6 +115,13 @@ func (r *Review) GetMetadata() types.Metadata {
return legacy.FromHeaderMetadata(r.Metadata)
}

// Clone returns a copy of the review.
func (a *Review) Clone() *Review {
var copy *Review
utils.StrictObjectToStruct(a, &copy)
return copy
}

func (r *ReviewSpec) UnmarshalJSON(data []byte) error {
type Alias ReviewSpec
review := struct {
Expand Down
Loading
Loading