context.go 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. Copyright 2016 The Rook Authors. All rights reserved.
  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. package clusterd
  14. import (
  15. netclient "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/client/clientset/versioned/typed/k8s.cni.cncf.io/v1"
  16. rookclient "github.com/rook/rook/pkg/client/clientset/versioned"
  17. "github.com/rook/rook/pkg/util/exec"
  18. "github.com/rook/rook/pkg/util/sys"
  19. apiextensionsclient "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
  20. "k8s.io/client-go/kubernetes"
  21. "k8s.io/client-go/rest"
  22. "sigs.k8s.io/controller-runtime/pkg/client"
  23. )
  24. // Context for loading or applying the configuration state of a service.
  25. type Context struct {
  26. // The kubernetes config used for this context
  27. KubeConfig *rest.Config
  28. // Clientset is a connection to the core kubernetes API
  29. Clientset kubernetes.Interface
  30. // Represents the Client provided by the controller-runtime package to interact with Kubernetes objects
  31. Client client.Client
  32. // RookClientset is a typed connection to the rook API
  33. RookClientset rookclient.Interface
  34. // ApiExtensionsClient is a typed connection to the CRD API extensions
  35. ApiExtensionsClient apiextensionsclient.Interface
  36. // The implementation of executing a console command
  37. Executor exec.Executor
  38. // The implementation of executing remotely a console command to a given pod
  39. RemoteExecutor exec.RemotePodCommandExecutor
  40. // The root configuration directory used by services
  41. ConfigDir string
  42. // The full path to a config file that can be used to override generated settings
  43. ConfigFileOverride string
  44. // NetworkClient is a connection to the CNI plugin API
  45. NetworkClient netclient.K8sCniCncfIoV1Interface
  46. // The local devices detected on the node
  47. Devices []*sys.LocalDisk
  48. }