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.

clientset.go 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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 versioned
  15. import (
  16. fluxv1beta1 "github.com/fluxcd/flux/integrations/client/clientset/versioned/typed/flux.weave.works/v1beta1"
  17. helmv1alpha2 "github.com/fluxcd/flux/integrations/client/clientset/versioned/typed/helm.integrations.flux.weave.works/v1alpha2"
  18. discovery "k8s.io/client-go/discovery"
  19. rest "k8s.io/client-go/rest"
  20. flowcontrol "k8s.io/client-go/util/flowcontrol"
  21. )
  22. type Interface interface {
  23. Discovery() discovery.DiscoveryInterface
  24. FluxV1beta1() fluxv1beta1.FluxV1beta1Interface
  25. HelmV1alpha2() helmv1alpha2.HelmV1alpha2Interface
  26. }
  27. // Clientset contains the clients for groups. Each group has exactly one
  28. // version included in a Clientset.
  29. type Clientset struct {
  30. *discovery.DiscoveryClient
  31. fluxV1beta1 *fluxv1beta1.FluxV1beta1Client
  32. helmV1alpha2 *helmv1alpha2.HelmV1alpha2Client
  33. }
  34. // FluxV1beta1 retrieves the FluxV1beta1Client
  35. func (c *Clientset) FluxV1beta1() fluxv1beta1.FluxV1beta1Interface {
  36. return c.fluxV1beta1
  37. }
  38. // HelmV1alpha2 retrieves the HelmV1alpha2Client
  39. func (c *Clientset) HelmV1alpha2() helmv1alpha2.HelmV1alpha2Interface {
  40. return c.helmV1alpha2
  41. }
  42. // Discovery retrieves the DiscoveryClient
  43. func (c *Clientset) Discovery() discovery.DiscoveryInterface {
  44. if c == nil {
  45. return nil
  46. }
  47. return c.DiscoveryClient
  48. }
  49. // NewForConfig creates a new Clientset for the given config.
  50. func NewForConfig(c *rest.Config) (*Clientset, error) {
  51. configShallowCopy := *c
  52. if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 {
  53. configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst)
  54. }
  55. var cs Clientset
  56. var err error
  57. cs.fluxV1beta1, err = fluxv1beta1.NewForConfig(&configShallowCopy)
  58. if err != nil {
  59. return nil, err
  60. }
  61. cs.helmV1alpha2, err = helmv1alpha2.NewForConfig(&configShallowCopy)
  62. if err != nil {
  63. return nil, err
  64. }
  65. cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy)
  66. if err != nil {
  67. return nil, err
  68. }
  69. return &cs, nil
  70. }
  71. // NewForConfigOrDie creates a new Clientset for the given config and
  72. // panics if there is an error in the config.
  73. func NewForConfigOrDie(c *rest.Config) *Clientset {
  74. var cs Clientset
  75. cs.fluxV1beta1 = fluxv1beta1.NewForConfigOrDie(c)
  76. cs.helmV1alpha2 = helmv1alpha2.NewForConfigOrDie(c)
  77. cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
  78. return &cs
  79. }
  80. // New creates a new Clientset for the given RESTClient.
  81. func New(c rest.Interface) *Clientset {
  82. var cs Clientset
  83. cs.fluxV1beta1 = fluxv1beta1.New(c)
  84. cs.helmV1alpha2 = helmv1alpha2.New(c)
  85. cs.DiscoveryClient = discovery.NewDiscoveryClient(c)
  86. return &cs
  87. }