mirror of
https://github.com/helm/helm.git
synced 2026-05-28 04:35:48 -04:00
added sprintf solution and found other possible overflow occurences
Signed-off-by: Trenton VanderWert <trenton.vanderwert@gmail.com>
This commit is contained in:
parent
4a45342887
commit
ab640a7177
2 changed files with 6 additions and 4 deletions
|
|
@ -18,6 +18,7 @@ package driver // import "helm.sh/helm/v3/pkg/storage/driver"
|
|||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
|
@ -160,7 +161,7 @@ func (cfgmaps *ConfigMaps) Create(key string, rls *rspb.Release) error {
|
|||
|
||||
lbs.init()
|
||||
lbs.fromMap(rls.Labels)
|
||||
lbs.set("createdAt", strconv.Itoa(int(time.Now().Unix())))
|
||||
lbs.set("createdAt", fmt.Sprintf("%v", time.Now().Unix()))
|
||||
|
||||
// create a new configmap to hold the release
|
||||
obj, err := newConfigMapsObject(key, rls, lbs)
|
||||
|
|
@ -188,7 +189,7 @@ func (cfgmaps *ConfigMaps) Update(key string, rls *rspb.Release) error {
|
|||
|
||||
lbs.init()
|
||||
lbs.fromMap(rls.Labels)
|
||||
lbs.set("modifiedAt", strconv.Itoa(int(time.Now().Unix())))
|
||||
lbs.set("modifiedAt", fmt.Sprintf("%v", time.Now().Unix()))
|
||||
|
||||
// create a new configmap object to hold the release
|
||||
obj, err := newConfigMapsObject(key, rls, lbs)
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ package driver // import "helm.sh/helm/v3/pkg/storage/driver"
|
|||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
|
@ -151,7 +152,7 @@ func (secrets *Secrets) Create(key string, rls *rspb.Release) error {
|
|||
|
||||
lbs.init()
|
||||
lbs.fromMap(rls.Labels)
|
||||
lbs.set("createdAt", strconv.Itoa(int(time.Now().Unix())))
|
||||
lbs.set("createdAt", fmt.Sprintf("%v", time.Now().Unix()))
|
||||
|
||||
// create a new secret to hold the release
|
||||
obj, err := newSecretsObject(key, rls, lbs)
|
||||
|
|
@ -177,7 +178,7 @@ func (secrets *Secrets) Update(key string, rls *rspb.Release) error {
|
|||
|
||||
lbs.init()
|
||||
lbs.fromMap(rls.Labels)
|
||||
lbs.set("modifiedAt", strconv.FormatInt(time.Now().Unix(), 10))
|
||||
lbs.set("modifiedAt", fmt.Sprintf("%v", time.Now().Unix()))
|
||||
|
||||
// create a new secret object to hold the release
|
||||
obj, err := newSecretsObject(key, rls, lbs)
|
||||
|
|
|
|||
Loading…
Reference in a new issue