mirror of https://github.com/dapr/cli.git
Upgrade linter to 1.49.0 (#1051)
* Upgrade linter to 1.49.0 Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com> * fix linter error Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com> Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
This commit is contained in:
parent
eaca34bc0d
commit
65855d5aa0
|
|
@ -30,7 +30,7 @@ jobs:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
env:
|
env:
|
||||||
GOVER: 1.18
|
GOVER: 1.18
|
||||||
GOLANG_CI_LINT_VER: v1.46.2
|
GOLANG_CI_LINT_VER: v1.49.0
|
||||||
GOOS: ${{ matrix.target_os }}
|
GOOS: ${{ matrix.target_os }}
|
||||||
GOARCH: ${{ matrix.target_arch }}
|
GOARCH: ${{ matrix.target_arch }}
|
||||||
GOPROXY: https://proxy.golang.org
|
GOPROXY: https://proxy.golang.org
|
||||||
|
|
@ -65,11 +65,10 @@ jobs:
|
||||||
uses: golangci/golangci-lint-action@v3.2.0
|
uses: golangci/golangci-lint-action@v3.2.0
|
||||||
with:
|
with:
|
||||||
version: ${{ env.GOLANG_CI_LINT_VER }}
|
version: ${{ env.GOLANG_CI_LINT_VER }}
|
||||||
only-new-issues: true
|
|
||||||
skip-cache: true
|
skip-cache: true
|
||||||
- name: Run make go.mod check-diff
|
- name: Run make modtidy check-diff
|
||||||
if: matrix.target_arch == 'amd64' && matrix.target_os == 'linux'
|
if: matrix.target_arch == 'amd64' && matrix.target_os == 'linux'
|
||||||
run: make go.mod check-diff
|
run: make modtidy check-diff
|
||||||
- name: Parse release version and set REL_VERSION
|
- name: Parse release version and set REL_VERSION
|
||||||
run: python ./.github/scripts/get_release_version.py
|
run: python ./.github/scripts/get_release_version.py
|
||||||
- name: Setup test output
|
- name: Setup test output
|
||||||
|
|
|
||||||
|
|
@ -260,4 +260,5 @@ linters:
|
||||||
- varnamelen
|
- varnamelen
|
||||||
- forcetypeassert
|
- forcetypeassert
|
||||||
- ireturn
|
- ireturn
|
||||||
- golint
|
- golint
|
||||||
|
- nosnakecase
|
||||||
6
Makefile
6
Makefile
|
|
@ -184,10 +184,10 @@ test-e2e-sh: test-deps
|
||||||
e2e-build-run-sh: build test-e2e-sh
|
e2e-build-run-sh: build test-e2e-sh
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Target: go.mod #
|
# Target: modtidy #
|
||||||
################################################################################
|
################################################################################
|
||||||
.PHONY: go.mod
|
.PHONY: modtidy
|
||||||
go.mod:
|
modtidy:
|
||||||
go mod tidy -compat=1.18
|
go mod tidy -compat=1.18
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,7 @@ WARNING: If an app id is not provided, we will generate one using the format '<n
|
||||||
if annotateTargetResource != "" {
|
if annotateTargetResource != "" {
|
||||||
config = kubernetes.K8sAnnotatorConfig{
|
config = kubernetes.K8sAnnotatorConfig{
|
||||||
TargetResource: &annotateTargetResource,
|
TargetResource: &annotateTargetResource,
|
||||||
} // nolint:exhaustivestruct
|
} //nolint:exhaustivestruct
|
||||||
if annotateTargetNamespace != "" {
|
if annotateTargetNamespace != "" {
|
||||||
config.TargetNamespace = &annotateTargetNamespace
|
config.TargetNamespace = &annotateTargetNamespace
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -160,7 +160,7 @@ func (p *K8sAnnotator) processInput(input io.Reader, out io.Writer, opts Annotat
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
items = append(items, runtime.RawExtension{Raw: annotatedJSON}) // nolint:exhaustivestruct
|
items = append(items, runtime.RawExtension{Raw: annotatedJSON}) //nolint:exhaustivestruct
|
||||||
}
|
}
|
||||||
sourceList.Items = items
|
sourceList.Items = items
|
||||||
result, err = yaml.Marshal(sourceList)
|
result, err = yaml.Marshal(sourceList)
|
||||||
|
|
@ -235,7 +235,7 @@ func (p *K8sAnnotator) annotateYAML(input []byte, config AnnotateOptions) ([]byt
|
||||||
kind := strings.ToLower(metaType.Kind)
|
kind := strings.ToLower(metaType.Kind)
|
||||||
switch kind {
|
switch kind {
|
||||||
case pod:
|
case pod:
|
||||||
pod := &corev1.Pod{} // nolint:exhaustivestruct
|
pod := &corev1.Pod{} //nolint:exhaustivestruct
|
||||||
if err := yaml.Unmarshal(input, pod); err != nil {
|
if err := yaml.Unmarshal(input, pod); err != nil {
|
||||||
return nil, false, err
|
return nil, false, err
|
||||||
}
|
}
|
||||||
|
|
@ -244,7 +244,7 @@ func (p *K8sAnnotator) annotateYAML(input []byte, config AnnotateOptions) ([]byt
|
||||||
path = podAnnotationsPath
|
path = podAnnotationsPath
|
||||||
ns = getNamespaceOrDefault(pod)
|
ns = getNamespaceOrDefault(pod)
|
||||||
case cronjob:
|
case cronjob:
|
||||||
cronjob := &batchv1beta1.CronJob{} // nolint:exhaustivestruct
|
cronjob := &batchv1beta1.CronJob{} //nolint:exhaustivestruct
|
||||||
if err := yaml.Unmarshal(input, cronjob); err != nil {
|
if err := yaml.Unmarshal(input, cronjob); err != nil {
|
||||||
return nil, false, err
|
return nil, false, err
|
||||||
}
|
}
|
||||||
|
|
@ -253,7 +253,7 @@ func (p *K8sAnnotator) annotateYAML(input []byte, config AnnotateOptions) ([]byt
|
||||||
path = cronjobAnnotationsPath
|
path = cronjobAnnotationsPath
|
||||||
ns = getNamespaceOrDefault(cronjob)
|
ns = getNamespaceOrDefault(cronjob)
|
||||||
case deployment:
|
case deployment:
|
||||||
deployment := &appsv1.Deployment{} // nolint:exhaustivestruct
|
deployment := &appsv1.Deployment{} //nolint:exhaustivestruct
|
||||||
if err := yaml.Unmarshal(input, deployment); err != nil {
|
if err := yaml.Unmarshal(input, deployment); err != nil {
|
||||||
return nil, false, err
|
return nil, false, err
|
||||||
}
|
}
|
||||||
|
|
@ -262,7 +262,7 @@ func (p *K8sAnnotator) annotateYAML(input []byte, config AnnotateOptions) ([]byt
|
||||||
path = templateAnnotationsPath
|
path = templateAnnotationsPath
|
||||||
ns = getNamespaceOrDefault(deployment)
|
ns = getNamespaceOrDefault(deployment)
|
||||||
case replicaset:
|
case replicaset:
|
||||||
replicaset := &appsv1.ReplicaSet{} // nolint:exhaustivestruct
|
replicaset := &appsv1.ReplicaSet{} //nolint:exhaustivestruct
|
||||||
if err := yaml.Unmarshal(input, replicaset); err != nil {
|
if err := yaml.Unmarshal(input, replicaset); err != nil {
|
||||||
return nil, false, err
|
return nil, false, err
|
||||||
}
|
}
|
||||||
|
|
@ -271,7 +271,7 @@ func (p *K8sAnnotator) annotateYAML(input []byte, config AnnotateOptions) ([]byt
|
||||||
path = templateAnnotationsPath
|
path = templateAnnotationsPath
|
||||||
ns = getNamespaceOrDefault(replicaset)
|
ns = getNamespaceOrDefault(replicaset)
|
||||||
case job:
|
case job:
|
||||||
job := &batchv1.Job{} // nolint:exhaustivestruct
|
job := &batchv1.Job{} //nolint:exhaustivestruct
|
||||||
if err := yaml.Unmarshal(input, job); err != nil {
|
if err := yaml.Unmarshal(input, job); err != nil {
|
||||||
return nil, false, err
|
return nil, false, err
|
||||||
}
|
}
|
||||||
|
|
@ -280,7 +280,7 @@ func (p *K8sAnnotator) annotateYAML(input []byte, config AnnotateOptions) ([]byt
|
||||||
path = templateAnnotationsPath
|
path = templateAnnotationsPath
|
||||||
ns = getNamespaceOrDefault(job)
|
ns = getNamespaceOrDefault(job)
|
||||||
case statefulset:
|
case statefulset:
|
||||||
statefulset := &appsv1.StatefulSet{} // nolint:exhaustivestruct
|
statefulset := &appsv1.StatefulSet{} //nolint:exhaustivestruct
|
||||||
if err := yaml.Unmarshal(input, statefulset); err != nil {
|
if err := yaml.Unmarshal(input, statefulset); err != nil {
|
||||||
return nil, false, err
|
return nil, false, err
|
||||||
}
|
}
|
||||||
|
|
@ -289,7 +289,7 @@ func (p *K8sAnnotator) annotateYAML(input []byte, config AnnotateOptions) ([]byt
|
||||||
path = templateAnnotationsPath
|
path = templateAnnotationsPath
|
||||||
ns = getNamespaceOrDefault(statefulset)
|
ns = getNamespaceOrDefault(statefulset)
|
||||||
case daemonset:
|
case daemonset:
|
||||||
daemonset := &appsv1.DaemonSet{} // nolint:exhaustivestruct
|
daemonset := &appsv1.DaemonSet{} //nolint:exhaustivestruct
|
||||||
if err := yaml.Unmarshal(input, daemonset); err != nil {
|
if err := yaml.Unmarshal(input, daemonset); err != nil {
|
||||||
return nil, false, err
|
return nil, false, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ type AnnotateOptions struct {
|
||||||
type AnnoteOption func(*AnnotateOptions)
|
type AnnoteOption func(*AnnotateOptions)
|
||||||
|
|
||||||
func NewAnnotateOptions(opts ...AnnoteOption) AnnotateOptions {
|
func NewAnnotateOptions(opts ...AnnoteOption) AnnotateOptions {
|
||||||
config := AnnotateOptions{} // nolint:exhaustivestruct
|
config := AnnotateOptions{} //nolint:exhaustivestruct
|
||||||
for _, opt := range opts {
|
for _, opt := range opts {
|
||||||
opt(&config)
|
opt(&config)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ type annotation struct {
|
||||||
optionFactory func() AnnotateOptions
|
optionFactory func() AnnotateOptions
|
||||||
}
|
}
|
||||||
|
|
||||||
// nolint
|
//nolint:maintidx
|
||||||
func TestAnnotate(t *testing.T) {
|
func TestAnnotate(t *testing.T) {
|
||||||
// Helper function used to order test documents.
|
// Helper function used to order test documents.
|
||||||
sortDocs := func(docs []string) {
|
sortDocs := func(docs []string) {
|
||||||
|
|
|
||||||
|
|
@ -59,9 +59,7 @@ func Init(config InitConfiguration) error {
|
||||||
|
|
||||||
stopSpinning := print.Spinner(os.Stdout, msg)
|
stopSpinning := print.Spinner(os.Stdout, msg)
|
||||||
defer stopSpinning(print.Failure)
|
defer stopSpinning(print.Failure)
|
||||||
// nolint
|
if err := install(config); err != nil {
|
||||||
err := install(config)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ import (
|
||||||
|
|
||||||
const (
|
const (
|
||||||
systemConfigName = "daprsystem"
|
systemConfigName = "daprsystem"
|
||||||
trustBundleSecretName = "dapr-trust-bundle" // nolint:gosec
|
trustBundleSecretName = "dapr-trust-bundle" //nolint:gosec
|
||||||
warningDaysForCertExpiry = 30 // in days.
|
warningDaysForCertExpiry = 30 // in days.
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,7 @@ func applyCRDs(version string) error {
|
||||||
for _, crd := range crds {
|
for _, crd := range crds {
|
||||||
url := fmt.Sprintf("https://raw.githubusercontent.com/dapr/dapr/%s/charts/dapr/crds/%s.yaml", version, crd)
|
url := fmt.Sprintf("https://raw.githubusercontent.com/dapr/dapr/%s/charts/dapr/crds/%s.yaml", version, crd)
|
||||||
|
|
||||||
resp, _ := http.Get(url) // nolint:gosec
|
resp, _ := http.Get(url) //nolint:gosec
|
||||||
if resp != nil && resp.StatusCode == 200 {
|
if resp != nil && resp.StatusCode == 200 {
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -189,7 +189,7 @@ func (meta *DaprMeta) portExists(port int) bool {
|
||||||
if port <= 0 {
|
if port <= 0 {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
// nolint
|
//nolint
|
||||||
_, ok := meta.ExistingPorts[port]
|
_, ok := meta.ExistingPorts[port]
|
||||||
if ok {
|
if ok {
|
||||||
return true
|
return true
|
||||||
|
|
@ -344,7 +344,7 @@ func getAppCommand(config *RunConfig) *exec.Cmd {
|
||||||
}
|
}
|
||||||
|
|
||||||
func Run(config *RunConfig) (*RunOutput, error) {
|
func Run(config *RunConfig) (*RunOutput, error) {
|
||||||
// nolint
|
//nolint
|
||||||
err := config.validate()
|
err := config.validate()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
@ -355,7 +355,7 @@ func Run(config *RunConfig) (*RunOutput, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// nolint
|
//nolint
|
||||||
var appCMD *exec.Cmd = getAppCommand(config)
|
var appCMD *exec.Cmd = getAppCommand(config)
|
||||||
return &RunOutput{
|
return &RunOutput{
|
||||||
DaprCMD: daprCMD,
|
DaprCMD: daprCMD,
|
||||||
|
|
|
||||||
|
|
@ -696,7 +696,7 @@ func createSlimConfiguration(wg *sync.WaitGroup, errorChan chan<- error, info in
|
||||||
func makeDefaultComponentsDir() error {
|
func makeDefaultComponentsDir() error {
|
||||||
// Make default components directory.
|
// Make default components directory.
|
||||||
componentsDir := DefaultComponentsDirPath()
|
componentsDir := DefaultComponentsDirPath()
|
||||||
// nolint
|
//nolint
|
||||||
_, err := os.Stat(componentsDir)
|
_, err := os.Stat(componentsDir)
|
||||||
if os.IsNotExist(err) {
|
if os.IsNotExist(err) {
|
||||||
errDir := os.MkdirAll(componentsDir, 0o755)
|
errDir := os.MkdirAll(componentsDir, 0o755)
|
||||||
|
|
@ -821,7 +821,7 @@ func untar(reader io.Reader, targetDir string, binaryFilePrefix string) (string,
|
||||||
foundBinary := ""
|
foundBinary := ""
|
||||||
for {
|
for {
|
||||||
header, err := tr.Next()
|
header, err := tr.Next()
|
||||||
// nolint
|
//nolint
|
||||||
if err == io.EOF {
|
if err == io.EOF {
|
||||||
break
|
break
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
|
|
@ -1068,7 +1068,7 @@ func downloadFile(dir string, url string) (string, error) {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
req, err := http.NewRequest("GET", url, nil)
|
req, err := http.NewRequest(http.MethodGet, url, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
@ -1080,9 +1080,9 @@ func downloadFile(dir string, url string) (string, error) {
|
||||||
|
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
||||||
if resp.StatusCode == 404 {
|
if resp.StatusCode == http.StatusNotFound {
|
||||||
return "", fmt.Errorf("version not found from url: %s", url)
|
return "", fmt.Errorf("version not found from url: %s", url)
|
||||||
} else if resp.StatusCode != 200 {
|
} else if resp.StatusCode != http.StatusOK {
|
||||||
return "", fmt.Errorf("download failed with %d", resp.StatusCode)
|
return "", fmt.Errorf("download failed with %d", resp.StatusCode)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ import (
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/dapr/cli/utils"
|
"github.com/dapr/cli/utils"
|
||||||
)
|
)
|
||||||
|
|
@ -48,7 +49,8 @@ func getTestServer(expectedPath, resp string) (*httptest.Server, int) {
|
||||||
|
|
||||||
func getTestSocketServerFunc(handler http.Handler, appID, path string) (*http.Server, net.Listener) {
|
func getTestSocketServerFunc(handler http.Handler, appID, path string) (*http.Server, net.Listener) {
|
||||||
s := &http.Server{
|
s := &http.Server{
|
||||||
Handler: handler,
|
Handler: handler,
|
||||||
|
ReadHeaderTimeout: time.Duration(5) * time.Second,
|
||||||
}
|
}
|
||||||
|
|
||||||
socket := utils.GetSocket(path, appID, "http")
|
socket := utils.GetSocket(path, appID, "http")
|
||||||
|
|
@ -61,7 +63,8 @@ func getTestSocketServerFunc(handler http.Handler, appID, path string) (*http.Se
|
||||||
|
|
||||||
func getTestSocketServer(expectedPath, resp, appID, path string) (*http.Server, net.Listener) {
|
func getTestSocketServer(expectedPath, resp, appID, path string) (*http.Server, net.Listener) {
|
||||||
s := &http.Server{
|
s := &http.Server{
|
||||||
Handler: handlerTestPathResp(expectedPath, resp),
|
Handler: handlerTestPathResp(expectedPath, resp),
|
||||||
|
ReadHeaderTimeout: time.Duration(5) * time.Second,
|
||||||
}
|
}
|
||||||
|
|
||||||
socket := utils.GetSocket(path, appID, "http")
|
socket := utils.GetSocket(path, appID, "http")
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ func GetDaprVersion() (string, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetVersionFromURL(releaseURL string, parseVersion func(body []byte) (string, error)) (string, error) {
|
func GetVersionFromURL(releaseURL string, parseVersion func(body []byte) (string, error)) (string, error) {
|
||||||
req, err := http.NewRequest("GET", releaseURL, nil)
|
req, err := http.NewRequest(http.MethodGet, releaseURL, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
@ -163,7 +164,7 @@ func TestGetVersionsGithub(t *testing.T) {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
m := http.NewServeMux()
|
m := http.NewServeMux()
|
||||||
s := http.Server{Addr: ":12345", Handler: m}
|
s := http.Server{Addr: ":12345", Handler: m, ReadHeaderTimeout: time.Duration(5) * time.Second}
|
||||||
|
|
||||||
for _, tc := range tests {
|
for _, tc := range tests {
|
||||||
body := tc.ResponseBody
|
body := tc.ResponseBody
|
||||||
|
|
@ -272,7 +273,7 @@ entries:
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
m := http.NewServeMux()
|
m := http.NewServeMux()
|
||||||
s := http.Server{Addr: ":12346", Handler: m}
|
s := http.Server{Addr: ":12346", Handler: m, ReadHeaderTimeout: time.Duration(5) * time.Second}
|
||||||
|
|
||||||
for _, tc := range tests {
|
for _, tc := range tests {
|
||||||
body := tc.ResponseBody
|
body := tc.ResponseBody
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ var supportedUpgradePaths = []upgradePath{
|
||||||
CustomResourceDefs: []string{"components.dapr.io", "configurations.dapr.io", "subscriptions.dapr.io", "resiliencies.dapr.io"},
|
CustomResourceDefs: []string{"components.dapr.io", "configurations.dapr.io", "subscriptions.dapr.io", "resiliencies.dapr.io"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// test downgrade
|
// test downgrade.
|
||||||
{
|
{
|
||||||
previous: common.VersionDetails{
|
previous: common.VersionDetails{
|
||||||
RuntimeVersion: "1.8.0",
|
RuntimeVersion: "1.8.0",
|
||||||
|
|
@ -121,13 +121,13 @@ func getTestsOnUpgrade(p upgradePath, installOpts, upgradeOpts common.TestOption
|
||||||
details := p.next
|
details := p.next
|
||||||
|
|
||||||
tests = append(tests, []common.TestCase{
|
tests = append(tests, []common.TestCase{
|
||||||
{"upgrade to " + details.RuntimeVersion, common.UpgradeTest(details, upgradeOpts)},
|
{Name: "upgrade to " + details.RuntimeVersion, Callable: common.UpgradeTest(details, upgradeOpts)},
|
||||||
{"crds exist " + details.RuntimeVersion, common.CRDTest(details, upgradeOpts)},
|
{Name: "crds exist " + details.RuntimeVersion, Callable: common.CRDTest(details, upgradeOpts)},
|
||||||
{"clusterroles exist " + details.RuntimeVersion, common.ClusterRolesTest(details, upgradeOpts)},
|
{Name: "clusterroles exist " + details.RuntimeVersion, Callable: common.ClusterRolesTest(details, upgradeOpts)},
|
||||||
{"clusterrolebindings exist " + details.RuntimeVersion, common.ClusterRoleBindingsTest(details, upgradeOpts)},
|
{Name: "clusterrolebindings exist " + details.RuntimeVersion, Callable: common.ClusterRoleBindingsTest(details, upgradeOpts)},
|
||||||
{"previously applied components exist " + details.RuntimeVersion, common.ComponentsTestOnInstallUpgrade(upgradeOpts)},
|
{Name: "previously applied components exist " + details.RuntimeVersion, Callable: common.ComponentsTestOnInstallUpgrade(upgradeOpts)},
|
||||||
{"check mtls " + details.RuntimeVersion, common.MTLSTestOnInstallUpgrade(upgradeOpts)},
|
{Name: "check mtls " + details.RuntimeVersion, Callable: common.MTLSTestOnInstallUpgrade(upgradeOpts)},
|
||||||
{"status check " + details.RuntimeVersion, common.StatusTestOnInstallUpgrade(details, upgradeOpts)},
|
{Name: "status check " + details.RuntimeVersion, Callable: common.StatusTestOnInstallUpgrade(details, upgradeOpts)},
|
||||||
}...)
|
}...)
|
||||||
|
|
||||||
// uninstall.
|
// uninstall.
|
||||||
|
|
@ -141,8 +141,9 @@ func getTestsOnUpgrade(p upgradePath, installOpts, upgradeOpts common.TestOption
|
||||||
})...)
|
})...)
|
||||||
|
|
||||||
// delete CRDs if exist.
|
// delete CRDs if exist.
|
||||||
tests = append(tests, common.TestCase{"delete CRDs " + p.previous.RuntimeVersion, common.DeleteCRD(p.previous.CustomResourceDefs)})
|
tests = append(tests,
|
||||||
tests = append(tests, common.TestCase{"delete CRDs " + p.next.RuntimeVersion, common.DeleteCRD(p.next.CustomResourceDefs)})
|
common.TestCase{Name: "delete CRDs " + p.previous.RuntimeVersion, Callable: common.DeleteCRD(p.previous.CustomResourceDefs)},
|
||||||
|
common.TestCase{Name: "delete CRDs " + p.next.RuntimeVersion, Callable: common.DeleteCRD(p.next.CustomResourceDefs)})
|
||||||
|
|
||||||
return tests
|
return tests
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@ func RunCmdAndWait(name string, args ...string) (string, error) {
|
||||||
}
|
}
|
||||||
errB, err := io.ReadAll(stderr)
|
errB, err := io.ReadAll(stderr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// nolint
|
//nolint
|
||||||
return "", nil
|
return "", nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -151,7 +151,7 @@ func CreateDirectory(dir string) error {
|
||||||
|
|
||||||
// IsDockerInstalled checks whether docker is installed/running.
|
// IsDockerInstalled checks whether docker is installed/running.
|
||||||
func IsDockerInstalled() bool {
|
func IsDockerInstalled() bool {
|
||||||
// nolint:staticcheck
|
//nolint:staticcheck
|
||||||
cli, err := client.NewEnvClient()
|
cli, err := client.NewEnvClient()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false
|
return false
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue