Compare commits

...

8 Commits

Author SHA1 Message Date
Nick Khyl 1b41fdeddb VERSION.txt: this is v1.78.3
Signed-off-by: Nick Khyl <nickk@tailscale.com>
1 year ago
Nick Khyl 3037dc793c VERSION.txt: this is v1.78.2
Signed-off-by: Nick Khyl <nickk@tailscale.com>
1 year ago
Irbe Krumina 6e0f168db0
cmd/containerboot: fix nil pointer exception (cherry-pick of #14357, #14358) (#14359)
* cmd/containerboot: guard kubeClient against nil dereference (#14357)

A method on kc was called unconditionally, even if was not initialized,
leading to a nil pointer dereference when TS_SERVE_CONFIG was set
outside Kubernetes.

Add a guard symmetric with other uses of the kubeClient.

Signed-off-by: Bjorn Neergaard <bjorn@neersighted.com>
(cherry picked from commit 8b1d01161b)

* cmd/containerboot: don't attempt to write kube Secret in non-kube environments (#14358)

Signed-off-by: Irbe Krumina <irbe@tailscale.com>
(cherry picked from commit 0cc071f154)

* cmd/containerboot: don't attempt to patch a Secret field without permissions (#14365)

Signed-off-by: Irbe Krumina <irbe@tailscale.com>
(cherry picked from commit 6e552f66a0)

Updates tailscale/tailscale#14354
1 year ago
Tom Proctor 3e3d5d8c68
hostinfo: fix testing in container (#14330) (#14337)
Previously this unit test failed if it was run in a container. Update the assert
to focus on exactly the condition we are trying to assert: the package type
should only be 'container' if we use the build tag.

Updates #14317

Signed-off-by: Tom Proctor <tomhjp@users.noreply.github.com>
(cherry picked from commit 06c5e83c20)
1 year ago
Brad Fitzpatrick c80eb698d5 VERSION.txt: this is v1.78.1
Change-Id: I3588027fee8460b27c357d3a656f769fda151ccc
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
1 year ago
Brad Fitzpatrick 1aef3e83b8 health: fix TestHealthMetric to pass on release branch
Fixes #14302

Change-Id: I9fd893a97711c72b713fe5535f2ccb93fadf7452
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
(cherry picked from commit dc6728729e)
1 year ago
Brad Fitzpatrick 2690b4762f Revert "VERSION.txt: this is v1.78.0"
This reverts commit 0267fe83b2.

Reason: it converted the tree to Windows line endings.

Updates #14299

Change-Id: I2271a61d43e99bd0bbcf9f4831e8783e570ba08a
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
1 year ago
Nick Khyl 0267fe83b2 VERSION.txt: this is v1.78.0
Signed-off-by: Nick Khyl <nickk@tailscale.com>
1 year ago

@ -1 +1 @@
1.77.0
1.78.3

@ -24,6 +24,7 @@ import (
type kubeClient struct {
kubeclient.Client
stateSecret string
canPatch bool // whether the client has permissions to patch Kubernetes Secrets
}
func newKubeClient(root string, stateSecret string) (*kubeClient, error) {

@ -331,8 +331,10 @@ authLoop:
if err := client.SetServeConfig(ctx, new(ipn.ServeConfig)); err != nil {
log.Fatalf("failed to unset serve config: %v", err)
}
if err := kc.storeHTTPSEndpoint(ctx, ""); err != nil {
log.Fatalf("failed to update HTTPS endpoint in tailscale state: %v", err)
if hasKubeStateStore(cfg) {
if err := kc.storeHTTPSEndpoint(ctx, ""); err != nil {
log.Fatalf("failed to update HTTPS endpoint in tailscale state: %v", err)
}
}
}

@ -72,8 +72,10 @@ func watchServeConfigChanges(ctx context.Context, path string, cdChanged <-chan
if err := updateServeConfig(ctx, sc, certDomain, lc); err != nil {
log.Fatalf("serve proxy: error updating serve config: %v", err)
}
if err := kc.storeHTTPSEndpoint(ctx, certDomain); err != nil {
log.Fatalf("serve proxy: error storing HTTPS endpoint: %v", err)
if kc != nil && kc.canPatch {
if err := kc.storeHTTPSEndpoint(ctx, certDomain); err != nil {
log.Fatalf("serve proxy: error storing HTTPS endpoint: %v", err)
}
}
prevServeConfig = sc
}

@ -214,6 +214,7 @@ func (cfg *settings) setupKube(ctx context.Context, kc *kubeClient) error {
return fmt.Errorf("some Kubernetes permissions are missing, please check your RBAC configuration: %v", err)
}
cfg.KubernetesCanPatch = canPatch
kc.canPatch = canPatch
s, err := kc.GetSecret(ctx, cfg.KubeSecret)
if err != nil {

@ -14,6 +14,7 @@ import (
"tailscale.com/tailcfg"
"tailscale.com/types/opt"
"tailscale.com/util/usermetric"
"tailscale.com/version"
)
func TestAppendWarnableDebugFlags(t *testing.T) {
@ -352,6 +353,11 @@ func TestShowUpdateWarnable(t *testing.T) {
}
func TestHealthMetric(t *testing.T) {
unstableBuildWarning := 0
if version.IsUnstableBuild() {
unstableBuildWarning = 1
}
tests := []struct {
desc string
check bool
@ -361,20 +367,20 @@ func TestHealthMetric(t *testing.T) {
}{
// When running in dev, and not initialising the client, there will be two warnings
// by default:
// - is-using-unstable-version
// - is-using-unstable-version (except on the release branch)
// - wantrunning-false
{
desc: "base-warnings",
check: true,
cv: nil,
wantMetricCount: 2,
wantMetricCount: unstableBuildWarning + 1,
},
// with: update-available
{
desc: "update-warning",
check: true,
cv: &tailcfg.ClientVersion{RunningLatest: false, LatestVersion: "1.2.3"},
wantMetricCount: 3,
wantMetricCount: unstableBuildWarning + 2,
},
}
for _, tt := range tests {

@ -35,8 +35,12 @@ remotes/origin/QTSFW_5.0.0`
}
}
func TestInContainer(t *testing.T) {
if got := inContainer(); !got.EqualBool(false) {
t.Errorf("inContainer = %v; want false due to absence of ts_package_container build tag", got)
func TestPackageTypeNotContainer(t *testing.T) {
var got string
if packageType != nil {
got = packageType()
}
if got == "container" {
t.Fatal("packageType = container; should only happen if build tag ts_package_container is set")
}
}

Loading…
Cancel
Save