Skip to content

Commit

Permalink
Updated Go dependencies, removed deprecated pkgs (#2694)
Browse files Browse the repository at this point in the history
* bumped go deps, removed deprecated pkgs

* fix tests
  • Loading branch information
enrichman committed Nov 14, 2023
1 parent 65c1e25 commit d8182bf
Show file tree
Hide file tree
Showing 8 changed files with 465 additions and 656 deletions.
2 changes: 1 addition & 1 deletion acceptance/api/v1/application_exec_test.go
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/epinio/epinio/acceptance/helpers/proc"
v1 "github.com/epinio/epinio/internal/api/v1"
"github.com/gorilla/websocket"
"k8s.io/apiserver/pkg/util/wsstream"
"k8s.io/apimachinery/pkg/util/httpstream/wsstream"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
Expand Down
10 changes: 5 additions & 5 deletions acceptance/api/v1/application_export_test.go
Expand Up @@ -94,12 +94,12 @@ var _ = Describe("AppPart Endpoint", LApplication, func() {

expecting := fmt.Sprintf(`name: %s
configuration:
instances: 1
routes:
- %s
appchart: standard
instances: 1
routes:
- %s
appchart: standard
origin:
container: splatform/sample-app
container: splatform/sample-app
namespace: %s
`, app, domain, namespace)

Expand Down
267 changes: 140 additions & 127 deletions go.mod

Large diffs are not rendered by default.

807 changes: 301 additions & 506 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion helpers/cahash/cahash.go
Expand Up @@ -16,7 +16,7 @@ import (
"encoding/pem"
"fmt"

"github.com/paketo-buildpacks/ca-certificates/cacerts"
"github.com/paketo-buildpacks/ca-certificates/v3/cacerts"
"github.com/pkg/errors"
)

Expand Down
4 changes: 2 additions & 2 deletions internal/api/v1/application/export.go
Expand Up @@ -44,7 +44,7 @@ import (
batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"
)

// ExportToRegistry handles the API endpoint GET /namespaces/:namespace/applications/:app/export
Expand Down Expand Up @@ -522,7 +522,7 @@ func createCopyJob(logger logr.Logger, localPath, destinationPath, authSecret, c
Annotations: map[string]string{},
},
Spec: batchv1.JobSpec{
BackoffLimit: pointer.Int32(0),
BackoffLimit: ptr.To[int32](0),
Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Labels: labels,
Expand Down
4 changes: 2 additions & 2 deletions internal/api/v1/application/part.go
Expand Up @@ -44,7 +44,7 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
restclient "k8s.io/client-go/rest"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"
)

const imageExportVolume = "/image-export/"
Expand Down Expand Up @@ -276,7 +276,7 @@ func runDownloadImageJob(ctx context.Context, cluster *kubernetes.Cluster, jobNa
Annotations: map[string]string{},
},
Spec: batchv1.JobSpec{
BackoffLimit: pointer.Int32(0),
BackoffLimit: ptr.To[int32](0),
Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Labels: labels,
Expand Down
25 changes: 13 additions & 12 deletions internal/api/v1/application/stage.go
Expand Up @@ -16,13 +16,14 @@ import (
"fmt"
"path/filepath"
"strconv"
"strings"

"github.com/gin-gonic/gin"
"github.com/go-logr/logr"
"github.com/pkg/errors"
"github.com/spf13/viper"
batchv1 "k8s.io/api/batch/v1"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"

corev1 "k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -461,7 +462,7 @@ func newJobRun(app stageParam) (*batchv1.Job, *corev1.Secret) {
LocalObjectReference: corev1.LocalObjectReference{
Name: app.Scripts,
},
DefaultMode: pointer.Int32(420),
DefaultMode: ptr.To[int32](420),
},
},
},
Expand All @@ -471,7 +472,7 @@ func newJobRun(app stageParam) (*batchv1.Job, *corev1.Secret) {
VolumeSource: corev1.VolumeSource{
Secret: &corev1.SecretVolumeSource{
SecretName: jobName,
DefaultMode: pointer.Int32(420),
DefaultMode: ptr.To[int32](420),
},
},
},
Expand All @@ -495,7 +496,7 @@ func newJobRun(app stageParam) (*batchv1.Job, *corev1.Secret) {
VolumeSource: corev1.VolumeSource{
Secret: &corev1.SecretVolumeSource{
SecretName: helmchart.S3ConnectionDetailsSecretName,
DefaultMode: pointer.Int32(420),
DefaultMode: ptr.To[int32](420),
},
},
},
Expand All @@ -504,7 +505,7 @@ func newJobRun(app stageParam) (*batchv1.Job, *corev1.Secret) {
VolumeSource: corev1.VolumeSource{
Secret: &corev1.SecretVolumeSource{
SecretName: registry.CredentialsSecretName,
DefaultMode: pointer.Int32(420),
DefaultMode: ptr.To[int32](420),
Items: []corev1.KeyToPath{
{
Key: ".dockerconfigjson",
Expand Down Expand Up @@ -563,7 +564,7 @@ func newJobRun(app stageParam) (*batchv1.Job, *corev1.Secret) {
},
},
Spec: batchv1.JobSpec{
BackoffLimit: pointer.Int32(0),
BackoffLimit: ptr.To[int32](0),
Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
Expand Down Expand Up @@ -619,8 +620,8 @@ func newJobRun(app stageParam) (*batchv1.Job, *corev1.Secret) {
Env: stageEnv,
VolumeMounts: volumeMounts,
SecurityContext: &corev1.SecurityContext{
RunAsUser: pointer.Int64(app.UserID),
RunAsGroup: pointer.Int64(app.GroupID),
RunAsUser: ptr.To[int64](app.UserID),
RunAsGroup: ptr.To[int64](app.GroupID),
},
},
},
Expand Down Expand Up @@ -810,7 +811,7 @@ func mountS3Certs(volumes []corev1.Volume, volumeMounts []corev1.VolumeMount) ([
VolumeSource: corev1.VolumeSource{
Secret: &corev1.SecretVolumeSource{
SecretName: s3CertificateSecret,
DefaultMode: pointer.Int32(420),
DefaultMode: ptr.To[int32](420),
},
},
})
Expand All @@ -833,7 +834,7 @@ func mountRegistryCerts(app stageParam, volumes []corev1.Volume, volumeMounts []
VolumeSource: corev1.VolumeSource{
Secret: &corev1.SecretVolumeSource{
SecretName: app.RegistryCASecret,
DefaultMode: pointer.Int32(420),
DefaultMode: ptr.To[int32](420),
},
},
})
Expand Down Expand Up @@ -1001,6 +1002,6 @@ func NewStagingScriptConfig(config v1.ConfigMap) (*StagingScriptConfig, error) {
return stagingScript, nil
}

func SortByName(s1, s2 *StagingScriptConfig) bool {
return s1.Name < s2.Name
func SortByName(s1, s2 *StagingScriptConfig) int {
return strings.Compare(s1.Name, s2.Name)
}

0 comments on commit d8182bf

Please sign in to comment.