Skip to content

Commit

Permalink
fix: persist http proxy settings and security context on upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
emosbaugh committed Oct 22, 2024
1 parent 435a7f6 commit 779e011
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cmd/kots/cli/admin-console-upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/pointer"
)

func AdminConsoleUpgradeCmd() *cobra.Command {
Expand Down Expand Up @@ -88,8 +89,7 @@ func AdminConsoleUpgradeCmd() *cobra.Command {
}

if v.IsSet("strict-security-context") {
ok := v.GetBool("strict-security-context")
upgradeOptions.StrictSecurityContext = &ok
upgradeOptions.StrictSecurityContext = pointer.Bool(v.GetBool("strict-security-context"))
}

timeout, err := time.ParseDuration(v.GetString("wait-duration"))
Expand Down
8 changes: 4 additions & 4 deletions pkg/kotsadm/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ package kotsadm
import (
"testing"

"github.com/aws/smithy-go/ptr"
"gopkg.in/go-playground/assert.v1"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/kubernetes/fake"
"k8s.io/utils/pointer"
)

func Test_getHTTPProxySettings(t *testing.T) {
Expand Down Expand Up @@ -143,8 +143,8 @@ func Test_hasStrictSecurityContext(t *testing.T) {
},
},
SecurityContext: &corev1.PodSecurityContext{
RunAsUser: ptr.Int64(1001),
RunAsNonRoot: ptr.Bool(true),
RunAsUser: pointer.Int64(1001),
RunAsNonRoot: pointer.Bool(true),
},
},
},
Expand All @@ -171,7 +171,7 @@ func Test_hasStrictSecurityContext(t *testing.T) {
},
},
SecurityContext: &corev1.PodSecurityContext{
RunAsUser: ptr.Int64(1001),
RunAsUser: pointer.Int64(1001),
},
},
},
Expand Down

0 comments on commit 779e011

Please sign in to comment.