-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(auth): allow anyone to get cluster-info in kube-public
- Loading branch information
Showing
2 changed files
with
14 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import Request from './request'; | ||
|
||
export const getTkeStackVersion = async () => { | ||
const rsp = await Request.get<any, { items: Array<{ data?: { tkeVersion?: string } }> }>( | ||
'/api/v1/namespaces/kube-public/configmaps', | ||
const rsp = await Request.get<any, { data?: { tkeVersion: string } }>( | ||
'/api/v1/namespaces/kube-public/configmaps/cluster-info', | ||
{ | ||
headers: { | ||
'X-TKE-ClusterName': 'global' | ||
} | ||
} | ||
); | ||
return rsp?.items?.[0]?.data?.tkeVersion ?? ''; | ||
return rsp?.data?.tkeVersion ?? ''; | ||
}; |