mirror of
https://github.com/portainer/portainer.git
synced 2026-06-23 06:40:13 +00:00
31 lines
717 B
Go
31 lines
717 B
Go
package uac
|
|
|
|
import (
|
|
"github.com/docker/docker/api/types/swarm"
|
|
portainer "github.com/portainer/portainer/api"
|
|
)
|
|
|
|
func ConfigResourceControlGetter[
|
|
TX txLike[RCS, TS, US],
|
|
RCS rcServiceLike,
|
|
TS teamServiceLike,
|
|
US userServiceLike,
|
|
](
|
|
tx TX,
|
|
endpointID portainer.EndpointID,
|
|
) func(item swarm.Config) (*portainer.ResourceControl, error) {
|
|
return genericResourcControlGetter(tx, endpointID, ResourceContext[swarm.Config]{
|
|
RCType: portainer.ConfigResourceControl,
|
|
IDGetter: ConfigResourceControlID,
|
|
LabelsGetter: ConfigLabels,
|
|
})
|
|
}
|
|
|
|
func ConfigResourceControlID(item swarm.Config) string {
|
|
return item.ID
|
|
}
|
|
|
|
func ConfigLabels(item swarm.Config) map[string]string {
|
|
return item.Spec.Labels
|
|
}
|