k3s/pkg/generated/controllers/k3s.cattle.io/factory.go

73 lines
1.9 KiB
Go
Raw Normal View History

2019-05-09 22:06:33 +00:00
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by main. DO NOT EDIT.
package k3s
import (
"github.com/rancher/lasso/pkg/controller"
"github.com/rancher/wrangler/v3/pkg/generic"
2019-05-09 22:06:33 +00:00
"k8s.io/client-go/rest"
)
type Factory struct {
*generic.Factory
2019-05-09 22:06:33 +00:00
}
func NewFactoryFromConfigOrDie(config *rest.Config) *Factory {
f, err := NewFactoryFromConfig(config)
if err != nil {
panic(err)
}
return f
}
func NewFactoryFromConfig(config *rest.Config) (*Factory, error) {
2020-04-23 00:42:12 +00:00
return NewFactoryFromConfigWithOptions(config, nil)
2019-05-09 22:06:33 +00:00
}
func NewFactoryFromConfigWithNamespace(config *rest.Config, namespace string) (*Factory, error) {
2020-04-23 00:42:12 +00:00
return NewFactoryFromConfigWithOptions(config, &FactoryOptions{
Namespace: namespace,
})
}
type FactoryOptions = generic.FactoryOptions
2020-04-23 00:42:12 +00:00
func NewFactoryFromConfigWithOptions(config *rest.Config, opts *FactoryOptions) (*Factory, error) {
f, err := generic.NewFactoryFromConfigWithOptions(config, opts)
2019-05-09 22:06:33 +00:00
return &Factory{
Factory: f,
}, err
2019-05-09 22:06:33 +00:00
}
func NewFactoryFromConfigWithOptionsOrDie(config *rest.Config, opts *FactoryOptions) *Factory {
f, err := NewFactoryFromConfigWithOptions(config, opts)
if err != nil {
panic(err)
2019-05-09 22:06:33 +00:00
}
return f
2019-05-09 22:06:33 +00:00
}
func (c *Factory) K3s() Interface {
return New(c.ControllerFactory())
2019-05-09 22:06:33 +00:00
}
func (c *Factory) WithAgent(userAgent string) Interface {
return New(controller.NewSharedControllerFactoryWithAgent(userAgent, c.ControllerFactory()))
}