Skip to content
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

Fix create service webview #3435

Merged
merged 1 commit into from
Oct 30, 2023

Conversation

datho7561
Copy link
Contributor

@datho7561 datho7561 commented Oct 13, 2023

  • Move the create service button from the Kubernetes tree to the context menu for the cluster
  • Add a page to the wizard to select which CustomResourceDefinition (CRD) to create an instance of, in lieu of using the Kubernetes tree to select the CRD
    • Show the documentation for the Operator that corresponds with the CRD on this page, since many Operators require additional post-installation steps before their associated CRDs work as expected
  • Material UI 5 -ify the form page
  • Add a Patternfly-like collapse widget for displaying nested objects
  • Remove properties from the schema if they are not required and aren't configured in the example YAML
  • If the user doesn't have access to list CRDs, drop them into a YAML editor with the example YAML for the CRD
    • We used to try to scrape the schema for the CRD from the swagger definitions, but I removed this, since the schema in the swagger definitions is often missing many properties and requires further processing to get it to work with React JsonSchema Form

Fixes #3081

Signed-off-by: David Thompson [email protected]

@codecov
Copy link

codecov bot commented Oct 13, 2023

Codecov Report

Attention: 139 lines in your changes are missing coverage. Please review.

Comparison is base (f11efa8) 35.43% compared to head (180f93d) 35.10%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3435      +/-   ##
==========================================
- Coverage   35.43%   35.10%   -0.34%     
==========================================
  Files          79       78       -1     
  Lines        5613     5629      +16     
  Branches     1116     1113       -3     
==========================================
- Hits         1989     1976      -13     
- Misses       3624     3653      +29     
Files Coverage Δ
src/extension.ts 68.36% <ø> (ø)
src/k8s/csv.ts 22.72% <ø> (+1.20%) ⬆️
src/oc/ocWrapper.ts 69.81% <80.00%> (+0.50%) ⬆️
src/openshift/service.ts 80.00% <80.00%> (ø)
.../webview/create-service/createServiceViewLoader.ts 13.12% <10.45%> (-18.13%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@datho7561 datho7561 force-pushed the 3081-fix-create-service branch from 4eeb5b0 to 2bc907d Compare October 16, 2023 14:53
@datho7561
Copy link
Contributor Author

new-create-service-demo.mp4

Here is a demo. In this demo, I first use "Create Operator-backed Service" while logged in as "kubeadmin". As kubeadmin, I have access to the JSON schemas for CustomResourceDefinitions (CRDs). This means I can generate a form to specify the required information to create the service. In most non-OpenShift clusters that are designed to run on your development machine (such as k3s, minikube, kind), you can access the CRDs by default.

After I have created a MongoDB instance using the kubeadmin account, I log in as "developer". I go through the same steps to create a new MongoDB instance, but instead of a form, I am given a YAML document containing the example YAML for the MongoDB CRD. This is because the developer account for OpenShift Local, doesn't have access to the full JSON schema for the MongoDB CRD. I can use "Kubernetes: Create" or "OpenShift: Create" to create the instance of the service specified by the YAML, and can save the YAML for future use.

- Move the create service button from the Kubernetes tree
  to the context menu for the cluster
- Add a page to the wizard to select which CustomResourceDefinition
  (CRD) to create an instance of,
  in lieu of using the Kubernetes tree to select the CRD
  - Show the documentation for the Operator that corresponds with the
    CRD on this page,
    since many Operators require additional post-installation steps
    before their associated CRDs work as expected
- Material UI 5 -ify the form page
- Add a Patternfly-like collpase widget for displaying nested objects
- Remove properties from the schema if they are not required and aren't
  configured in the example YAML
- If the user doesn't have access to list CRDs,
  drop them into a YAML editor with the example YAML for the CRD
  - We used to try to scrape the schema for the CRD from the swagger definitions,
    but I removed this, since the schema in the swagger definitions is
    often missing many properties and requires further processing to get
    it to work with React JsonSchema Form

Fixes redhat-developer#3081

Signed-off-by: David Thompson <[email protected]>
@datho7561 datho7561 force-pushed the 3081-fix-create-service branch from 2bc907d to 180f93d Compare October 26, 2023 16:36
Copy link
Collaborator

@mohitsuman mohitsuman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@datho7561 datho7561 merged commit 4738fda into redhat-developer:main Oct 30, 2023
@datho7561 datho7561 deleted the 3081-fix-create-service branch October 30, 2023 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix "Create Service" view
2 participants