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.

flux.weave.works_client.go 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. v1beta1 "github.com/fluxcd/flux/integrations/apis/flux.weave.works/v1beta1"
  17. "github.com/fluxcd/flux/integrations/client/clientset/versioned/scheme"
  18. serializer "k8s.io/apimachinery/pkg/runtime/serializer"
  19. rest "k8s.io/client-go/rest"
  20. )
  21. type FluxV1beta1Interface interface {
  22. RESTClient() rest.Interface
  23. HelmReleasesGetter
  24. }
  25. // FluxV1beta1Client is used to interact with features provided by the flux.weave.works group.
  26. type FluxV1beta1Client struct {
  27. restClient rest.Interface
  28. }
  29. func (c *FluxV1beta1Client) HelmReleases(namespace string) HelmReleaseInterface {
  30. return newHelmReleases(c, namespace)
  31. }
  32. // NewForConfig creates a new FluxV1beta1Client for the given config.
  33. func NewForConfig(c *rest.Config) (*FluxV1beta1Client, error) {
  34. config := *c
  35. if err := setConfigDefaults(&config); err != nil {
  36. return nil, err
  37. }
  38. client, err := rest.RESTClientFor(&config)
  39. if err != nil {
  40. return nil, err
  41. }
  42. return &FluxV1beta1Client{client}, nil
  43. }
  44. // NewForConfigOrDie creates a new FluxV1beta1Client for the given config and
  45. // panics if there is an error in the config.
  46. func NewForConfigOrDie(c *rest.Config) *FluxV1beta1Client {
  47. client, err := NewForConfig(c)
  48. if err != nil {
  49. panic(err)
  50. }
  51. return client
  52. }
  53. // New creates a new FluxV1beta1Client for the given RESTClient.
  54. func New(c rest.Interface) *FluxV1beta1Client {
  55. return &FluxV1beta1Client{c}
  56. }
  57. func setConfigDefaults(config *rest.Config) error {
  58. gv := v1beta1.SchemeGroupVersion
  59. config.GroupVersion = &gv
  60. config.APIPath = "/apis"
  61. config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs}
  62. if config.UserAgent == "" {
  63. config.UserAgent = rest.DefaultKubernetesUserAgent()
  64. }
  65. return nil
  66. }
  67. // RESTClient returns a RESTClient that is used to communicate
  68. // with API server by this client implementation.
  69. func (c *FluxV1beta1Client) RESTClient() rest.Interface {
  70. if c == nil {
  71. return nil
  72. }
  73. return c.restClient
  74. }