1
0
mirror of https://github.com/rancher/norman.git synced 2025-07-03 18:47:32 +00:00
norman/pkg/objectset/desiredset.go

39 lines
1.0 KiB
Go
Raw Normal View History

2018-12-17 22:41:24 +00:00
package objectset
import (
2019-01-11 23:55:37 +00:00
"github.com/rancher/norman/objectclient"
2018-12-17 22:41:24 +00:00
"github.com/rancher/norman/pkg/objectset/injectors"
"github.com/rancher/norman/types"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
2019-01-11 23:55:37 +00:00
"k8s.io/client-go/discovery"
"k8s.io/client-go/rest"
2018-12-17 22:41:24 +00:00
)
type DesiredSet struct {
2019-01-11 23:55:37 +00:00
discoveredClients map[schema.GroupVersionKind]*objectclient.ObjectClient
discovery discovery.DiscoveryInterface
restConfig rest.Config
remove bool
setID string
objs *ObjectSet
codeVersion string
clients map[schema.GroupVersionKind]Client
owner runtime.Object
injectors []injectors.ConfigInjector
errs []error
2018-12-17 22:41:24 +00:00
}
func (o *DesiredSet) AddInjector(inj injectors.ConfigInjector) {
o.injectors = append(o.injectors, inj)
}
func (o *DesiredSet) err(err error) error {
o.errs = append(o.errs, err)
return o.Err()
}
func (o *DesiredSet) Err() error {
return types.NewErrors(append(o.objs.errs, o.errs...)...)
}