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 (
|
2023-01-26 23:48:30 +00:00
|
|
|
"github.com/rancher/lasso/pkg/controller"
|
2024-05-06 16:42:27 +00:00
|
|
|
"github.com/rancher/wrangler/v3/pkg/generic"
|
2019-05-09 22:06:33 +00:00
|
|
|
"k8s.io/client-go/rest"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Factory struct {
|
2021-07-03 08:37:19 +00:00
|
|
|
*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,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2021-07-03 08:37:19 +00:00
|
|
|
type FactoryOptions = generic.FactoryOptions
|
2020-04-23 00:42:12 +00:00
|
|
|
|
|
|
|
func NewFactoryFromConfigWithOptions(config *rest.Config, opts *FactoryOptions) (*Factory, error) {
|
2021-07-03 08:37:19 +00:00
|
|
|
f, err := generic.NewFactoryFromConfigWithOptions(config, opts)
|
2019-05-09 22:06:33 +00:00
|
|
|
return &Factory{
|
2021-07-03 08:37:19 +00:00
|
|
|
Factory: f,
|
|
|
|
}, err
|
2019-05-09 22:06:33 +00:00
|
|
|
}
|
|
|
|
|
2021-07-03 08:37:19 +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
|
|
|
}
|
2021-07-03 08:37:19 +00:00
|
|
|
return f
|
2019-05-09 22:06:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (c *Factory) K3s() Interface {
|
2021-07-03 08:37:19 +00:00
|
|
|
return New(c.ControllerFactory())
|
2019-05-09 22:06:33 +00:00
|
|
|
}
|
2023-01-26 23:48:30 +00:00
|
|
|
|
|
|
|
func (c *Factory) WithAgent(userAgent string) Interface {
|
|
|
|
return New(controller.NewSharedControllerFactoryWithAgent(userAgent, c.ControllerFactory()))
|
|
|
|
}
|