Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update API Token from the UI (#2198)
This pull request includes multiple changes aimed at improving code maintainability and functionality across several files. The most significant changes involve adding a new `lint-fix` target to the `Makefile`, refactoring the `cli/cmd/describe.go` file to use constants, and updating the `frontend/graph/generated.go` file to include a new mutation for updating API tokens. ### Makefile improvements: * Added a `lint-fix` target to the `Makefile` to allow automatic fixing of linting issues for the `common` and `k8sutils` modules. ### CLI command refactoring: * Refactored `cli/cmd/describe.go` to use constants from `k8sconsts` for service names and ports, improving code readability and maintainability. [[1]](diffhunk://#diff-1a964108ddfe26caa973e0a9d810ffcf037627b43a50f42e9f87b624d52783c6R11) [[2]](diffhunk://#diff-1a964108ddfe26caa973e0a9d810ffcf037627b43a50f42e9f87b624d52783c6L144-R145) [[3]](diffhunk://#diff-1a964108ddfe26caa973e0a9d810ffcf037627b43a50f42e9f87b624d52783c6L165-L171) [[4]](diffhunk://#diff-1a964108ddfe26caa973e0a9d810ffcf037627b43a50f42e9f87b624d52783c6L182-R176) * Updated `cli/cmd/pro.go` to include a new flag `updateRemoteFlag` and refactored the token update logic to use a remote update function if the flag is set. [[1]](diffhunk://#diff-433dfb4fa2ecc9c2fe6e9a0996b24b5c205837c86b9201767e7f4956e98b41a5L7-R17) [[2]](diffhunk://#diff-433dfb4fa2ecc9c2fe6e9a0996b24b5c205837c86b9201767e7f4956e98b41a5L35-R69) ### Frontend GraphQL schema updates: * Added a new mutation `UpdateAPIToken` to the GraphQL schema in `frontend/graph/generated.go`, allowing API tokens to be updated. [[1]](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2R309) [[2]](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2L500-R508) [[3]](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2R1677-R1688) [[4]](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2R2832-R2846) [[5]](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2L9733-R9763) [[6]](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2L9747-R9776) [[7]](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2L9759-R9800) [[8]](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2L9797-R9810) [[9]](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2L9914-R9928) [[10]](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2L9928-R9941) [[11]](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2L9940-R9965) [[12]](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2L9974-R9983) [[13]](diffhunk://#diff-4bacf1f13939a5c243f3f83d21f4560b331d13667d81ea5945ed1f57ddb205f2L9995-R9996) ### Miscellaneous updates: * Updated `cli/cmd/resources/ui.go` to use constants from `k8sconsts` for service names and ports, ensuring consistency across the codebase. [[1]](diffhunk://#diff-c286e10d34710a80a59127b2b7951e8a33d9b9554e47d2f2b827fd690f2e53abR15) [[2]](diffhunk://#diff-c286e10d34710a80a59127b2b7951e8a33d9b9554e47d2f2b827fd690f2e53abL291-R293) --------- Co-authored-by: Avihu Hanya <[email protected]>
- Loading branch information