ipn/store/awsstore: add "ts_omit_aws" build tag to reduce binary size

Drops tailscaled from 23M to 21M.

Change-Id: I731c542d03113ac94abb695e3c8fcacbc5542712
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick 2022-07-27 14:08:59 -07:00 committed by Brad Fitzpatrick
parent e6e1976c3a
commit 97b8c4fa1b
3 changed files with 11 additions and 5 deletions

View File

@ -28,6 +28,11 @@ jobs:
- name: Basic build
run: go build ./cmd/...
- name: Build variants
run: |
go install --tags=ts_include_cli ./cmd/tailscaled
go install --tags=ts_omit_aws ./cmd/tailscaled
- name: Get QEMU
run: |
# The qemu in Ubuntu 20.04 (Focal) is too old; we need 5.x something

View File

@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build linux
// +build linux
//go:build linux && !ts_omit_aws
// +build linux,!ts_omit_aws
// Package awsstore contains an ipn.StateStore implementation using AWS SSM.
package awsstore

View File

@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build !linux
// +build !linux
//go:build !linux || ts_omit_aws
// +build !linux ts_omit_aws
package awsstore
@ -12,8 +12,9 @@ import (
"runtime"
"tailscale.com/ipn"
"tailscale.com/types/logger"
)
func NewStore(string) (ipn.StateStore, error) {
func New(logger.Logf, string) (ipn.StateStore, error) {
return nil, fmt.Errorf("AWS store is not supported on %v", runtime.GOOS)
}