@@ -19,32 +19,32 @@ limitations under the License.
19
19
import (
20
20
"fmt"
21
21
22
- "github.com/codefresh-io/venona/venonactl/pkg/store"
23
- "github.com/codefresh-io/venona/venonactl/pkg/plugins"
24
22
"github.com/codefresh-io/venona/venonactl/pkg/logger"
23
+ "github.com/codefresh-io/venona/venonactl/pkg/plugins"
24
+ "github.com/codefresh-io/venona/venonactl/pkg/store"
25
25
"github.com/spf13/cobra"
26
26
"github.com/spf13/viper"
27
27
)
28
28
29
29
var installAgentCmdOptions struct {
30
- dryRun bool
31
- kube struct {
30
+ dryRun bool
31
+ kube struct {
32
32
namespace string
33
33
inCluster bool
34
34
context string
35
35
nodeSelector string
36
36
}
37
- venona struct {
37
+ venona struct {
38
38
version string
39
39
}
40
- agentToken string
41
- agentID string
42
- kubernetesRunnerType bool
43
- tolerations string
40
+ agentToken string
41
+ agentID string
42
+ kubernetesRunnerType bool
43
+ tolerations string
44
44
}
45
45
46
46
var installAgentCmd = & cobra.Command {
47
- Use : "agent" ,
47
+ Use : "agent" ,
48
48
Short : "Install Codefresh's agent " ,
49
49
Run : func (cmd * cobra.Command , args []string ) {
50
50
s := store .GetStore ()
@@ -59,7 +59,7 @@ var installAgentCmd = &cobra.Command{
59
59
cfAPIHost = "https://g.codefresh.io"
60
60
}
61
61
builderInstallOpt := & plugins.InstallOptions {
62
- CodefreshHost : cfAPIHost ,
62
+ CodefreshHost : cfAPIHost ,
63
63
}
64
64
65
65
if installAgentCmdOptions .agentToken == "" {
@@ -93,10 +93,8 @@ var installAgentCmd = &cobra.Command{
93
93
version := installAgentCmdOptions .venona .version
94
94
lgr .Info ("Version set manually" , "version" , version )
95
95
s .Image .Tag = version
96
- s .Version .Latest .Version = version
97
96
}
98
97
99
-
100
98
kns , err := parseNodeSelector (installAgentCmdOptions .kube .nodeSelector )
101
99
if err != nil {
102
100
dieOnError (err )
@@ -107,7 +105,6 @@ var installAgentCmd = &cobra.Command{
107
105
builderInstallOpt .KubeBuilder = getKubeClientBuilder (builderInstallOpt .ClusterName , s .KubernetesAPI .Namespace , s .KubernetesAPI .ConfigPath , s .KubernetesAPI .InCluster )
108
106
builderInstallOpt .ClusterNamespace = s .KubernetesAPI .Namespace
109
107
110
-
111
108
builder .Add (plugins .VenonaPluginType )
112
109
113
110
values := s .BuildValues ()
@@ -120,10 +117,9 @@ var installAgentCmd = &cobra.Command{
120
117
lgr .Info ("Agent installation completed Successfully" )
121
118
122
119
},
123
-
124
120
}
125
121
126
- func init () {
122
+ func init () {
127
123
installCommand .AddCommand (installAgentCmd )
128
124
129
125
viper .BindEnv ("kube-namespace" , "KUBE_NAMESPACE" )
@@ -141,12 +137,10 @@ func init() {
141
137
installAgentCmd .Flags ().BoolVar (& installAgentCmdOptions .kubernetesRunnerType , "kubernetes-runner-type" , false , "Set the runner type to kubernetes (alpha feature)" )
142
138
}
143
139
144
-
145
-
146
- func fillCodefreshAPI (logger logger.Logger ) {
140
+ func fillCodefreshAPI (logger logger.Logger ) {
147
141
s := store .GetStore ()
148
142
s .CodefreshAPI = & store.CodefreshAPI {
149
- Host : cfAPIHost ,
143
+ Host : cfAPIHost ,
150
144
}
151
-
152
- }
145
+
146
+ }
0 commit comments