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_helmrelease.go 5.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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. v1beta1 "github.com/fluxcd/flux/integrations/apis/flux.weave.works/v1beta1"
  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. // FakeHelmReleases implements HelmReleaseInterface
  25. type FakeHelmReleases struct {
  26. Fake *FakeFluxV1beta1
  27. ns string
  28. }
  29. var helmreleasesResource = schema.GroupVersionResource{Group: "flux.weave.works", Version: "v1beta1", Resource: "helmreleases"}
  30. var helmreleasesKind = schema.GroupVersionKind{Group: "flux.weave.works", Version: "v1beta1", Kind: "HelmRelease"}
  31. // Get takes name of the helmRelease, and returns the corresponding helmRelease object, and an error if there is any.
  32. func (c *FakeHelmReleases) Get(name string, options v1.GetOptions) (result *v1beta1.HelmRelease, err error) {
  33. obj, err := c.Fake.
  34. Invokes(testing.NewGetAction(helmreleasesResource, c.ns, name), &v1beta1.HelmRelease{})
  35. if obj == nil {
  36. return nil, err
  37. }
  38. return obj.(*v1beta1.HelmRelease), err
  39. }
  40. // List takes label and field selectors, and returns the list of HelmReleases that match those selectors.
  41. func (c *FakeHelmReleases) List(opts v1.ListOptions) (result *v1beta1.HelmReleaseList, err error) {
  42. obj, err := c.Fake.
  43. Invokes(testing.NewListAction(helmreleasesResource, helmreleasesKind, c.ns, opts), &v1beta1.HelmReleaseList{})
  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 := &v1beta1.HelmReleaseList{ListMeta: obj.(*v1beta1.HelmReleaseList).ListMeta}
  52. for _, item := range obj.(*v1beta1.HelmReleaseList).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 helmReleases.
  60. func (c *FakeHelmReleases) Watch(opts v1.ListOptions) (watch.Interface, error) {
  61. return c.Fake.
  62. InvokesWatch(testing.NewWatchAction(helmreleasesResource, c.ns, opts))
  63. }
  64. // Create takes the representation of a helmRelease and creates it. Returns the server's representation of the helmRelease, and an error, if there is any.
  65. func (c *FakeHelmReleases) Create(helmRelease *v1beta1.HelmRelease) (result *v1beta1.HelmRelease, err error) {
  66. obj, err := c.Fake.
  67. Invokes(testing.NewCreateAction(helmreleasesResource, c.ns, helmRelease), &v1beta1.HelmRelease{})
  68. if obj == nil {
  69. return nil, err
  70. }
  71. return obj.(*v1beta1.HelmRelease), err
  72. }
  73. // Update takes the representation of a helmRelease and updates it. Returns the server's representation of the helmRelease, and an error, if there is any.
  74. func (c *FakeHelmReleases) Update(helmRelease *v1beta1.HelmRelease) (result *v1beta1.HelmRelease, err error) {
  75. obj, err := c.Fake.
  76. Invokes(testing.NewUpdateAction(helmreleasesResource, c.ns, helmRelease), &v1beta1.HelmRelease{})
  77. if obj == nil {
  78. return nil, err
  79. }
  80. return obj.(*v1beta1.HelmRelease), err
  81. }
  82. // UpdateStatus was generated because the type contains a Status member.
  83. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
  84. func (c *FakeHelmReleases) UpdateStatus(helmRelease *v1beta1.HelmRelease) (*v1beta1.HelmRelease, error) {
  85. obj, err := c.Fake.
  86. Invokes(testing.NewUpdateSubresourceAction(helmreleasesResource, "status", c.ns, helmRelease), &v1beta1.HelmRelease{})
  87. if obj == nil {
  88. return nil, err
  89. }
  90. return obj.(*v1beta1.HelmRelease), err
  91. }
  92. // Delete takes name of the helmRelease and deletes it. Returns an error if one occurs.
  93. func (c *FakeHelmReleases) Delete(name string, options *v1.DeleteOptions) error {
  94. _, err := c.Fake.
  95. Invokes(testing.NewDeleteAction(helmreleasesResource, c.ns, name), &v1beta1.HelmRelease{})
  96. return err
  97. }
  98. // DeleteCollection deletes a collection of objects.
  99. func (c *FakeHelmReleases) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
  100. action := testing.NewDeleteCollectionAction(helmreleasesResource, c.ns, listOptions)
  101. _, err := c.Fake.Invokes(action, &v1beta1.HelmReleaseList{})
  102. return err
  103. }
  104. // Patch applies the patch and returns the patched helmRelease.
  105. func (c *FakeHelmReleases) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.HelmRelease, err error) {
  106. obj, err := c.Fake.
  107. Invokes(testing.NewPatchSubresourceAction(helmreleasesResource, c.ns, name, pt, data, subresources...), &v1beta1.HelmRelease{})
  108. if obj == nil {
  109. return nil, err
  110. }
  111. return obj.(*v1beta1.HelmRelease), err
  112. }