2016-11-05 17:09:05 -07:00
|
|
|
/*
|
|
|
|
|
Copyright 2016 The Rook Authors. All rights reserved.
|
|
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
|
limitations under the License.
|
|
|
|
|
*/
|
2020-04-17 18:40:54 +02:00
|
|
|
|
2016-09-15 08:00:43 -07:00
|
|
|
package clusterd
|
|
|
|
|
|
|
|
|
|
import (
|
2020-04-01 09:58:04 +02:00
|
|
|
netclient "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/client/clientset/versioned/typed/k8s.cni.cncf.io/v1"
|
2017-12-04 08:37:39 -08:00
|
|
|
rookclient "github.com/rook/rook/pkg/client/clientset/versioned"
|
2016-10-26 00:38:39 +02:00
|
|
|
"github.com/rook/rook/pkg/util/exec"
|
2018-04-05 18:39:20 +00:00
|
|
|
"github.com/rook/rook/pkg/util/sys"
|
2023-05-22 20:37:19 +05:30
|
|
|
apiextensionsclient "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
|
2017-07-24 07:43:11 -07:00
|
|
|
"k8s.io/client-go/kubernetes"
|
2019-06-05 10:23:07 +03:00
|
|
|
"k8s.io/client-go/rest"
|
2020-04-17 18:40:54 +02:00
|
|
|
"sigs.k8s.io/controller-runtime/pkg/client"
|
2016-09-15 08:00:43 -07:00
|
|
|
)
|
|
|
|
|
|
2019-06-05 10:23:07 +03:00
|
|
|
// Context for loading or applying the configuration state of a service.
|
2016-09-15 08:00:43 -07:00
|
|
|
type Context struct {
|
2019-06-05 10:23:07 +03:00
|
|
|
// The kubernetes config used for this context
|
|
|
|
|
KubeConfig *rest.Config
|
|
|
|
|
|
2017-07-24 07:43:11 -07:00
|
|
|
// Clientset is a connection to the core kubernetes API
|
|
|
|
|
Clientset kubernetes.Interface
|
|
|
|
|
|
2020-04-17 18:40:54 +02:00
|
|
|
// Represents the Client provided by the controller-runtime package to interact with Kubernetes objects
|
|
|
|
|
Client client.Client
|
|
|
|
|
|
2017-12-04 08:37:39 -08:00
|
|
|
// RookClientset is a typed connection to the rook API
|
|
|
|
|
RookClientset rookclient.Interface
|
|
|
|
|
|
2023-05-22 20:37:19 +05:30
|
|
|
// ApiExtensionsClient is a typed connection to the CRD API extensions
|
|
|
|
|
ApiExtensionsClient apiextensionsclient.Interface
|
|
|
|
|
|
2016-09-15 08:00:43 -07:00
|
|
|
// The implementation of executing a console command
|
2016-10-12 09:04:07 -07:00
|
|
|
Executor exec.Executor
|
2016-09-15 08:00:43 -07:00
|
|
|
|
2021-07-06 23:27:15 +02:00
|
|
|
// The implementation of executing remotely a console command to a given pod
|
|
|
|
|
RemoteExecutor exec.RemotePodCommandExecutor
|
|
|
|
|
|
2016-10-14 14:41:15 -07:00
|
|
|
// The root configuration directory used by services
|
|
|
|
|
ConfigDir string
|
2016-10-26 09:48:25 -07:00
|
|
|
|
2017-01-04 09:01:47 -08:00
|
|
|
// The full path to a config file that can be used to override generated settings
|
|
|
|
|
ConfigFileOverride string
|
2017-01-30 21:13:05 -08:00
|
|
|
|
2020-04-01 09:58:04 +02:00
|
|
|
// NetworkClient is a connection to the CNI plugin API
|
|
|
|
|
NetworkClient netclient.K8sCniCncfIoV1Interface
|
|
|
|
|
|
2017-10-17 09:33:37 -07:00
|
|
|
// The local devices detected on the node
|
2018-04-05 18:39:20 +00:00
|
|
|
Devices []*sys.LocalDisk
|
2016-09-15 08:00:43 -07:00
|
|
|
}
|