|
|
@ -71,7 +71,6 @@ func expectedSTS(t *testing.T, cl client.Client, opts configOpts) *appsv1.Statef
|
|
|
|
{Name: "TS_USERSPACE", Value: "false"},
|
|
|
|
{Name: "TS_USERSPACE", Value: "false"},
|
|
|
|
{Name: "POD_IP", ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{APIVersion: "", FieldPath: "status.podIP"}, ResourceFieldRef: nil, ConfigMapKeyRef: nil, SecretKeyRef: nil}},
|
|
|
|
{Name: "POD_IP", ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{APIVersion: "", FieldPath: "status.podIP"}, ResourceFieldRef: nil, ConfigMapKeyRef: nil, SecretKeyRef: nil}},
|
|
|
|
{Name: "TS_KUBE_SECRET", Value: opts.secretName},
|
|
|
|
{Name: "TS_KUBE_SECRET", Value: opts.secretName},
|
|
|
|
{Name: "EXPERIMENTAL_TS_CONFIGFILE_PATH", Value: "/etc/tsconfig/tailscaled"},
|
|
|
|
|
|
|
|
{Name: "TS_EXPERIMENTAL_VERSIONED_CONFIG_DIR", Value: "/etc/tsconfig"},
|
|
|
|
{Name: "TS_EXPERIMENTAL_VERSIONED_CONFIG_DIR", Value: "/etc/tsconfig"},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
SecurityContext: &corev1.SecurityContext{
|
|
|
|
SecurityContext: &corev1.SecurityContext{
|
|
|
@ -230,7 +229,6 @@ func expectedSTSUserspace(t *testing.T, cl client.Client, opts configOpts) *apps
|
|
|
|
{Name: "TS_USERSPACE", Value: "true"},
|
|
|
|
{Name: "TS_USERSPACE", Value: "true"},
|
|
|
|
{Name: "POD_IP", ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{APIVersion: "", FieldPath: "status.podIP"}, ResourceFieldRef: nil, ConfigMapKeyRef: nil, SecretKeyRef: nil}},
|
|
|
|
{Name: "POD_IP", ValueFrom: &corev1.EnvVarSource{FieldRef: &corev1.ObjectFieldSelector{APIVersion: "", FieldPath: "status.podIP"}, ResourceFieldRef: nil, ConfigMapKeyRef: nil, SecretKeyRef: nil}},
|
|
|
|
{Name: "TS_KUBE_SECRET", Value: opts.secretName},
|
|
|
|
{Name: "TS_KUBE_SECRET", Value: opts.secretName},
|
|
|
|
{Name: "EXPERIMENTAL_TS_CONFIGFILE_PATH", Value: "/etc/tsconfig/tailscaled"},
|
|
|
|
|
|
|
|
{Name: "TS_EXPERIMENTAL_VERSIONED_CONFIG_DIR", Value: "/etc/tsconfig"},
|
|
|
|
{Name: "TS_EXPERIMENTAL_VERSIONED_CONFIG_DIR", Value: "/etc/tsconfig"},
|
|
|
|
{Name: "TS_SERVE_CONFIG", Value: "/etc/tailscaled/serve-config"},
|
|
|
|
{Name: "TS_SERVE_CONFIG", Value: "/etc/tailscaled/serve-config"},
|
|
|
|
{Name: "TS_INTERNAL_APP", Value: opts.app},
|
|
|
|
{Name: "TS_INTERNAL_APP", Value: opts.app},
|
|
|
@ -404,12 +402,6 @@ func expectedSecret(t *testing.T, cl client.Client, opts configOpts) *corev1.Sec
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
t.Fatalf("error marshalling tailscaled config")
|
|
|
|
t.Fatalf("error marshalling tailscaled config")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
conf.NoStatefulFiltering.Clear()
|
|
|
|
|
|
|
|
b, err := json.Marshal(conf)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
t.Fatalf("error marshalling tailscaled config")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
mak.Set(&s.StringData, "tailscaled", string(b))
|
|
|
|
|
|
|
|
mak.Set(&s.StringData, "cap-95.hujson", string(bn))
|
|
|
|
mak.Set(&s.StringData, "cap-95.hujson", string(bn))
|
|
|
|
mak.Set(&s.StringData, "cap-107.hujson", string(bnn))
|
|
|
|
mak.Set(&s.StringData, "cap-107.hujson", string(bnn))
|
|
|
|
labels := map[string]string{
|
|
|
|
labels := map[string]string{
|
|
|
@ -662,18 +654,6 @@ func removeTargetPortsFromSvc(svc *corev1.Service) {
|
|
|
|
func removeAuthKeyIfExistsModifier(t *testing.T) func(s *corev1.Secret) {
|
|
|
|
func removeAuthKeyIfExistsModifier(t *testing.T) func(s *corev1.Secret) {
|
|
|
|
return func(secret *corev1.Secret) {
|
|
|
|
return func(secret *corev1.Secret) {
|
|
|
|
t.Helper()
|
|
|
|
t.Helper()
|
|
|
|
if len(secret.StringData["tailscaled"]) != 0 {
|
|
|
|
|
|
|
|
conf := &ipn.ConfigVAlpha{}
|
|
|
|
|
|
|
|
if err := json.Unmarshal([]byte(secret.StringData["tailscaled"]), conf); err != nil {
|
|
|
|
|
|
|
|
t.Fatalf("error unmarshalling 'tailscaled' contents: %v", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
conf.AuthKey = nil
|
|
|
|
|
|
|
|
b, err := json.Marshal(conf)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
t.Fatalf("error marshalling updated 'tailscaled' config: %v", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
mak.Set(&secret.StringData, "tailscaled", string(b))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if len(secret.StringData["cap-95.hujson"]) != 0 {
|
|
|
|
if len(secret.StringData["cap-95.hujson"]) != 0 {
|
|
|
|
conf := &ipn.ConfigVAlpha{}
|
|
|
|
conf := &ipn.ConfigVAlpha{}
|
|
|
|
if err := json.Unmarshal([]byte(secret.StringData["cap-95.hujson"]), conf); err != nil {
|
|
|
|
if err := json.Unmarshal([]byte(secret.StringData["cap-95.hujson"]), conf); err != nil {
|
|
|
|