-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add knative-eventing, knative-serving and triggermesh CRDs (#387)
* feat: Add knative-eventing and knative-serving CRDs * fix: config errors * feat: add mapContainers patch for service resource * chore: add patch dir * feat: add triggermesh CRDs * feat: update workflow --------- Co-authored-by: Giles Rapkin <[email protected]>
- Loading branch information
1 parent
38a92f1
commit 81b00ff
Showing
5 changed files
with
214 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1499,6 +1499,86 @@ | |
"SSH_KEY": "${{ secrets.DEPLOY_KEY }}" | ||
"if": "steps.filter.outputs.workflows == 'true'" | ||
"run": "make libs/keda" | ||
"knative-eventing": | ||
"name": "Generate knative-eventing Jsonnet library and docs" | ||
"needs": | ||
- "build" | ||
- "repos" | ||
"runs-on": "ubuntu-latest" | ||
"steps": | ||
- "uses": "actions/checkout@v3" | ||
- "id": "filter" | ||
"uses": "dorny/paths-filter@v2" | ||
"with": | ||
"filters": | | ||
workflows: | ||
- '.github/**' | ||
- 'bin/**' | ||
- 'Dockerfile' | ||
- 'go.mod' | ||
- 'go.sum' | ||
- 'jsonnet/**' | ||
- 'main.go' | ||
- 'Makefile' | ||
- 'pkg/**' | ||
- 'scripts/**' | ||
- 'tf/**' | ||
- 'libs/knative-eventing/**' | ||
- "if": "steps.filter.outputs.workflows == 'true'" | ||
"uses": "actions/download-artifact@v2" | ||
"with": | ||
"name": "docker-artifact" | ||
"path": "artifacts" | ||
- "if": "steps.filter.outputs.workflows == 'true'" | ||
"run": "make load" | ||
- "env": | ||
"DIFF": "true" | ||
"GEN_COMMIT": "${{ github.ref == 'refs/heads/master' && github.repository == 'jsonnet-libs/k8s' }}" | ||
"GIT_COMMITTER_EMAIL": "[email protected]" | ||
"GIT_COMMITTER_NAME": "jsonnet-libs-bot" | ||
"SSH_KEY": "${{ secrets.DEPLOY_KEY }}" | ||
"if": "steps.filter.outputs.workflows == 'true'" | ||
"run": "make libs/knative-eventing" | ||
"knative-serving": | ||
"name": "Generate knative-serving Jsonnet library and docs" | ||
"needs": | ||
- "build" | ||
- "repos" | ||
"runs-on": "ubuntu-latest" | ||
"steps": | ||
- "uses": "actions/checkout@v3" | ||
- "id": "filter" | ||
"uses": "dorny/paths-filter@v2" | ||
"with": | ||
"filters": | | ||
workflows: | ||
- '.github/**' | ||
- 'bin/**' | ||
- 'Dockerfile' | ||
- 'go.mod' | ||
- 'go.sum' | ||
- 'jsonnet/**' | ||
- 'main.go' | ||
- 'Makefile' | ||
- 'pkg/**' | ||
- 'scripts/**' | ||
- 'tf/**' | ||
- 'libs/knative-serving/**' | ||
- "if": "steps.filter.outputs.workflows == 'true'" | ||
"uses": "actions/download-artifact@v2" | ||
"with": | ||
"name": "docker-artifact" | ||
"path": "artifacts" | ||
- "if": "steps.filter.outputs.workflows == 'true'" | ||
"run": "make load" | ||
- "env": | ||
"DIFF": "true" | ||
"GEN_COMMIT": "${{ github.ref == 'refs/heads/master' && github.repository == 'jsonnet-libs/k8s' }}" | ||
"GIT_COMMITTER_EMAIL": "[email protected]" | ||
"GIT_COMMITTER_NAME": "jsonnet-libs-bot" | ||
"SSH_KEY": "${{ secrets.DEPLOY_KEY }}" | ||
"if": "steps.filter.outputs.workflows == 'true'" | ||
"run": "make libs/knative-serving" | ||
"kube-prometheus": | ||
"name": "Generate kube-prometheus Jsonnet library and docs" | ||
"needs": | ||
|
@@ -2015,6 +2095,8 @@ | |
- "k8s" | ||
- "karpenter" | ||
- "keda" | ||
- "knative-eventing" | ||
- "knative-serving" | ||
- "kube-prometheus" | ||
- "kubernetes-nmstate" | ||
- "kubernetes-secret-generator" | ||
|
@@ -2031,6 +2113,7 @@ | |
- "strimzi" | ||
- "teleport-operator" | ||
- "traefik" | ||
- "triggermesh" | ||
- "vault-secrets-operator" | ||
- "vertical-pod-autoscaler" | ||
- "zalando-postgres-operator" | ||
|
@@ -2268,6 +2351,46 @@ | |
"SSH_KEY": "${{ secrets.DEPLOY_KEY }}" | ||
"if": "steps.filter.outputs.workflows == 'true'" | ||
"run": "make libs/traefik" | ||
"triggermesh": | ||
"name": "Generate triggermesh Jsonnet library and docs" | ||
"needs": | ||
- "build" | ||
- "repos" | ||
"runs-on": "ubuntu-latest" | ||
"steps": | ||
- "uses": "actions/checkout@v3" | ||
- "id": "filter" | ||
"uses": "dorny/paths-filter@v2" | ||
"with": | ||
"filters": | | ||
workflows: | ||
- '.github/**' | ||
- 'bin/**' | ||
- 'Dockerfile' | ||
- 'go.mod' | ||
- 'go.sum' | ||
- 'jsonnet/**' | ||
- 'main.go' | ||
- 'Makefile' | ||
- 'pkg/**' | ||
- 'scripts/**' | ||
- 'tf/**' | ||
- 'libs/triggermesh/**' | ||
- "if": "steps.filter.outputs.workflows == 'true'" | ||
"uses": "actions/download-artifact@v2" | ||
"with": | ||
"name": "docker-artifact" | ||
"path": "artifacts" | ||
- "if": "steps.filter.outputs.workflows == 'true'" | ||
"run": "make load" | ||
- "env": | ||
"DIFF": "true" | ||
"GEN_COMMIT": "${{ github.ref == 'refs/heads/master' && github.repository == 'jsonnet-libs/k8s' }}" | ||
"GIT_COMMITTER_EMAIL": "[email protected]" | ||
"GIT_COMMITTER_NAME": "jsonnet-libs-bot" | ||
"SSH_KEY": "${{ secrets.DEPLOY_KEY }}" | ||
"if": "steps.filter.outputs.workflows == 'true'" | ||
"run": "make libs/triggermesh" | ||
"vault-secrets-operator": | ||
"name": "Generate vault-secrets-operator Jsonnet library and docs" | ||
"needs": | ||
|
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,16 @@ | ||
local config = import 'jsonnet/config.jsonnet'; | ||
|
||
local versions = ['1.13.1', '1.12.4', '1.11.10']; | ||
|
||
config.new( | ||
name='knative-eventing', | ||
specs=[ | ||
{ | ||
output: v, | ||
crds: ['https://github.com/knative/eventing/releases/download/knative-v%s/eventing-crds.yaml' % v], | ||
prefix: '^dev\\.knative\\..*', | ||
localName: 'knative-eventing', | ||
}, | ||
for v in versions | ||
] | ||
) |
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,17 @@ | ||
local config = import 'jsonnet/config.jsonnet'; | ||
|
||
local versions = ['1.13.1', '1.12.3', '1.11.6']; | ||
|
||
config.new( | ||
name='knative-serving', | ||
specs=[ | ||
{ | ||
output: v, | ||
crds: ['https://github.com/knative/serving/releases/download/knative-v%s/serving-crds.yaml' % v], | ||
prefix: '^dev\\.knative\\..*', | ||
patchDir: 'custom/serving', | ||
localName: 'knative-serving', | ||
}, | ||
for v in versions | ||
] | ||
) |
42 changes: 42 additions & 0 deletions
42
libs/knative-serving/custom/serving/mapContainers.libsonnet
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,42 @@ | ||
local d = import 'doc-util/main.libsonnet'; | ||
|
||
local patch = { | ||
'#mapContainers': d.fn( | ||
||| | ||
`mapContainers` applies the function f to each container. | ||
It works exactly as `std.map`, but on the containers of this object. | ||
**Signature of `f`**: | ||
```ts | ||
f(container: Object) Object | ||
``` | ||
|||, | ||
[d.arg('f', d.T.func)] | ||
), | ||
mapContainers(f, includeInitContainers=false):: { | ||
local podContainers = super.spec.template.spec.containers, | ||
local podInitContainers = super.spec.template.spec.initContainers, | ||
spec+: { | ||
template+: { | ||
spec+: { | ||
containers: std.map(f, podContainers), | ||
[if includeInitContainers then 'initContainers']: std.map(f, podInitContainers), | ||
}, | ||
}, | ||
}, | ||
}, | ||
|
||
'#mapContainersWithName': d.fn('`mapContainersWithName` is like `mapContainers`, but only applies to those containers in the `names` array', | ||
[d.arg('names', d.T.array), d.arg('f', d.T.func)]), | ||
mapContainersWithName(names, f, includeInitContainers=false):: | ||
local nameSet = if std.type(names) == 'array' then std.set(names) else std.set([names]); | ||
local inNameSet(name) = std.length(std.setInter(nameSet, std.set([name]))) > 0; | ||
|
||
self.mapContainers(function(c) if std.objectHas(c, 'name') && inNameSet(c.name) then f(c) else c, includeInitContainers), | ||
}; | ||
|
||
{ | ||
serving+: { v1+: { | ||
service+: patch, | ||
} }, | ||
} |
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,16 @@ | ||
local config = import 'jsonnet/config.jsonnet'; | ||
|
||
local versions = ['1.27.0']; | ||
|
||
config.new( | ||
name='triggermesh', | ||
specs=[ | ||
{ | ||
output: v, | ||
crds: ['https://github.com/triggermesh/triggermesh/releases/download/v%s/triggermesh-crds.yaml' % v], | ||
prefix: '^io\\.triggermesh\\..*', | ||
localName: 'triggermesh', | ||
}, | ||
for v in versions | ||
] | ||
) |