Skip to content

Commit

Permalink
Update dependencies and other maintenance (#382)
Browse files Browse the repository at this point in the history
- Bump versions exercised in Helm upgrade test.
- Update dependencies and consolidate some dependencies. For example, we
  had two YAML parsers with similar APIs that were being imported.
- Remove usage of deprecated ioutil functions.
- Reorganize imports according to Golang conventions, and use consistent
  import aliases for packages.
- Remove code related to obsolete Tiller operator.
  • Loading branch information
adriansuarez authored Nov 14, 2024
1 parent e155921 commit ac7dfdd
Show file tree
Hide file tree
Showing 62 changed files with 396 additions and 549 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ go 1.21
toolchain go1.21.6

require (
github.com/Masterminds/semver v1.5.0
github.com/Masterminds/semver/v3 v3.3.0
github.com/ghodss/yaml v1.0.0
github.com/google/go-cmp v0.6.0
github.com/gruntwork-io/terratest v0.46.8
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
github.com/otiai10/copy v1.14.0
github.com/stretchr/testify v1.8.4
gopkg.in/yaml.v3 v3.0.1
k8s.io/api v0.29.0
k8s.io/apimachinery v0.29.0
)
Expand Down Expand Up @@ -68,6 +67,7 @@ require (
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/client-go v0.29.0 // indirect
k8s.io/klog/v2 v2.110.1 // indirect
k8s.io/kube-openapi v0.0.0-20231214164306-ab13479f8bf8 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww=
github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
github.com/Masterminds/semver/v3 v3.3.0 h1:B8LGeaivUe71a5qox1ICM/JLl0NqZSW5CHyL+hmvYS0=
github.com/Masterminds/semver/v3 v3.3.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/aws/aws-sdk-go v1.49.12 h1:SbGHDdMjtuTL8zpRXKjvIvQHLt9cCqcxcHoJps23WxI=
Expand Down
2 changes: 0 additions & 2 deletions incubator/cloudbeaver/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,3 @@ maintainers:
engine: gotpl
icon: https://raw.githubusercontent.com/nuodb/nuodb-helm-charts/master/images/nuodb.svg
appVersion: 22.1.4
tillerVersion: ">=2.9"

1 change: 0 additions & 1 deletion incubator/demo-ycsb/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ maintainers:
engine: gotpl
icon: https://raw.githubusercontent.com/nuodb/nuodb-helm-charts/master/images/nuodb.svg
appVersion: "6.0"
tillerVersion: ">=2.9"
5 changes: 0 additions & 5 deletions scripts/ci/install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,7 @@ elif [[ "$REQUIRES_MINISHIFT" == "true" ]]; then
oc status

kubectl cluster-info

kubectl -n kube-system create serviceaccount tiller-system
kubectl create clusterrolebinding tiller-system --clusterrole cluster-admin --serviceaccount=kube-system:tiller-system

helm version

kubectl version

# disable THP to match minikube
Expand Down
1 change: 0 additions & 1 deletion stable/admin/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ maintainers:
engine: gotpl
icon: https://raw.githubusercontent.com/nuodb/nuodb-helm-charts/master/images/nuodb.svg
appVersion: "6.0"
tillerVersion: ">=2.9"
1 change: 0 additions & 1 deletion stable/database/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ maintainers:
engine: gotpl
icon: https://raw.githubusercontent.com/nuodb/nuodb-helm-charts/master/images/nuodb.svg
appVersion: "6.0"
tillerVersion: ">=2.9"
1 change: 0 additions & 1 deletion stable/restore/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ maintainers:
engine: gotpl
icon: https://raw.githubusercontent.com/nuodb/nuodb-helm-charts/master/images/nuodb.svg
appVersion: "6.0"
tillerVersion: ">=2.9"
1 change: 0 additions & 1 deletion stable/storage-class/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ maintainers:
engine: gotpl
icon: https://raw.githubusercontent.com/nuodb/nuodb-helm-charts/master/images/nuodb.svg
appVersion: "6.0"
tillerVersion: ">=2.9"
1 change: 0 additions & 1 deletion stable/transparent-hugepage/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ maintainers:
engine: gotpl
icon: https://raw.githubusercontent.com/nuodb/nuodb-helm-charts/master/images/nuodb.svg
appVersion: "6.0"
tillerVersion: ">=2.9"
8 changes: 4 additions & 4 deletions test/integration/database_marshall_test.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package integration

import (
"github.com/nuodb/nuodb-helm-charts/v3/test/testlib"
"testing"

"github.com/stretchr/testify/assert"

"testing"
"github.com/nuodb/nuodb-helm-charts/v3/test/testlib"
)

func TestDatabaseUnmarshal(t *testing.T) {
s := (
`{
s := (`{
"incarnation": {
"major": 1,
"minor": 2
Expand Down
43 changes: 26 additions & 17 deletions test/integration/kube_config_marshall_test.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package integration

import (
"github.com/nuodb/nuodb-helm-charts/v3/test/testlib"
"os"
"testing"

"github.com/stretchr/testify/assert"

"io/ioutil"
"testing"
"github.com/nuodb/nuodb-helm-charts/v3/test/testlib"
)


func TestKubeConfigUnmarshall(t *testing.T) {
content, err := ioutil.ReadFile("../files/nuodb-dump.json")
content, err := os.ReadFile("../files/nuodb-dump.json")
assert.NoError(t, err)

err, objects := testlib.UnmarshalNuoDBKubeConfig(string(content))
Expand All @@ -26,27 +26,36 @@ func TestKubeConfigUnmarshall(t *testing.T) {
assert.True(t, len(config.Volumes) == 3)

// StatefulSets
assert.True(t, func() bool {_, ok := config.StatefulSets["admin-u7mxhy-nuodb-cluster0"]; return ok}())
assert.True(t, func() bool {_, ok := config.StatefulSets["sm-database-vslldk-nuodb-cluster0-demo"]; return ok}())
assert.True(t, func() bool {_, ok := config.StatefulSets["sm-database-vslldk-nuodb-cluster0-demo-hotcopy"]; return ok}())
assert.True(t, func() bool { _, ok := config.StatefulSets["admin-u7mxhy-nuodb-cluster0"]; return ok }())
assert.True(t, func() bool { _, ok := config.StatefulSets["sm-database-vslldk-nuodb-cluster0-demo"]; return ok }())
assert.True(t, func() bool { _, ok := config.StatefulSets["sm-database-vslldk-nuodb-cluster0-demo-hotcopy"]; return ok }())

// Deployments
assert.True(t, func() bool {_, ok := config.Deployments["te-database-vslldk-nuodb-cluster0-demo"]; return ok}())
assert.True(t, func() bool { _, ok := config.Deployments["te-database-vslldk-nuodb-cluster0-demo"]; return ok }())

// Admin Volumes
assert.True(t, func() bool {_, ok := config.Volumes["raftlog-admin-u7mxhy-nuodb-cluster0-0"]; return ok}())
assert.True(t, func() bool { _, ok := config.Volumes["raftlog-admin-u7mxhy-nuodb-cluster0-0"]; return ok }())

// DB Volumes
assert.True(t, func() bool {_, ok := config.Volumes["archive-volume-sm-database-vslldk-nuodb-cluster0-demo-hotcopy-0"]; return ok}())
assert.True(t, func() bool {_, ok := config.Volumes["backup-volume-sm-database-vslldk-nuodb-cluster0-demo-hotcopy-0"]; return ok}())
assert.True(t, func() bool {
_, ok := config.Volumes["archive-volume-sm-database-vslldk-nuodb-cluster0-demo-hotcopy-0"]
return ok
}())
assert.True(t, func() bool {
_, ok := config.Volumes["backup-volume-sm-database-vslldk-nuodb-cluster0-demo-hotcopy-0"]
return ok
}())

// Admin Pods
assert.True(t, func() bool {_, ok := config.Pods["admin-u7mxhy-nuodb-cluster0-0"]; return ok}())
assert.True(t, func() bool {_, ok := config.Pods["job-lb-policy-nearest-zs9jl"]; return ok}())
assert.True(t, func() bool { _, ok := config.Pods["admin-u7mxhy-nuodb-cluster0-0"]; return ok }())
assert.True(t, func() bool { _, ok := config.Pods["job-lb-policy-nearest-zs9jl"]; return ok }())

// DB Pods
assert.True(t, func() bool {_, ok := config.Pods["sm-database-vslldk-nuodb-cluster0-demo-hotcopy-0"]; return ok}())
assert.True(t, func() bool {_, ok := config.Pods["hotcopy-demo-job-initial-549rc"]; return ok}())
assert.True(t, func() bool {_, ok := config.Pods["te-database-vslldk-nuodb-cluster0-demo-65c4cdf487-wbzj9"]; return ok}())
assert.True(t, func() bool { _, ok := config.Pods["sm-database-vslldk-nuodb-cluster0-demo-hotcopy-0"]; return ok }())
assert.True(t, func() bool { _, ok := config.Pods["hotcopy-demo-job-initial-549rc"]; return ok }())
assert.True(t, func() bool {
_, ok := config.Pods["te-database-vslldk-nuodb-cluster0-demo-65c4cdf487-wbzj9"]
return ok
}())

}
4 changes: 2 additions & 2 deletions test/integration/process_marshall_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package integration

import (
"encoding/json"
"testing"

"github.com/nuodb/nuodb-helm-charts/v3/test/testlib"
"github.com/stretchr/testify/assert"

"testing"
"github.com/nuodb/nuodb-helm-charts/v3/test/testlib"
)

func TestUnmarshall(t *testing.T) {
Expand Down
11 changes: 5 additions & 6 deletions test/integration/registry_entry_marshall_test.go
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
package integration

import (
"github.com/nuodb/nuodb-helm-charts/v3/test/testlib"
"testing"

"github.com/stretchr/testify/assert"

"testing"
"github.com/nuodb/nuodb-helm-charts/v3/test/testlib"
)

func TestRegistryEntryUnmarshal(t *testing.T) {
s := (
`nuodb:
s := (`nuodb:
image:
registry: local
repository: master
tag: latest
`)

err, object := testlib.UnmarshalImageYAML(s)

object, err := testlib.UnmarshalImageYAML(s)
assert.NoError(t, err)

assert.True(t, object.Nuodb.Image.Registry == "local")
Expand Down
3 changes: 2 additions & 1 deletion test/integration/shell_scripts_lint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ import (
"regexp"
"testing"

"github.com/nuodb/nuodb-helm-charts/v3/test/testlib"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/nuodb/nuodb-helm-charts/v3/test/testlib"
)

const shebangPattern = "[#][!][ \t]*.+[/ ](sh|bash)"
Expand Down
Loading

0 comments on commit ac7dfdd

Please sign in to comment.