Skip to content

Commit 8f5d917

Browse files
Saas 7098 - renamed venona to runner (#145)
1 parent 0008d03 commit 8f5d917

File tree

14 files changed

+33
-26
lines changed

14 files changed

+33
-26
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ venonactl/dist/*
1717
venonactl-linux
1818
venonalog.json
1919
.venonaconf
20+
.runnerconf
2021
.cover
2122
configdir

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "venona",
3-
"version": "1.3.4",
3+
"version": "1.3.5",
44

55
"description": "Codefresh agent to run on Codefresh's runtime environment and execute pipeline",
66
"main": "index.js",

venonactl/VERSION

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
1.3.4
2-
1+
1.3.5

venonactl/cmd/attach.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ limitations under the License.
1717
*/
1818

1919
import (
20+
"fmt"
21+
2022
"github.com/codefresh-io/venona/venonactl/pkg/plugins"
2123
"github.com/codefresh-io/venona/venonactl/pkg/store"
2224
"github.com/spf13/cobra"
@@ -63,7 +65,9 @@ var attachRuntimeCmd = &cobra.Command{
6365
attachRuntimeCmdOptions.kubeVenona.context = attachRuntimeCmdOptions.kube.context
6466
}
6567

66-
attachRuntimeCmdOptions.kube.serviceAccount = "venona"
68+
if attachRuntimeCmdOptions.kube.serviceAccount == "" {
69+
attachRuntimeCmdOptions.kube.serviceAccount = s.AppName
70+
}
6771

6872
if attachRuntimeCmdOptions.kube.kubePath == "" {
6973
attachRuntimeCmdOptions.kube.kubePath = kubeConfigPath
@@ -116,6 +120,7 @@ func init() {
116120
attachRuntimeCmd.Flags().StringVar(&attachRuntimeCmdOptions.kube.namespace, "kube-namespace", viper.GetString("kube-namespace"), "Name of the namespace on which venona should be installed [$KUBE_NAMESPACE]")
117121
attachRuntimeCmd.Flags().StringVar(&attachRuntimeCmdOptions.kube.context, "kube-context-name", viper.GetString("kube-context"), "Name of the kubernetes context on which venona should be installed (default is current-context) [$KUBE_CONTEXT]")
118122
attachRuntimeCmd.Flags().StringVar(&attachRuntimeCmdOptions.kube.kubePath, "kube-config-path", viper.GetString("kubeconfig"), "Path to kubeconfig file (default is $HOME/.kube/config) [$KUBECONFIG]")
123+
attachRuntimeCmd.Flags().StringVar(&attachRuntimeCmdOptions.kube.serviceAccount, "kube-service-account", viper.GetString("kube-service-account"), fmt.Sprintf("Name of the kubernetes service account (default is %s)", plugins.AppName))
119124

120125
attachRuntimeCmd.Flags().StringVar(&attachRuntimeCmdOptions.runtimeEnvironmentName, "runtime-name", viper.GetString("runtime-name"), "Name of the runtime as in codefresh")
121126

venonactl/go.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk
7777
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
7878
github.com/codefresh-io/go-sdk v0.18.0 h1:tSP1m89l66qQ2PF5NvuUCL5dCorxQUGhyq7lyRKv35Q=
7979
github.com/codefresh-io/go-sdk v0.18.0/go.mod h1:b6hK9euSW+MDXUDHU1+YgP8vzcij749I31ZIZSXed+I=
80+
github.com/codefresh-io/venona v1.0.2 h1:fpQ2y4/DLgW8q/RNrrkc4aISvIIyXHT0jcr5F3eiSYs=
8081
github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko=
8182
github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw=
8283
github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=

venonactl/pkg/plugins/plugin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const (
1717
MonitorAgentPluginType = "monitor-agent"
1818
VolumeProvisionerPluginType = "volume-provisioner"
1919
EnginePluginType = "engine"
20-
DefaultStorageClassNamePrefix = "dind-local-volumes-venona"
20+
DefaultStorageClassNamePrefix = "dind-local-volumes-runner"
2121
RuntimeAttachType = "runtime-attach"
2222
)
2323

venonactl/pkg/plugins/runtime-attach.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ type venonaConf struct {
3131

3232
const (
3333
runtimeAttachFilesPattern = ".*.runtime-attach.yaml"
34-
runtimeSecretName = "venonaconf"
34+
runtimeSecretName = "runnerconf"
3535
)
3636

3737
func buildRuntimeConfig(opt *InstallOptions, v Values) (RuntimeConfiguration, error) {
@@ -114,7 +114,7 @@ func (u *runtimeAttachPlugin) Install(opt *InstallOptions, v Values) (Values, er
114114
// read current venona conf
115115
currentVenonaConf, err := readCurrentVenonaConf(opt.AgentKubeBuilder, opt.ClusterNamespace)
116116
if err != nil {
117-
u.logger.Error(fmt.Sprintf("Cannot read venonaconf: %v ", err))
117+
u.logger.Error(fmt.Sprintf("Cannot read runnerconf: %v ", err))
118118
return nil, err
119119
}
120120

@@ -135,13 +135,13 @@ func (u *runtimeAttachPlugin) Install(opt *InstallOptions, v Values) (Values, er
135135
// marshel prior persist
136136
d, err := yaml.Marshal(runtime)
137137
if err != nil {
138-
u.logger.Error(fmt.Sprintf("Cannot marshal merged venonaconf: %v ", err))
138+
u.logger.Error(fmt.Sprintf("Cannot marshal merged runnerconf: %v ", err))
139139
return nil, err
140140
}
141141

142142
runtimes[name] = base64.StdEncoding.EncodeToString([]byte(d))
143143
}
144-
v["venonaConf"] = runtimes
144+
v["runnerConf"] = runtimes
145145

146146
cs.CoreV1().Secrets(opt.ClusterNamespace).Delete(runtimeSecretName, &metav1.DeleteOptions{})
147147

@@ -223,12 +223,12 @@ func (u *runtimeAttachPlugin) Delete(deleteOpt *DeleteOptions, v Values) error {
223223
u.logger.Error(fmt.Sprintf("Cannot create kubernetes clientset: %v ", err))
224224
return err
225225
}
226-
// Delete the entry from venonaconf - if this is the only , delete the secret
226+
// Delete the entry from runnerconf - if this is the only , delete the secret
227227

228228
// read current venona conf
229229
currentVenonaConf, err := readCurrentVenonaConf(deleteOpt.AgentKubeBuilder, deleteOpt.AgentNamespace)
230230
if err != nil {
231-
u.logger.Error(fmt.Sprintf("Cannot read venonaconf: %v ", err))
231+
u.logger.Error(fmt.Sprintf("Cannot read runnerconf: %v ", err))
232232
return err
233233
}
234234
name := strings.ReplaceAll(deleteOpt.RuntimeEnvironment, "/", ".")
@@ -246,15 +246,15 @@ func (u *runtimeAttachPlugin) Delete(deleteOpt *DeleteOptions, v Values) error {
246246
// marshel prior persist
247247
d, err := yaml.Marshal(runtime)
248248
if err != nil {
249-
u.logger.Error(fmt.Sprintf("Cannot marshal merged venonaconf: %v ", err))
249+
u.logger.Error(fmt.Sprintf("Cannot marshal merged runnerconf: %v ", err))
250250
return err
251251
}
252252

253253
runtimes[name] = base64.StdEncoding.EncodeToString([]byte(d))
254254
}
255255

256256
shouldDelete = false
257-
v["venonaConf"] = runtimes
257+
v["runnerConf"] = runtimes
258258

259259
cs.CoreV1().Secrets(deleteOpt.AgentNamespace).Delete(runtimeSecretName, &metav1.DeleteOptions{})
260260

venonactl/pkg/plugins/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ package plugins
1717

1818
const (
1919
// AppName - app name for config
20-
AppName = "venona"
20+
AppName = "runner"
2121

2222
// TypeKubernetesDind - name for Kubernetes Dind runtimectl
2323
TypeKubernetesDind = "kubernetesDind"

venonactl/pkg/plugins/venona.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ func (u *venonaPlugin) Migrate(opt *MigrateOptions, v Values) error {
226226
u.logger.Error(fmt.Sprintf("Cannot create kubernetes clientset: %v ", err))
227227
return err
228228
}
229-
229+
v["AppName"] = "venona" // use old app name for migration
230230
kubeObjects, err := getKubeObjectsFromTempalte(v, venonaFilesPattern, u.logger)
231231
if err != nil {
232232
return err

venonactl/pkg/store/store.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ package store
22

33
import (
44
"fmt"
5+
56
"github.com/codefresh-io/go-sdk/pkg/codefresh"
67
"github.com/codefresh-io/venona/venonactl/pkg/certs"
78
)
89

910
const (
1011
ModeInCluster = "InCluster"
11-
ApplicationName = "venona"
12+
ApplicationName = "runner"
1213
MonitorApplicationName = "monitor"
1314
)
1415

0 commit comments

Comments
 (0)