mirror of
				https://github.com/k3s-io/kubernetes.git
				synced 2025-10-30 21:30:16 +00:00 
			
		
		
		
	fix some hardcoding
fix some hardcoding
This commit is contained in:
		| @@ -657,14 +657,14 @@ func Complete(s *options.ServerRunOptions) (completedServerRunOptions, error) { | ||||
| 			upBound := time.Duration(1<<32) * time.Second | ||||
| 			if s.Authentication.ServiceAccounts.MaxExpiration < lowBound || | ||||
| 				s.Authentication.ServiceAccounts.MaxExpiration > upBound { | ||||
| 				return options, fmt.Errorf("the serviceaccount max expiration must be between 1 hour to 2^32 seconds") | ||||
| 				return options, fmt.Errorf("the service-account-max-token-expiration must be between 1 hour and 2^32 seconds") | ||||
| 			} | ||||
| 			if s.Authentication.ServiceAccounts.ExtendExpiration { | ||||
| 				if s.Authentication.ServiceAccounts.MaxExpiration < serviceaccount.WarnOnlyBoundTokenExpirationSeconds*time.Second { | ||||
| 					klog.Warningf("service-account-extend-token-expiration is true, in order to correctly trigger safe transition logic, service-account-max-token-expiration must be set longer than 3607 seconds (currently %s)", s.Authentication.ServiceAccounts.MaxExpiration) | ||||
| 					klog.Warningf("service-account-extend-token-expiration is true, in order to correctly trigger safe transition logic, service-account-max-token-expiration must be set longer than %d seconds (currently %s)", serviceaccount.WarnOnlyBoundTokenExpirationSeconds, s.Authentication.ServiceAccounts.MaxExpiration) | ||||
| 				} | ||||
| 				if s.Authentication.ServiceAccounts.MaxExpiration < serviceaccount.ExpirationExtensionSeconds*time.Second { | ||||
| 					klog.Warningf("service-account-extend-token-expiration is true, enabling tokens valid up to 1 year, which is longer than service-account-max-token-expiration set to %s", s.Authentication.ServiceAccounts.MaxExpiration) | ||||
| 					klog.Warningf("service-account-extend-token-expiration is true, enabling tokens valid up to %d seconds, which is longer than service-account-max-token-expiration set to %s seconds", serviceaccount.ExpirationExtensionSeconds, s.Authentication.ServiceAccounts.MaxExpiration) | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user