Refactor entire project (#39)
- Use more modern TypeScript conventions - Use JavaScript Kubernetes Client - Add unit tests - Add integration tests - Add TypeScript compile verify workflow - Switch codeowners
This commit is contained in:
27
tests/expected-kubeconfig.json
Normal file
27
tests/expected-kubeconfig.json
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"apiVersion": "v1",
|
||||
"kind": "Config",
|
||||
"clusters": [
|
||||
{
|
||||
"name": "example",
|
||||
"cluster": {
|
||||
"server": "http://example.com:8080",
|
||||
"insecure-skip-tls-verify": false
|
||||
}
|
||||
}
|
||||
],
|
||||
"users": [],
|
||||
"contexts": [
|
||||
{
|
||||
"name": "example",
|
||||
"context": {
|
||||
"cluster": "example",
|
||||
"name": "example",
|
||||
"user": "example",
|
||||
"namespace": "example"
|
||||
}
|
||||
}
|
||||
],
|
||||
"preferences": {},
|
||||
"current-context": "example"
|
||||
}
|
12
tests/sample-kubeconfig.yml
Normal file
12
tests/sample-kubeconfig.yml
Normal file
@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: Config
|
||||
clusters:
|
||||
- cluster:
|
||||
server: http://example.com:8080
|
||||
name: example
|
||||
contexts:
|
||||
- context:
|
||||
cluster: example
|
||||
namespace: example
|
||||
user: example
|
||||
name: example
|
35
tests/sample-secret.yml
Normal file
35
tests/sample-secret.yml
Normal file
@ -0,0 +1,35 @@
|
||||
apiVersion: v1
|
||||
data:
|
||||
ca.crt: LS0tLS1CRUdJTiBDRWyUSUZJQ
|
||||
namespace: ZGVmBXUsLdA==
|
||||
token: ZXlKaGJHY2lPcUpTVXpJMU5pSX=
|
||||
kind: Secret
|
||||
metadata:
|
||||
annotations:
|
||||
kubernetes.io/service-account.name: default
|
||||
kubernetes.io/service-account.uid: e1414a3z-22fe-48d1-ab9e-18e4a5b91c
|
||||
creationTimestamp: "2020-03-02T06:40:31Z"
|
||||
managedFields:
|
||||
- apiVersion: v1
|
||||
fieldsType: FieldsV1
|
||||
fieldsV1:
|
||||
f:data:
|
||||
.: {}
|
||||
f:ca.crt: {}
|
||||
f:namespace: {}
|
||||
f:token: {}
|
||||
f:metadata:
|
||||
f:annotations:
|
||||
.: {}
|
||||
f:kubernetes.io/service-account.name: {}
|
||||
f:kubernetes.io/service-account.uid: {}
|
||||
f:type: {}
|
||||
manager: kube-controller-manager
|
||||
operation: Update
|
||||
time: "2020-03-02T06:40:31Z"
|
||||
name: default-token-bl8ra
|
||||
namespace: default
|
||||
resourceVersion: "278"
|
||||
selfLink: /api/v1/namespaces/default/secrets/default-token-bl8ra
|
||||
uid: e6d8b21b-2e3a-4606-98za-54fb44fdc
|
||||
type: kubernetes.io/service-account-token
|
7
tests/util.ts
Normal file
7
tests/util.ts
Normal file
@ -0,0 +1,7 @@
|
||||
/**
|
||||
* Returns error thrown by core.getInput when input required but not found
|
||||
* @param inputName Name of input
|
||||
* @returns Error with explanation message
|
||||
*/
|
||||
export const getRequiredInputError = (inputName) =>
|
||||
Error(`Input required and not supplied: ${inputName}`);
|
Reference in New Issue
Block a user