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.

helmrelease.go 6.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  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 v1beta1
  15. import (
  16. "time"
  17. v1beta1 "github.com/fluxcd/flux/integrations/apis/flux.weave.works/v1beta1"
  18. scheme "github.com/fluxcd/flux/integrations/client/clientset/versioned/scheme"
  19. v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
  20. types "k8s.io/apimachinery/pkg/types"
  21. watch "k8s.io/apimachinery/pkg/watch"
  22. rest "k8s.io/client-go/rest"
  23. )
  24. // HelmReleasesGetter has a method to return a HelmReleaseInterface.
  25. // A group's client should implement this interface.
  26. type HelmReleasesGetter interface {
  27. HelmReleases(namespace string) HelmReleaseInterface
  28. }
  29. // HelmReleaseInterface has methods to work with HelmRelease resources.
  30. type HelmReleaseInterface interface {
  31. Create(*v1beta1.HelmRelease) (*v1beta1.HelmRelease, error)
  32. Update(*v1beta1.HelmRelease) (*v1beta1.HelmRelease, error)
  33. UpdateStatus(*v1beta1.HelmRelease) (*v1beta1.HelmRelease, error)
  34. Delete(name string, options *v1.DeleteOptions) error
  35. DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
  36. Get(name string, options v1.GetOptions) (*v1beta1.HelmRelease, error)
  37. List(opts v1.ListOptions) (*v1beta1.HelmReleaseList, error)
  38. Watch(opts v1.ListOptions) (watch.Interface, error)
  39. Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.HelmRelease, err error)
  40. HelmReleaseExpansion
  41. }
  42. // helmReleases implements HelmReleaseInterface
  43. type helmReleases struct {
  44. client rest.Interface
  45. ns string
  46. }
  47. // newHelmReleases returns a HelmReleases
  48. func newHelmReleases(c *FluxV1beta1Client, namespace string) *helmReleases {
  49. return &helmReleases{
  50. client: c.RESTClient(),
  51. ns: namespace,
  52. }
  53. }
  54. // Get takes name of the helmRelease, and returns the corresponding helmRelease object, and an error if there is any.
  55. func (c *helmReleases) Get(name string, options v1.GetOptions) (result *v1beta1.HelmRelease, err error) {
  56. result = &v1beta1.HelmRelease{}
  57. err = c.client.Get().
  58. Namespace(c.ns).
  59. Resource("helmreleases").
  60. Name(name).
  61. VersionedParams(&options, scheme.ParameterCodec).
  62. Do().
  63. Into(result)
  64. return
  65. }
  66. // List takes label and field selectors, and returns the list of HelmReleases that match those selectors.
  67. func (c *helmReleases) List(opts v1.ListOptions) (result *v1beta1.HelmReleaseList, err error) {
  68. var timeout time.Duration
  69. if opts.TimeoutSeconds != nil {
  70. timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
  71. }
  72. result = &v1beta1.HelmReleaseList{}
  73. err = c.client.Get().
  74. Namespace(c.ns).
  75. Resource("helmreleases").
  76. VersionedParams(&opts, scheme.ParameterCodec).
  77. Timeout(timeout).
  78. Do().
  79. Into(result)
  80. return
  81. }
  82. // Watch returns a watch.Interface that watches the requested helmReleases.
  83. func (c *helmReleases) Watch(opts v1.ListOptions) (watch.Interface, error) {
  84. var timeout time.Duration
  85. if opts.TimeoutSeconds != nil {
  86. timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
  87. }
  88. opts.Watch = true
  89. return c.client.Get().
  90. Namespace(c.ns).
  91. Resource("helmreleases").
  92. VersionedParams(&opts, scheme.ParameterCodec).
  93. Timeout(timeout).
  94. Watch()
  95. }
  96. // 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.
  97. func (c *helmReleases) Create(helmRelease *v1beta1.HelmRelease) (result *v1beta1.HelmRelease, err error) {
  98. result = &v1beta1.HelmRelease{}
  99. err = c.client.Post().
  100. Namespace(c.ns).
  101. Resource("helmreleases").
  102. Body(helmRelease).
  103. Do().
  104. Into(result)
  105. return
  106. }
  107. // 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.
  108. func (c *helmReleases) Update(helmRelease *v1beta1.HelmRelease) (result *v1beta1.HelmRelease, err error) {
  109. result = &v1beta1.HelmRelease{}
  110. err = c.client.Put().
  111. Namespace(c.ns).
  112. Resource("helmreleases").
  113. Name(helmRelease.Name).
  114. Body(helmRelease).
  115. Do().
  116. Into(result)
  117. return
  118. }
  119. // UpdateStatus was generated because the type contains a Status member.
  120. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
  121. func (c *helmReleases) UpdateStatus(helmRelease *v1beta1.HelmRelease) (result *v1beta1.HelmRelease, err error) {
  122. result = &v1beta1.HelmRelease{}
  123. err = c.client.Put().
  124. Namespace(c.ns).
  125. Resource("helmreleases").
  126. Name(helmRelease.Name).
  127. SubResource("status").
  128. Body(helmRelease).
  129. Do().
  130. Into(result)
  131. return
  132. }
  133. // Delete takes name of the helmRelease and deletes it. Returns an error if one occurs.
  134. func (c *helmReleases) Delete(name string, options *v1.DeleteOptions) error {
  135. return c.client.Delete().
  136. Namespace(c.ns).
  137. Resource("helmreleases").
  138. Name(name).
  139. Body(options).
  140. Do().
  141. Error()
  142. }
  143. // DeleteCollection deletes a collection of objects.
  144. func (c *helmReleases) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
  145. var timeout time.Duration
  146. if listOptions.TimeoutSeconds != nil {
  147. timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
  148. }
  149. return c.client.Delete().
  150. Namespace(c.ns).
  151. Resource("helmreleases").
  152. VersionedParams(&listOptions, scheme.ParameterCodec).
  153. Timeout(timeout).
  154. Body(options).
  155. Do().
  156. Error()
  157. }
  158. // Patch applies the patch and returns the patched helmRelease.
  159. func (c *helmReleases) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.HelmRelease, err error) {
  160. result = &v1beta1.HelmRelease{}
  161. err = c.client.Patch(pt).
  162. Namespace(c.ns).
  163. Resource("helmreleases").
  164. SubResource(subresources...).
  165. Name(name).
  166. Body(data).
  167. Do().
  168. Into(result)
  169. return
  170. }