-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: automate self-generation of swagger for k8s-client and fix clus…
…ter-level resource read API generation - Implement self-generation of swagger specifications for the k8s-client to ensure up-to-date API compatibility. - Fix an issue where the read API for cluster-level resources was not being generated, enhancing API completeness.
- Loading branch information
1 parent
29a11d7
commit b275981
Showing
14 changed files
with
10,412 additions
and
17,268 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
packages/kubekit-prepare/gen-config/v1.ts → .../kubekit-prepare/gen-config/k8s-client.ts
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,9 +1,9 @@ | ||
import type { ConfigFile } from '@kubekit/codegen' | ||
|
||
const config: ConfigFile = { | ||
schemaFile: '../openapi/api/v1/swagger.json', | ||
schemaFile: '../generated-openapi.json', | ||
apiFile: '@kubekit/client', | ||
outputFile: '../src/k8s-client/v1.ts', | ||
outputFile: '../src/k8s-client.ts', | ||
} | ||
|
||
export default config |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import type { ConfigFile } from '..' | ||
|
||
const config: ConfigFile = { | ||
kind: 'ServiceAccount', | ||
name: 'kubekit-prepare', | ||
namespace: 'default', | ||
outputFile: '../generated-openapi.json', | ||
} | ||
|
||
export default config |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: kubekit-prepare | ||
namespace: default | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: kubekit-prepare | ||
namespace: default | ||
rules: | ||
# for validation service account exists | ||
- apiGroups: | ||
- '' | ||
resources: | ||
- serviceaccounts | ||
verbs: | ||
- get | ||
# for aggregate target service account rules | ||
- apiGroups: | ||
- rbac.authorization.k8s.io | ||
resources: | ||
- clusterroles | ||
- roles | ||
verbs: | ||
- get | ||
- list | ||
- apiGroups: | ||
- rbac.authorization.k8s.io | ||
resources: | ||
- rolebindings | ||
- clusterrolebindings | ||
verbs: | ||
- list | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: kubekit-prepare-binding | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: kubekit-prepare | ||
subjects: | ||
- kind: ServiceAccount | ||
name: kubekit-prepare | ||
namespace: default |
Large diffs are not rendered by default.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.