k8s Proxy Tokens Expire too early

Checklist

  • I'm using the latest version of the extension (Run glab --version)
    • Extension version: 1.53.0
  • Operating system and version: Ubuntu 24.04.2 (running in WSL2)
  • Gitlab.com or self-managed instance? self-managed instance
  • GitLab version (if self-managed) 17.8.2-ee (Use the version endpoint, like this: gitlab.my-company.com/api/v4/version)
  • I have performed glab auth status to check for authentication issues
  • Run the command in debug mode (like DEBUG=true glab mr list) and attach any useful output

Summary

Personal access tokens generated with the update-kubeconfig can expire before they are used when server is in a different time zone.

Environment

  • OS: Linux 5.15.167.4-microsoft-standard-WSL2 x86_64
  • SHELL: /bin/bash
  • TERM: xterm-256color
  • GLAB: Current glab version: 1.53.0 (2025-02-11)

Other:

Steps to reproduce

  1. Set GitLab server time zone to UTC with a GitLab Kubernetes agent connected to it.
  2. Run the following command to authenticate to Kubernetes using the Agent
  3. Attempt to access Kubernetes resources with kubectl after 00:00 UTC but before 00:00 on the system running glab

What is the current bug behavior?

Authentication fails and multiple tokens are created by glab in GitLab with an expiration datetime of 00:00 of the current day on the local system; but GitLab evaluates the token expiration date based on it's local time.

What is the expected correct behavior?

PAT is set to expire in the future even it the local environment is in a different time zone than the GitLab server.