Skip to content

Commit 5b3684a

Browse files
author
Oleg Sucharevich
authored
replace @ char in context name (#89)
1 parent 53a6651 commit 5b3684a

File tree

4 files changed

+12
-14
lines changed

4 files changed

+12
-14
lines changed

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.0.0",
3+
"version": "1.0.1",
44
"description": "Codefresh agent to run on Codefresh's runtime environment and execute pipeline",
55
"main": "index.js",
66
"scripts": {

venonactl/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.0
1+
1.0.1

venonactl/go.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk
2727
github.com/codefresh-io/go-sdk v0.17.0 h1:0fwE4K0QeqM2VfyjiALzkH2se4HbLh9BiQCuzQnJH/U=
2828
github.com/codefresh-io/go-sdk v0.17.0/go.mod h1:b6hK9euSW+MDXUDHU1+YgP8vzcij749I31ZIZSXed+I=
2929
github.com/codefresh-io/venona v0.30.2 h1:FgLNURnChYvamwBVdfQDthIRdfaOb0Zyvc2EdnajaPQ=
30+
github.com/codefresh-io/venona v1.0.0 h1:w8fxc2+kKiTPYpHH5AFAyyDtefcnNKtlW8sHAP9Gvvo=
3031
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
3132
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
3233
github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=

venonactl/pkg/plugins/runtime-attach.go

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ func (u *runtimeAttachPlugin) Install(opt *InstallOptions, v Values) (Values, er
117117
}
118118
// normalize the key in the secret to make sure we are not violating kube naming conventions
119119
name := strings.ReplaceAll(opt.RuntimeEnvironment, "/", ".")
120+
name = strings.ReplaceAll(name, "@", ".")
120121
currentVenonaConf.Runtimes[fmt.Sprintf("%s.runtime.yaml", name)] = rc
121122
runtimes := map[string]string{}
122123
for name, runtime := range currentVenonaConf.Runtimes {
@@ -201,17 +202,16 @@ func (u *runtimeAttachPlugin) Delete(deleteOpt *DeleteOptions, v Values) error {
201202
u.logger.Error(fmt.Sprintf("Cannot read venonaconf: %v ", err))
202203
return err
203204
}
204-
name := strings.ReplaceAll(deleteOpt.RuntimeEnvironment , "/", ".")
205+
name := strings.ReplaceAll(deleteOpt.RuntimeEnvironment, "/", ".")
205206
name = fmt.Sprintf("%s.runtime.yaml", name)
206207
if _, ok := currentVenonaConf.Runtimes[name]; ok {
207-
delete(currentVenonaConf.Runtimes, name)
208+
delete(currentVenonaConf.Runtimes, name)
208209
}
209210

210-
211-
// If only one runtime is defined, remove the secret , otherwise remove the entry and persist
211+
// If only one runtime is defined, remove the secret , otherwise remove the entry and persist
212212
shouldDelete := true
213213
if len(currentVenonaConf.Runtimes) > 0 {
214-
214+
215215
runtimes := map[string]string{}
216216
for name, runtime := range currentVenonaConf.Runtimes {
217217
// marshel prior persist
@@ -220,15 +220,14 @@ func (u *runtimeAttachPlugin) Delete(deleteOpt *DeleteOptions, v Values) error {
220220
u.logger.Error(fmt.Sprintf("Cannot marshal merged venonaconf: %v ", err))
221221
return err
222222
}
223-
223+
224224
runtimes[name] = base64.StdEncoding.EncodeToString([]byte(d))
225225
}
226-
227226

228227
shouldDelete = false
229228
v["venonaConf"] = runtimes
230229

231-
cs.CoreV1().Secrets(deleteOpt.AgentNamespace).Delete(runtimeSecretName, &metav1.DeleteOptions{})
230+
cs.CoreV1().Secrets(deleteOpt.AgentNamespace).Delete(runtimeSecretName, &metav1.DeleteOptions{})
232231

233232
err = install(&installOptions{
234233
logger: u.logger,
@@ -243,9 +242,7 @@ func (u *runtimeAttachPlugin) Delete(deleteOpt *DeleteOptions, v Values) error {
243242

244243
}
245244

246-
247-
248-
if shouldDelete {
245+
if shouldDelete {
249246
opt := &deleteOptions{
250247
templates: templates.TemplatesMap(),
251248
templateValues: v,
@@ -258,7 +255,7 @@ func (u *runtimeAttachPlugin) Delete(deleteOpt *DeleteOptions, v Values) error {
258255
return uninstall(opt)
259256
}
260257
return nil
261-
258+
262259
}
263260

264261
func (u *runtimeAttachPlugin) Upgrade(_ *UpgradeOptions, v Values) (Values, error) {

0 commit comments

Comments
 (0)