GitOps for k8s
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

fake_fluxhelmrelease.go 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /*
  2. Copyright 2018 Weaveworks Ltd.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. // Code generated by client-gen. DO NOT EDIT.
  14. package fake
  15. import (
  16. v1alpha2 "github.com/fluxcd/flux/integrations/apis/helm.integrations.flux.weave.works/v1alpha2"
  17. v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
  18. labels "k8s.io/apimachinery/pkg/labels"
  19. schema "k8s.io/apimachinery/pkg/runtime/schema"
  20. types "k8s.io/apimachinery/pkg/types"
  21. watch "k8s.io/apimachinery/pkg/watch"
  22. testing "k8s.io/client-go/testing"
  23. )
  24. // FakeFluxHelmReleases implements FluxHelmReleaseInterface
  25. type FakeFluxHelmReleases struct {
  26. Fake *FakeHelmV1alpha2
  27. ns string
  28. }
  29. var fluxhelmreleasesResource = schema.GroupVersionResource{Group: "helm.integrations.flux.weave.works", Version: "v1alpha2", Resource: "fluxhelmreleases"}
  30. var fluxhelmreleasesKind = schema.GroupVersionKind{Group: "helm.integrations.flux.weave.works", Version: "v1alpha2", Kind: "FluxHelmRelease"}
  31. // Get takes name of the fluxHelmRelease, and returns the corresponding fluxHelmRelease object, and an error if there is any.
  32. func (c *FakeFluxHelmReleases) Get(name string, options v1.GetOptions) (result *v1alpha2.FluxHelmRelease, err error) {
  33. obj, err := c.Fake.
  34. Invokes(testing.NewGetAction(fluxhelmreleasesResource, c.ns, name), &v1alpha2.FluxHelmRelease{})
  35. if obj == nil {
  36. return nil, err
  37. }
  38. return obj.(*v1alpha2.FluxHelmRelease), err
  39. }
  40. // List takes label and field selectors, and returns the list of FluxHelmReleases that match those selectors.
  41. func (c *FakeFluxHelmReleases) List(opts v1.ListOptions) (result *v1alpha2.FluxHelmReleaseList, err error) {
  42. obj, err := c.Fake.
  43. Invokes(testing.NewListAction(fluxhelmreleasesResource, fluxhelmreleasesKind, c.ns, opts), &v1alpha2.FluxHelmReleaseList{})
  44. if obj == nil {
  45. return nil, err
  46. }
  47. label, _, _ := testing.ExtractFromListOptions(opts)
  48. if label == nil {
  49. label = labels.Everything()
  50. }
  51. list := &v1alpha2.FluxHelmReleaseList{ListMeta: obj.(*v1alpha2.FluxHelmReleaseList).ListMeta}
  52. for _, item := range obj.(*v1alpha2.FluxHelmReleaseList).Items {
  53. if label.Matches(labels.Set(item.Labels)) {
  54. list.Items = append(list.Items, item)
  55. }
  56. }
  57. return list, err
  58. }
  59. // Watch returns a watch.Interface that watches the requested fluxHelmReleases.
  60. func (c *FakeFluxHelmReleases) Watch(opts v1.ListOptions) (watch.Interface, error) {
  61. return c.Fake.
  62. InvokesWatch(testing.NewWatchAction(fluxhelmreleasesResource, c.ns, opts))
  63. }
  64. // Create takes the representation of a fluxHelmRelease and creates it. Returns the server's representation of the fluxHelmRelease, and an error, if there is any.
  65. func (c *FakeFluxHelmReleases) Create(fluxHelmRelease *v1alpha2.FluxHelmRelease) (result *v1alpha2.FluxHelmRelease, err error) {
  66. obj, err := c.Fake.
  67. Invokes(testing.NewCreateAction(fluxhelmreleasesResource, c.ns, fluxHelmRelease), &v1alpha2.FluxHelmRelease{})
  68. if obj == nil {
  69. return nil, err
  70. }
  71. return obj.(*v1alpha2.FluxHelmRelease), err
  72. }
  73. // Update takes the representation of a fluxHelmRelease and updates it. Returns the server's representation of the fluxHelmRelease, and an error, if there is any.
  74. func (c *FakeFluxHelmReleases) Update(fluxHelmRelease *v1alpha2.FluxHelmRelease) (result *v1alpha2.FluxHelmRelease, err error) {
  75. obj, err := c.Fake.
  76. Invokes(testing.NewUpdateAction(fluxhelmreleasesResource, c.ns, fluxHelmRelease), &v1alpha2.FluxHelmRelease{})
  77. if obj == nil {
  78. return nil, err
  79. }
  80. return obj.(*v1alpha2.FluxHelmRelease), err
  81. }
  82. // Delete takes name of the fluxHelmRelease and deletes it. Returns an error if one occurs.
  83. func (c *FakeFluxHelmReleases) Delete(name string, options *v1.DeleteOptions) error {
  84. _, err := c.Fake.
  85. Invokes(testing.NewDeleteAction(fluxhelmreleasesResource, c.ns, name), &v1alpha2.FluxHelmRelease{})
  86. return err
  87. }
  88. // DeleteCollection deletes a collection of objects.
  89. func (c *FakeFluxHelmReleases) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
  90. action := testing.NewDeleteCollectionAction(fluxhelmreleasesResource, c.ns, listOptions)
  91. _, err := c.Fake.Invokes(action, &v1alpha2.FluxHelmReleaseList{})
  92. return err
  93. }
  94. // Patch applies the patch and returns the patched fluxHelmRelease.
  95. func (c *FakeFluxHelmReleases) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha2.FluxHelmRelease, err error) {
  96. obj, err := c.Fake.
  97. Invokes(testing.NewPatchSubresourceAction(fluxhelmreleasesResource, c.ns, name, pt, data, subresources...), &v1alpha2.FluxHelmRelease{})
  98. if obj == nil {
  99. return nil, err
  100. }
  101. return obj.(*v1alpha2.FluxHelmRelease), err
  102. }