1 /* Copyright 2019 The ELIOT Authors.
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
7 http://www.apache.org/licenses/LICENSE-2.0
9 Unless required by applicable law or agreed to in writing, software
10 distributed under the License is distributed on an "AS IS" BASIS,
11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 See the License for the specific language governing permissions and
13 limitations under the License.
19 //Setup having option.
27 // InitOptions Strucutre
28 type InitOptions struct {
29 KubernetesVersion string
31 K8SImageRepository string
32 K8SPodNetworkCidr string
35 //JoinOptions has the kubeedge cloud init information filled by CLI
36 type JoinOptions struct {
40 K8SAPIServerIPPort string
44 //InstallState enum set used for verifying a tool version is installed in host
45 type InstallState uint8
47 //Difference enum values for type InstallState
49 NewInstallRequired InstallState = iota
50 AlreadySameVersionExist
55 //ModuleRunning is defined to know the running status of KubeEdge components
56 type ModuleRunning uint8
58 //Different possible values for ModuleRunning type
60 NoneRunning ModuleRunning = iota
65 //ToolsInstaller interface for tools with install and teardown methods.
66 type ToolsInstaller interface {
71 //OSTypeInstaller interface for methods to be executed over a specified OS distribution type
72 type OSTypeInstaller interface {
73 IsToolVerInRepo(string, string) (bool, error)
74 IsDockerInstalled(string) (InstallState, error)
76 IsK8SComponentInstalled(string, string) (InstallState, error)
78 StartK8Scluster() error
79 SetDockerVersion(string)
80 SetK8SVersionAndIsNodeFlag(version string, flag bool)
81 SetK8SImageRepoAndPodNetworkCidr(string, string)
84 //FlagData stores value and default value of the flags used in this command
85 type FlagData struct {