cmd/{k8s-operator,k8s-proxy},kube: use consistent type for auth mode config (#16626)
Updates k8s-proxy's config so its auth mode config matches that we set in kube-apiserver ProxyGroups for consistency. Updates #13358 Change-Id: I95e29cec6ded2dc7c6d2d03f968a25c822bc0e01 Signed-off-by: Tom Proctor <tomhjp@users.noreply.github.com>
This commit is contained in:
+22
-1
@@ -3,6 +3,8 @@
|
||||
|
||||
package kubetypes
|
||||
|
||||
import "fmt"
|
||||
|
||||
const (
|
||||
// Hostinfo App values for the Tailscale Kubernetes Operator components.
|
||||
AppOperator = "k8s-operator"
|
||||
@@ -59,5 +61,24 @@ const (
|
||||
LabelSecretTypeState = "state"
|
||||
LabelSecretTypeCerts = "certs"
|
||||
|
||||
KubeAPIServerConfigFile = "config.hujson"
|
||||
KubeAPIServerConfigFile = "config.hujson"
|
||||
APIServerProxyModeAuth APIServerProxyMode = "auth"
|
||||
APIServerProxyModeNoAuth APIServerProxyMode = "noauth"
|
||||
)
|
||||
|
||||
// APIServerProxyMode specifies whether the API server proxy will add
|
||||
// impersonation headers to requests based on the caller's Tailscale identity.
|
||||
// May be "auth" or "noauth".
|
||||
type APIServerProxyMode string
|
||||
|
||||
func (a *APIServerProxyMode) UnmarshalJSON(data []byte) error {
|
||||
switch string(data) {
|
||||
case `"auth"`:
|
||||
*a = APIServerProxyModeAuth
|
||||
case `"noauth"`:
|
||||
*a = APIServerProxyModeNoAuth
|
||||
default:
|
||||
return fmt.Errorf("unknown APIServerProxyMode %q", data)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user