Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ServiceAccountAuthInfoWriter ¶
type ServiceAccountAuthInfoWriter struct {
// contains filtered or unexported fields
}
ServiceAccountAuthInfoWriter implements Kubernetes service account authentication.
func NewServiceAccountAuthInfoWriter ¶
func NewServiceAccountAuthInfoWriter(saFile string, refreshInterval time.Duration) (*ServiceAccountAuthInfoWriter, error)
NewServiceAccountAuthInfoWriter creates a new ServiceAccountAuthInfoWriter. ServiceAccountAuthInfoWriter implements Kubernetes service account authentication. It reads the token from the given file and refreshes it every refreshInterval. If refreshInterval is 0, it defaults to 5 minutes. If saFile is empty, it defaults to /var/run/secrets/kubernetes.io/serviceaccount/token. An error is returned if the initial token read fails. Further read failures do not cause an error.
func (*ServiceAccountAuthInfoWriter) AuthenticateRequest ¶
func (s *ServiceAccountAuthInfoWriter) AuthenticateRequest(r runtime.ClientRequest, _ strfmt.Registry) error
AuthenticateRequest implements the runtime.ClientAuthInfoWriter interface. It sets the Authorization header to the current token.
func (*ServiceAccountAuthInfoWriter) Stop ¶
func (s *ServiceAccountAuthInfoWriter) Stop()
Stop stops the token refresh