mirror of
https://github.com/rancher/os.git
synced 2025-08-06 01:04:26 +00:00
68 lines
1.7 KiB
Go
68 lines
1.7 KiB
Go
|
/*
|
||
|
Copyright 2021 Rancher Labs, Inc.
|
||
|
|
||
|
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 provisioning
|
||
|
|
||
|
import (
|
||
|
"github.com/rancher/wrangler/pkg/generic"
|
||
|
"k8s.io/client-go/rest"
|
||
|
)
|
||
|
|
||
|
type Factory struct {
|
||
|
*generic.Factory
|
||
|
}
|
||
|
|
||
|
func NewFactoryFromConfigOrDie(config *rest.Config) *Factory {
|
||
|
f, err := NewFactoryFromConfig(config)
|
||
|
if err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
return f
|
||
|
}
|
||
|
|
||
|
func NewFactoryFromConfig(config *rest.Config) (*Factory, error) {
|
||
|
return NewFactoryFromConfigWithOptions(config, nil)
|
||
|
}
|
||
|
|
||
|
func NewFactoryFromConfigWithNamespace(config *rest.Config, namespace string) (*Factory, error) {
|
||
|
return NewFactoryFromConfigWithOptions(config, &FactoryOptions{
|
||
|
Namespace: namespace,
|
||
|
})
|
||
|
}
|
||
|
|
||
|
type FactoryOptions = generic.FactoryOptions
|
||
|
|
||
|
func NewFactoryFromConfigWithOptions(config *rest.Config, opts *FactoryOptions) (*Factory, error) {
|
||
|
f, err := generic.NewFactoryFromConfigWithOptions(config, opts)
|
||
|
return &Factory{
|
||
|
Factory: f,
|
||
|
}, err
|
||
|
}
|
||
|
|
||
|
func NewFactoryFromConfigWithOptionsOrDie(config *rest.Config, opts *FactoryOptions) *Factory {
|
||
|
f, err := NewFactoryFromConfigWithOptions(config, opts)
|
||
|
if err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
return f
|
||
|
}
|
||
|
|
||
|
func (c *Factory) Provisioning() Interface {
|
||
|
return New(c.ControllerFactory())
|
||
|
}
|