-
Notifications
You must be signed in to change notification settings - Fork 63
Migrate to devfile/api v1alpha2 and add conversion webhooks. #197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 31 commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
b62c112
Update scripts to grab devfile/api DevWorkspaceTemplates
amisevsk 34e8837
Update project latest devfile/api
amisevsk 42d3506
Update Makefile to generate v1 CRDs and add a few rules
amisevsk c65655e
Update go code to use v1alpha2 devfile/api
amisevsk db8edf4
Regenerate deepcopy, crds after updating to v1alpha2
amisevsk 0b213fe
Clean up unused templates kustomize directories
amisevsk b4bcc9e
Add yaml templates for generating certs using cert-manager
amisevsk c2e6c41
Add templates for deploying controller with cert-manager on k8s
amisevsk 7837690
Rename config/devel to config/base
amisevsk d37dc52
Update webhooks server to create conversion webhooks
amisevsk 3cd22e7
Workaround: uninstall CRDs when running make install
amisevsk 145e464
Make webhooks handle both v1alpha1 and v1alpha2 DevWorkspaces
amisevsk a41126b
Fix deployment templates TODOs around namespace and service name
amisevsk 5593e46
Fix rest APIs generator to manually set v1alpha2 defaults
amisevsk c2ccf22
fixup namespace for certificates
amisevsk 453e5fe
Add support for Service CA operator on OpenShift
amisevsk 54f05a4
fixup go.mod
amisevsk 2c8c08a
Test fix for running locally on minikube
amisevsk 28a8107
Adapt code to use new format for Attributes
davidfestal 4367041
Update the samples to use v1alpha2
davidfestal ee92eb6
Add the all-in-one sample to validate plugins
davidfestal 10f5a7d
Use the initContainer library
davidfestal 51e99fb
Update subresource CRDs
amisevsk 8b2dbb8
Adapt to attributes + fix endpoints
davidfestal ed9335e
Additional small fixes
davidfestal f3a91d1
Add "get devworkspaces" permission to workspace SA rbac
amisevsk b3a6596
Update to the latest changes ...
davidfestal f436169
Add gitignore entry for binary debug file
amisevsk a824a02
Format all files and regenerate CRDs
amisevsk 41bbd3f
Restore old samples to v1alpha1 state
amisevsk c4a4a2a
Adapt initContainer library tests to use v1alpha2
amisevsk 347a494
Fixups from review: cleanup Makefile, constant names, error message
amisevsk 402dd32
Fix default DEVWORKSPACE_API_VERSION in Makefile
amisevsk 6c382c6
Remove workaround for kubectl hang when updating resources
amisevsk d07a663
Fix variable redeclaration issue
amisevsk 8d0ce24
Add loglines for which certs are used for serving webhooks
amisevsk 7cdb46e
Fixups from review
amisevsk e442355
Update devfile/api dependency and clean up related scripts
amisevsk cedfe3d
Rework how initContainer components are added to a workspace
amisevsk ef02001
Fix name prefixing issue for cert-manager deployment
amisevsk fbb2adc
Fix openshift-oauth after v1alpha2 changes
sleshchenko e44d34e
Reorganize config directory and add a bit of documentation
amisevsk d1c3aab
Remove rules for bundling from Makefile as they are out of date
amisevsk 9485a2b
Remove installing CRDs from e2e test as that rule has been removed
amisevsk e7e788d
Fix detecting the type of devfile/api version
sleshchenko 933cd78
Fix _init_devworkspace_crds in CI
amisevsk 0a612c6
Make sure defaulted fields are set in the default dockerimage component
amisevsk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
This file contains hidden or 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,36 @@ | ||
# Adds namespace to all resources. | ||
namespace: devworkspace-operator | ||
|
||
# Prefix for names of all resources created by this kustomization | ||
namePrefix: devworkspace-controller- | ||
|
||
# Labels to add to all resources and selectors. | ||
commonLabels: | ||
app.kubernetes.io/name: devworkspace-controller | ||
app.kubernetes.io/part-of: devworkspace-operator | ||
|
||
bases: | ||
- ../components/manager | ||
- ../components/rbac | ||
- ../crd | ||
|
||
generatorOptions: | ||
disableNameSuffixHash: true | ||
|
||
configMapGenerator: | ||
- name: configmap | ||
envs: | ||
- config.properties | ||
|
||
patchesStrategicMerge: | ||
- manager_image_patch.yaml | ||
|
||
vars: | ||
- name: OPERATOR_NAMESPACE | ||
objref: | ||
kind: Deployment | ||
group: apps | ||
version: v1 | ||
name: manager | ||
fieldref: | ||
fieldpath: metadata.namespace |
This file contains hidden or 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 hidden or 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,41 @@ | ||
# Add webhooks to the devfile/api CRDs | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: devworkspaces.workspace.devfile.io | ||
annotations: | ||
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) | ||
spec: | ||
conversion: | ||
strategy: Webhook | ||
webhook: | ||
conversionReviewVersions: ["v1"] | ||
clientConfig: | ||
service: | ||
namespace: devworkspace-operator | ||
# Note: service name is hard-coded in pkg/webhook/server/server.go | ||
name: devworkspace-webhookserver | ||
path: /convert | ||
# caBundle will be filled by cert-manager on creation | ||
caBundle: Cg== | ||
--- | ||
# Add webhooks to the devfile/api CRDs | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: devworkspacetemplates.workspace.devfile.io | ||
annotations: | ||
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) | ||
spec: | ||
conversion: | ||
strategy: Webhook | ||
webhook: | ||
conversionReviewVersions: ["v1"] | ||
clientConfig: | ||
service: | ||
namespace: devworkspace-operator | ||
# Note: service name is hard-coded in pkg/webhook/server/server.go | ||
name: devworkspace-webhookserver | ||
path: /convert | ||
# caBundle will be filled by cert-manager on creation | ||
caBundle: Cg== |
This file contains hidden or 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,34 @@ | ||
# Adds namespace to all resources. | ||
namespace: ${NAMESPACE} | ||
|
||
bases: | ||
- ../base | ||
- ../components/certificates/cert-manager | ||
|
||
patchesStrategicMerge: | ||
- manager_certmanager_patch.yaml | ||
- crd_webhooks_patch.yaml | ||
|
||
vars: | ||
- name: WEBHOOK_CA_SECRET_NAME | ||
objref: | ||
kind: Certificate | ||
group: cert-manager.io | ||
version: v1 | ||
name: serving-cert | ||
fieldref: | ||
fieldpath: spec.secretName | ||
- name: CERTIFICATE_NAMESPACE | ||
objref: | ||
kind: Certificate | ||
group: cert-manager.io | ||
version: v1 | ||
name: serving-cert | ||
fieldref: | ||
fieldpath: metadata.namespace | ||
- name: CERTIFICATE_NAME | ||
objref: | ||
kind: Certificate | ||
group: cert-manager.io | ||
version: v1 | ||
name: serving-cert |
This file contains hidden or 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,15 @@ | ||
# This patch adds an environment variable to the workspace deployment | ||
# to allow it to figure out which secret to use for the webhooks deployment | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: manager | ||
namespace: system | ||
amisevsk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: devworkspace-controller | ||
env: | ||
- name: WEBHOOK_SECRET_NAME | ||
value: $(WEBHOOK_CA_SECRET_NAME) |
3 changes: 1 addition & 2 deletions
3
config/components/webhook/kustomization.yaml → ...tificates/cert-manager/kustomization.yaml
This file contains hidden or 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,6 +1,5 @@ | ||
resources: | ||
- manifests.yaml | ||
- service.yaml | ||
- self-signed-certificates.yaml | ||
|
||
configurations: | ||
- kustomizeconfig.yaml |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.