-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14134 from deads2k/api-01-gc-defaults
Merged by openshift-bot
- Loading branch information
Showing
14 changed files
with
722 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
156 changes: 156 additions & 0 deletions
156
pkg/build/generated/clientset/typed/build/v1/buildconfig.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
package v1 | ||
|
||
import ( | ||
v1 "github.com/openshift/origin/pkg/build/api/v1" | ||
scheme "github.com/openshift/origin/pkg/build/generated/clientset/scheme" | ||
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
types "k8s.io/apimachinery/pkg/types" | ||
watch "k8s.io/apimachinery/pkg/watch" | ||
rest "k8s.io/client-go/rest" | ||
) | ||
|
||
// BuildConfigsGetter has a method to return a BuildConfigInterface. | ||
// A group's client should implement this interface. | ||
type BuildConfigsGetter interface { | ||
BuildConfigs(namespace string) BuildConfigInterface | ||
} | ||
|
||
// BuildConfigInterface has methods to work with BuildConfig resources. | ||
type BuildConfigInterface interface { | ||
Create(*v1.BuildConfig) (*v1.BuildConfig, error) | ||
Update(*v1.BuildConfig) (*v1.BuildConfig, error) | ||
UpdateStatus(*v1.BuildConfig) (*v1.BuildConfig, error) | ||
Delete(name string, options *meta_v1.DeleteOptions) error | ||
DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error | ||
Get(name string, options meta_v1.GetOptions) (*v1.BuildConfig, error) | ||
List(opts meta_v1.ListOptions) (*v1.BuildConfigList, error) | ||
Watch(opts meta_v1.ListOptions) (watch.Interface, error) | ||
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.BuildConfig, err error) | ||
BuildConfigExpansion | ||
} | ||
|
||
// buildConfigs implements BuildConfigInterface | ||
type buildConfigs struct { | ||
client rest.Interface | ||
ns string | ||
} | ||
|
||
// newBuildConfigs returns a BuildConfigs | ||
func newBuildConfigs(c *BuildV1Client, namespace string) *buildConfigs { | ||
return &buildConfigs{ | ||
client: c.RESTClient(), | ||
ns: namespace, | ||
} | ||
} | ||
|
||
// Create takes the representation of a buildConfig and creates it. Returns the server's representation of the buildConfig, and an error, if there is any. | ||
func (c *buildConfigs) Create(buildConfig *v1.BuildConfig) (result *v1.BuildConfig, err error) { | ||
result = &v1.BuildConfig{} | ||
err = c.client.Post(). | ||
Namespace(c.ns). | ||
Resource("buildconfigs"). | ||
Body(buildConfig). | ||
Do(). | ||
Into(result) | ||
return | ||
} | ||
|
||
// Update takes the representation of a buildConfig and updates it. Returns the server's representation of the buildConfig, and an error, if there is any. | ||
func (c *buildConfigs) Update(buildConfig *v1.BuildConfig) (result *v1.BuildConfig, err error) { | ||
result = &v1.BuildConfig{} | ||
err = c.client.Put(). | ||
Namespace(c.ns). | ||
Resource("buildconfigs"). | ||
Name(buildConfig.Name). | ||
Body(buildConfig). | ||
Do(). | ||
Into(result) | ||
return | ||
} | ||
|
||
// UpdateStatus was generated because the type contains a Status member. | ||
// Add a +genclientstatus=false comment above the type to avoid generating UpdateStatus(). | ||
|
||
func (c *buildConfigs) UpdateStatus(buildConfig *v1.BuildConfig) (result *v1.BuildConfig, err error) { | ||
result = &v1.BuildConfig{} | ||
err = c.client.Put(). | ||
Namespace(c.ns). | ||
Resource("buildconfigs"). | ||
Name(buildConfig.Name). | ||
SubResource("status"). | ||
Body(buildConfig). | ||
Do(). | ||
Into(result) | ||
return | ||
} | ||
|
||
// Delete takes name of the buildConfig and deletes it. Returns an error if one occurs. | ||
func (c *buildConfigs) Delete(name string, options *meta_v1.DeleteOptions) error { | ||
return c.client.Delete(). | ||
Namespace(c.ns). | ||
Resource("buildconfigs"). | ||
Name(name). | ||
Body(options). | ||
Do(). | ||
Error() | ||
} | ||
|
||
// DeleteCollection deletes a collection of objects. | ||
func (c *buildConfigs) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { | ||
return c.client.Delete(). | ||
Namespace(c.ns). | ||
Resource("buildconfigs"). | ||
VersionedParams(&listOptions, scheme.ParameterCodec). | ||
Body(options). | ||
Do(). | ||
Error() | ||
} | ||
|
||
// Get takes name of the buildConfig, and returns the corresponding buildConfig object, and an error if there is any. | ||
func (c *buildConfigs) Get(name string, options meta_v1.GetOptions) (result *v1.BuildConfig, err error) { | ||
result = &v1.BuildConfig{} | ||
err = c.client.Get(). | ||
Namespace(c.ns). | ||
Resource("buildconfigs"). | ||
Name(name). | ||
VersionedParams(&options, scheme.ParameterCodec). | ||
Do(). | ||
Into(result) | ||
return | ||
} | ||
|
||
// List takes label and field selectors, and returns the list of BuildConfigs that match those selectors. | ||
func (c *buildConfigs) List(opts meta_v1.ListOptions) (result *v1.BuildConfigList, err error) { | ||
result = &v1.BuildConfigList{} | ||
err = c.client.Get(). | ||
Namespace(c.ns). | ||
Resource("buildconfigs"). | ||
VersionedParams(&opts, scheme.ParameterCodec). | ||
Do(). | ||
Into(result) | ||
return | ||
} | ||
|
||
// Watch returns a watch.Interface that watches the requested buildConfigs. | ||
func (c *buildConfigs) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { | ||
opts.Watch = true | ||
return c.client.Get(). | ||
Namespace(c.ns). | ||
Resource("buildconfigs"). | ||
VersionedParams(&opts, scheme.ParameterCodec). | ||
Watch() | ||
} | ||
|
||
// Patch applies the patch and returns the patched buildConfig. | ||
func (c *buildConfigs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.BuildConfig, err error) { | ||
result = &v1.BuildConfig{} | ||
err = c.client.Patch(pt). | ||
Namespace(c.ns). | ||
Resource("buildconfigs"). | ||
SubResource(subresources...). | ||
Name(name). | ||
Body(data). | ||
Do(). | ||
Into(result) | ||
return | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
112 changes: 112 additions & 0 deletions
112
pkg/build/generated/clientset/typed/build/v1/fake/fake_buildconfig.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
package fake | ||
|
||
import ( | ||
v1 "github.com/openshift/origin/pkg/build/api/v1" | ||
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
labels "k8s.io/apimachinery/pkg/labels" | ||
schema "k8s.io/apimachinery/pkg/runtime/schema" | ||
types "k8s.io/apimachinery/pkg/types" | ||
watch "k8s.io/apimachinery/pkg/watch" | ||
testing "k8s.io/client-go/testing" | ||
) | ||
|
||
// FakeBuildConfigs implements BuildConfigInterface | ||
type FakeBuildConfigs struct { | ||
Fake *FakeBuildV1 | ||
ns string | ||
} | ||
|
||
var buildconfigsResource = schema.GroupVersionResource{Group: "build.openshift.io", Version: "v1", Resource: "buildconfigs"} | ||
|
||
func (c *FakeBuildConfigs) Create(buildConfig *v1.BuildConfig) (result *v1.BuildConfig, err error) { | ||
obj, err := c.Fake. | ||
Invokes(testing.NewCreateAction(buildconfigsResource, c.ns, buildConfig), &v1.BuildConfig{}) | ||
|
||
if obj == nil { | ||
return nil, err | ||
} | ||
return obj.(*v1.BuildConfig), err | ||
} | ||
|
||
func (c *FakeBuildConfigs) Update(buildConfig *v1.BuildConfig) (result *v1.BuildConfig, err error) { | ||
obj, err := c.Fake. | ||
Invokes(testing.NewUpdateAction(buildconfigsResource, c.ns, buildConfig), &v1.BuildConfig{}) | ||
|
||
if obj == nil { | ||
return nil, err | ||
} | ||
return obj.(*v1.BuildConfig), err | ||
} | ||
|
||
func (c *FakeBuildConfigs) UpdateStatus(buildConfig *v1.BuildConfig) (*v1.BuildConfig, error) { | ||
obj, err := c.Fake. | ||
Invokes(testing.NewUpdateSubresourceAction(buildconfigsResource, "status", c.ns, buildConfig), &v1.BuildConfig{}) | ||
|
||
if obj == nil { | ||
return nil, err | ||
} | ||
return obj.(*v1.BuildConfig), err | ||
} | ||
|
||
func (c *FakeBuildConfigs) Delete(name string, options *meta_v1.DeleteOptions) error { | ||
_, err := c.Fake. | ||
Invokes(testing.NewDeleteAction(buildconfigsResource, c.ns, name), &v1.BuildConfig{}) | ||
|
||
return err | ||
} | ||
|
||
func (c *FakeBuildConfigs) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { | ||
action := testing.NewDeleteCollectionAction(buildconfigsResource, c.ns, listOptions) | ||
|
||
_, err := c.Fake.Invokes(action, &v1.BuildConfigList{}) | ||
return err | ||
} | ||
|
||
func (c *FakeBuildConfigs) Get(name string, options meta_v1.GetOptions) (result *v1.BuildConfig, err error) { | ||
obj, err := c.Fake. | ||
Invokes(testing.NewGetAction(buildconfigsResource, c.ns, name), &v1.BuildConfig{}) | ||
|
||
if obj == nil { | ||
return nil, err | ||
} | ||
return obj.(*v1.BuildConfig), err | ||
} | ||
|
||
func (c *FakeBuildConfigs) List(opts meta_v1.ListOptions) (result *v1.BuildConfigList, err error) { | ||
obj, err := c.Fake. | ||
Invokes(testing.NewListAction(buildconfigsResource, c.ns, opts), &v1.BuildConfigList{}) | ||
|
||
if obj == nil { | ||
return nil, err | ||
} | ||
|
||
label, _, _ := testing.ExtractFromListOptions(opts) | ||
if label == nil { | ||
label = labels.Everything() | ||
} | ||
list := &v1.BuildConfigList{} | ||
for _, item := range obj.(*v1.BuildConfigList).Items { | ||
if label.Matches(labels.Set(item.Labels)) { | ||
list.Items = append(list.Items, item) | ||
} | ||
} | ||
return list, err | ||
} | ||
|
||
// Watch returns a watch.Interface that watches the requested buildConfigs. | ||
func (c *FakeBuildConfigs) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { | ||
return c.Fake. | ||
InvokesWatch(testing.NewWatchAction(buildconfigsResource, c.ns, opts)) | ||
|
||
} | ||
|
||
// Patch applies the patch and returns the patched buildConfig. | ||
func (c *FakeBuildConfigs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.BuildConfig, err error) { | ||
obj, err := c.Fake. | ||
Invokes(testing.NewPatchSubresourceAction(buildconfigsResource, c.ns, name, data, subresources...), &v1.BuildConfig{}) | ||
|
||
if obj == nil { | ||
return nil, err | ||
} | ||
return obj.(*v1.BuildConfig), err | ||
} |
2 changes: 2 additions & 0 deletions
2
pkg/build/generated/clientset/typed/build/v1/generated_expansion.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
package v1 | ||
|
||
type BuildResourceExpansion interface{} | ||
|
||
type BuildConfigExpansion interface{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.