-
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.
- Loading branch information
Showing
3,428 changed files
with
114,492 additions
and
207,920 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
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
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 |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import k8s from '@kubernetes/client-node'; | ||
import rfc6902 from 'rfc6902'; | ||
import {kc, cache, applyFilter, applyFieldSelection, getByPath, getMetaNS } from '../k8slibs.js'; | ||
|
||
const k8sApi = kc.makeApiClient(k8s.CustomObjectsApi); | ||
|
||
export const mutations = { | ||
certmanagerCertificateCreate: async (_parent, args: object) => { | ||
const payload = { | ||
apiVersion: 'cert-manager.io/v1', | ||
kind: 'io.cert-manager.v1.Certificate', | ||
metadata: getMetaNS(args), | ||
"spec": args['spec'], | ||
} | ||
try { | ||
const res = await k8sApi.createNamespacedCustomObject('cert-manager.io','v1',args['namespace'],'certificates', payload) | ||
return res.body | ||
} catch (err) { | ||
console.error((err as object)['body']); | ||
} | ||
return null | ||
}, | ||
certmanagerCertificateDelete: async (_parent, args: object) => { | ||
try { | ||
const res = await k8sApi.deleteNamespacedCustomObject('cert-manager.io','v1',args['namespace'],'certificates', args['name']) | ||
return res.body | ||
} catch (err) { | ||
console.error((err as object)['body']); | ||
} | ||
return null | ||
}, | ||
certmanagerCertificatePatch: async (_parent, args: object) => { | ||
const request = { | ||
apiVersion: 'cert-manager.io/v1', | ||
kind: 'io.cert-manager.v1.Certificate', | ||
metadata: getMetaNS(args), | ||
} | ||
if (args['spec'] != undefined && args['spec'] != null) | ||
request["spec"] = args['spec']; | ||
try { | ||
const resGet = await k8sApi.getNamespacedCustomObject('cert-manager.io','v1',args['namespace'],'certificates', args['name']) | ||
const payload = rfc6902.createPatch(resGet.body,request).filter(rule => !rule.path.startsWith('/status') && !['/metadata/creationTimestamp', '/metadata/finalizers', '/metadata/generation', '/metadata/managedFields', '/metadata/resourceVersion','/metadata/uid'].includes(rule.path) ) | ||
const options = { "headers": { "Content-type": k8s.PatchUtils.PATCH_FORMAT_JSON_PATCH}}; | ||
const res = await k8sApi.patchNamespacedCustomObject('cert-manager.io','v1',args['namespace'],'certificates', args['name'], payload, undefined, undefined, undefined, options) | ||
return res.body | ||
} catch (err) { | ||
console.error((err as object)['body']); | ||
} | ||
return null | ||
}, | ||
}; | ||
export const lists = { | ||
certmanagerCertificate: async (_parent, args: object) => { | ||
let lst:Array<object>|undefined = cache.get(`Certificate.${args['namespace']}`) | ||
if (lst==undefined) { | ||
try { | ||
const res = await k8sApi.listNamespacedCustomObject('cert-manager.io','v1',args['namespace'],'certificates') | ||
lst = (res as object)['body']['items'] as Array<object> | ||
cache.set(`Certificate.${args['namespace']}`, lst, 2); | ||
} catch (err) { | ||
console.error((err as object)['body']); | ||
return [] | ||
} | ||
} | ||
return lst.filter(o=>applyFilter(o,args)).map(o=>applyFieldSelection(o,args)) | ||
} | ||
}; | ||
export const resolvers = { | ||
}; | ||
export const nsResolver = { | ||
certmanagerCertificate: async (parent, args: object) => { | ||
return lists.certmanagerCertificate(parent,{namespace: parent.metadata.name, ...args}) | ||
} | ||
}; | ||
|
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,75 @@ | ||
import k8s from '@kubernetes/client-node'; | ||
import rfc6902 from 'rfc6902'; | ||
import {kc, cache, applyFilter, applyFieldSelection, getByPath, getMetaNS } from '../k8slibs.js'; | ||
|
||
const k8sApi = kc.makeApiClient(k8s.CustomObjectsApi); | ||
|
||
export const mutations = { | ||
certmanagerCertificateRequestCreate: async (_parent, args: object) => { | ||
const payload = { | ||
apiVersion: 'cert-manager.io/v1', | ||
kind: 'io.cert-manager.v1.CertificateRequest', | ||
metadata: getMetaNS(args), | ||
"spec": args['spec'], | ||
} | ||
try { | ||
const res = await k8sApi.createNamespacedCustomObject('cert-manager.io','v1',args['namespace'],'certificaterequests', payload) | ||
return res.body | ||
} catch (err) { | ||
console.error((err as object)['body']); | ||
} | ||
return null | ||
}, | ||
certmanagerCertificateRequestDelete: async (_parent, args: object) => { | ||
try { | ||
const res = await k8sApi.deleteNamespacedCustomObject('cert-manager.io','v1',args['namespace'],'certificaterequests', args['name']) | ||
return res.body | ||
} catch (err) { | ||
console.error((err as object)['body']); | ||
} | ||
return null | ||
}, | ||
certmanagerCertificateRequestPatch: async (_parent, args: object) => { | ||
const request = { | ||
apiVersion: 'cert-manager.io/v1', | ||
kind: 'io.cert-manager.v1.CertificateRequest', | ||
metadata: getMetaNS(args), | ||
} | ||
if (args['spec'] != undefined && args['spec'] != null) | ||
request["spec"] = args['spec']; | ||
try { | ||
const resGet = await k8sApi.getNamespacedCustomObject('cert-manager.io','v1',args['namespace'],'certificaterequests', args['name']) | ||
const payload = rfc6902.createPatch(resGet.body,request).filter(rule => !rule.path.startsWith('/status') && !['/metadata/creationTimestamp', '/metadata/finalizers', '/metadata/generation', '/metadata/managedFields', '/metadata/resourceVersion','/metadata/uid'].includes(rule.path) ) | ||
const options = { "headers": { "Content-type": k8s.PatchUtils.PATCH_FORMAT_JSON_PATCH}}; | ||
const res = await k8sApi.patchNamespacedCustomObject('cert-manager.io','v1',args['namespace'],'certificaterequests', args['name'], payload, undefined, undefined, undefined, options) | ||
return res.body | ||
} catch (err) { | ||
console.error((err as object)['body']); | ||
} | ||
return null | ||
}, | ||
}; | ||
export const lists = { | ||
certmanagerCertificateRequest: async (_parent, args: object) => { | ||
let lst:Array<object>|undefined = cache.get(`CertificateRequest.${args['namespace']}`) | ||
if (lst==undefined) { | ||
try { | ||
const res = await k8sApi.listNamespacedCustomObject('cert-manager.io','v1',args['namespace'],'certificaterequests') | ||
lst = (res as object)['body']['items'] as Array<object> | ||
cache.set(`CertificateRequest.${args['namespace']}`, lst, 2); | ||
} catch (err) { | ||
console.error((err as object)['body']); | ||
return [] | ||
} | ||
} | ||
return lst.filter(o=>applyFilter(o,args)).map(o=>applyFieldSelection(o,args)) | ||
} | ||
}; | ||
export const resolvers = { | ||
}; | ||
export const nsResolver = { | ||
certmanagerCertificateRequest: async (parent, args: object) => { | ||
return lists.certmanagerCertificateRequest(parent,{namespace: parent.metadata.name, ...args}) | ||
} | ||
}; | ||
|
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,75 @@ | ||
import k8s from '@kubernetes/client-node'; | ||
import rfc6902 from 'rfc6902'; | ||
import {kc, cache, applyFilter, applyFieldSelection, getByPath, getMetaNS } from '../k8slibs.js'; | ||
|
||
const k8sApi = kc.makeApiClient(k8s.CustomObjectsApi); | ||
|
||
export const mutations = { | ||
certmanagerChallengeCreate: async (_parent, args: object) => { | ||
const payload = { | ||
apiVersion: 'acme.cert-manager.io/v1', | ||
kind: 'io.cert-manager.acme.v1.Challenge', | ||
metadata: getMetaNS(args), | ||
"spec": args['spec'], | ||
} | ||
try { | ||
const res = await k8sApi.createNamespacedCustomObject('acme.cert-manager.io','v1',args['namespace'],'challenges', payload) | ||
return res.body | ||
} catch (err) { | ||
console.error((err as object)['body']); | ||
} | ||
return null | ||
}, | ||
certmanagerChallengeDelete: async (_parent, args: object) => { | ||
try { | ||
const res = await k8sApi.deleteNamespacedCustomObject('acme.cert-manager.io','v1',args['namespace'],'challenges', args['name']) | ||
return res.body | ||
} catch (err) { | ||
console.error((err as object)['body']); | ||
} | ||
return null | ||
}, | ||
certmanagerChallengePatch: async (_parent, args: object) => { | ||
const request = { | ||
apiVersion: 'acme.cert-manager.io/v1', | ||
kind: 'io.cert-manager.acme.v1.Challenge', | ||
metadata: getMetaNS(args), | ||
} | ||
if (args['spec'] != undefined && args['spec'] != null) | ||
request["spec"] = args['spec']; | ||
try { | ||
const resGet = await k8sApi.getNamespacedCustomObject('acme.cert-manager.io','v1',args['namespace'],'challenges', args['name']) | ||
const payload = rfc6902.createPatch(resGet.body,request).filter(rule => !rule.path.startsWith('/status') && !['/metadata/creationTimestamp', '/metadata/finalizers', '/metadata/generation', '/metadata/managedFields', '/metadata/resourceVersion','/metadata/uid'].includes(rule.path) ) | ||
const options = { "headers": { "Content-type": k8s.PatchUtils.PATCH_FORMAT_JSON_PATCH}}; | ||
const res = await k8sApi.patchNamespacedCustomObject('acme.cert-manager.io','v1',args['namespace'],'challenges', args['name'], payload, undefined, undefined, undefined, options) | ||
return res.body | ||
} catch (err) { | ||
console.error((err as object)['body']); | ||
} | ||
return null | ||
}, | ||
}; | ||
export const lists = { | ||
certmanagerChallenge: async (_parent, args: object) => { | ||
let lst:Array<object>|undefined = cache.get(`Challenge.${args['namespace']}`) | ||
if (lst==undefined) { | ||
try { | ||
const res = await k8sApi.listNamespacedCustomObject('acme.cert-manager.io','v1',args['namespace'],'challenges') | ||
lst = (res as object)['body']['items'] as Array<object> | ||
cache.set(`Challenge.${args['namespace']}`, lst, 2); | ||
} catch (err) { | ||
console.error((err as object)['body']); | ||
return [] | ||
} | ||
} | ||
return lst.filter(o=>applyFilter(o,args)).map(o=>applyFieldSelection(o,args)) | ||
} | ||
}; | ||
export const resolvers = { | ||
}; | ||
export const nsResolver = { | ||
certmanagerChallenge: async (parent, args: object) => { | ||
return lists.certmanagerChallenge(parent,{namespace: parent.metadata.name, ...args}) | ||
} | ||
}; | ||
|
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,73 @@ | ||
import k8s from '@kubernetes/client-node'; | ||
import rfc6902 from 'rfc6902'; | ||
import {kc, cache, applyFilter, applyFieldSelection, getByPath, getMeta } from '../k8slibs.js'; | ||
|
||
const k8sApi = kc.makeApiClient(k8s.CustomObjectsApi); | ||
|
||
export const mutations = { | ||
certmanagerClusterIssuerCreate: async (_parent, args: object) => { | ||
const payload = { | ||
apiVersion: 'cert-manager.io/v1', | ||
kind: 'io.cert-manager.v1.ClusterIssuer', | ||
metadata: getMeta(args), | ||
"spec": args['spec'], | ||
} | ||
try { | ||
const res = await k8sApi.createClusterCustomObject('cert-manager.io','v1','clusterissuers', payload) | ||
return res.body | ||
} catch (err) { | ||
console.error((err as object)['body']); | ||
} | ||
return null | ||
}, | ||
certmanagerClusterIssuerDelete: async (_parent, args: object) => { | ||
try { | ||
const res = await k8sApi.deleteClusterCustomObject('cert-manager.io','v1','clusterissuers', args['name']) | ||
return res.body | ||
} catch (err) { | ||
console.error((err as object)['body']); | ||
} | ||
return null | ||
}, | ||
certmanagerClusterIssuerPatch: async (_parent, args: object) => { | ||
const request = { | ||
apiVersion: 'cert-manager.io/v1', | ||
kind: 'io.cert-manager.v1.ClusterIssuer', | ||
metadata: getMeta(args), | ||
} | ||
if (args['spec'] != undefined && args['spec'] != null) | ||
request["spec"] = args['spec']; | ||
try { | ||
const resGet = await k8sApi.getClusterCustomObject('cert-manager.io','v1','clusterissuers', args['name']) | ||
const payload = rfc6902.createPatch(resGet.body,request).filter(rule => !rule.path.startsWith('/status') && !['/metadata/creationTimestamp', '/metadata/finalizers', '/metadata/generation', '/metadata/managedFields', '/metadata/resourceVersion','/metadata/uid'].includes(rule.path) ) | ||
const options = { "headers": { "Content-type": k8s.PatchUtils.PATCH_FORMAT_JSON_PATCH}}; | ||
const res = await k8sApi.patchClusterCustomObject('cert-manager.io','v1','clusterissuers', args['name'], payload, undefined, undefined, undefined, options) | ||
return res.body | ||
} catch (err) { | ||
console.error((err as object)['body']); | ||
} | ||
return null | ||
}, | ||
}; | ||
export const lists = { | ||
certmanagerClusterIssuer: async (_parent, args: object) => { | ||
let lst:Array<object>|undefined = cache.get('ClusterIssuer') | ||
if (lst==undefined) { | ||
try { | ||
const res = await k8sApi.listClusterCustomObject('cert-manager.io','v1','clusterissuers') | ||
lst = (res as object)['body']['items'] as Array<object> | ||
cache.set('ClusterIssuer', lst, 2); | ||
} catch (err) { | ||
console.error((err as object)['body']); | ||
return [] | ||
} | ||
} | ||
return lst.filter(o=>applyFilter(o,args)).map(o=>applyFieldSelection(o,args)) | ||
} | ||
}; | ||
export const queries = { | ||
certmanagerClusterIssuer: lists.certmanagerClusterIssuer, | ||
}; | ||
export const resolvers = { | ||
}; | ||
|
Oops, something went wrong.