Giter Site home page Giter Site logo

crane-ui-plugin's People

Contributors

dependabot[bot] avatar djzager avatar ibolton336 avatar jaydipgabani avatar jmontleon avatar mberube99 avatar mturley avatar pranavgaikwad avatar seanforyou23 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

crane-ui-plugin's Issues

Wizard should be aware of which page you came from (Add vs management page) and go back to the correct place on Cancel

Currently clicking Cancel in the wizard takes you to the Add page even if you reached the wizard from the management page.

@vconzola and I also realized that when you go to the wizard directly from the management page, you may never see the description on the Add card "Import a manually deployed application on another cluster to an automated GitOps workflow". Maybe that's fine? One idea was to open a modal with that description when you reach the wizard if you came from the management page. Needs further discussion.

Parameter mismatch in crane-transfer-pvc from UI

When you try to migrate an application with PVC the following error comes up in transfer-pvc task

invalid input params for task crane-transfer-pvc: didn't need these params but they were provided anyway: [dest-pvc-capacity]

Cause of the error seem to be a parameter mismatch here which should be this.

Implement localization or remove the react-i18next dependency

The dynamic plugin guidelines state that we should use react-i18next for localization, and the template repo we started with already had it installed. We currently still have it as a dependency but we are not using it (all text is just hard-coded in English).

We need to decide whether we will actually be doing localization. If so, we need to determine a process for that and implement it, and if not we should remove this dependency.

Pipeline bug fixes for e2e demo

Here's a patch for hitting 3 bugs I had to fix with the tasks

diff --git a/src/api/pipelineHelpers.ts b/src/api/pipelineHelpers.ts
index b816dfe..3113669 100644
--- a/src/api/pipelineHelpers.ts
+++ b/src/api/pipelineHelpers.ts
@@ -83,7 +83,7 @@ export const formsToTektonResources = (
           params: [
             {
               name: 'cluster-secret',
-              value: '$(params.source-cluster-secret)',
+              value: '$(params.destination-cluster-secret)',
             },
             {
               name: 'context-name',
@@ -228,6 +228,10 @@ export const formsToTektonResources = (
               name: 'kustomize',
               workspace: 'shared-data',
             },
+            {
+              name: 'kubeconfig',
+              workspace: 'kubeconfig',
+            },
           ],
         },
       ],
@@ -277,7 +281,17 @@ export const formsToTektonResources = (
         },
         {
           name: 'kubeconfig',
-          emptyDir: {},
+          volumeClaimTemplate: {
+            spec: {
+              accessModes: ['ReadWriteOnce'],
+              resources: {
+                requests: {
+                  storage: '10Mi',
+                },
+              },
+            },
+          },
         },
       ],
       pipelineRef: {

Replace PF CodeEditor with newly available YAML editor in plugin SDK

There are some issues with syntax highlighting and other styles with the PF CodeEditor we're using due to stylesheets conflicting with the ones for the console's built in editor. Now that that editor is available in the plugin SDK we should switch to it.

Edit: Not sure if this is going to work. The ResourceYAMLEditor exposed by the SDK is intended for editing an existing resource, not editing unsaved YAML before creating a resource. It has save/cancel/reload buttons that don't make sense here and if you click Cancel it will weirdly redirect you to the project resource page. There seems to be no way to disable that behavior and render only the editor itself. This will either be a WONTFIX or we need to enhance the editor in the SDK, and either way it's not going to make Tech Preview.

Edit 2: There's a new development here, we may be getting the plain YAMLEditor in a future SDK version. Discussion here: https://coreos.slack.com/archives/C011BL0FEKZ/p1658168646396789

Revisit filters in the wizard's tables: what's missing?

There is a TODO comment in the PVCEditStep for potentially adding a filter by storage class, with allowed filter values based on the actual storage classes in the table.

We should revisit these tables and see if there are any other filters we should add (from original mockups or otherwise).

403 trying to list namespaces as a non-admin

Trying to migrate from DevSandbox to Single Node OpenShift the UI gets stopped with:

Cannot load source cluster namespaces Request failed with status code 403 namespaces is forbidden: User "rhn-engineering-jmontleo" cannot list resource "namespaces" in API group "" at the cluster scope

After discussing

  • It will be common that non-admins cannot list namespaces at the cluster scope
  • Projects can be listed, but they are OpenShift specific
  • It looks like we can make a request to /api as a sufficient test oc input credentials
  • From their we can either perform a graceful degradation, list projects, try namespaces if it fails, or get the specifed namespace if that fails. Or probably more simply just try to get the specified namespace.

Target PVC name is not validated to be unique

The wizard form validation is missing one check: making sure the user-entered target PVC names don't already exist in the target namespace. This should involve similar logic to the pipeline name uniqueness check (useK8sWatchResource to pull in PVC names to compare with).

Cannot configure crane-proxy when running as non-admin

If I am not an admin on the destination I receive the following error.

Cannot configure crane-proxy
configmaps "crane-proxy" is forbidden: User "jason" cannot get resource "configmaps" in API group "" in the namespace "openshift-migration"

FWIW, the proxy no longer requires use of this config-map. If nothing else does either, we can probably skip trying to access it.

pvc rename leaves pods in a broken state

When a PVC is renamed in the UI the transfer updates the pvc name, but it's not updated on any of the resources that mount it so they're stuck pending looking for the pvc by the old name.

migtools/crane-lib#104 is in progress. Once that's complete and merged we need to fix the ClusterTask (migtools/crane-runner#48) to accept the option, and then we need to update the UI here to pass it in when one or more renames are specified.

Unable to create pipeline to migrate application with multiple PVC

Getting the following error while creating pipeline through UI to migrate application with multiple PVCs

Cannot create Pipeline and PipelineRun
admission webhook "validation.webhook.pipeline.tekton.dev" denied the request: validation failed: expected exactly one, got both: spec.tasks[10].name, spec.tasks[8].name, spec.tasks[9].name invalid value: task transfer-pvc is already present in Graph, can't add it again: duplicate pipeline task: spec.tasks

The cause of the error likely seems to be UI trying to add the same task name transfer-pvc in the pipeline for each PVC present in the namespace that needs to be migrated.

No way to represent a success with warnings scenario at present

There are some cases where a migration might fail to create some resources, but otherwise the migration succeeded.

One scenario we're currently aware of is migrating from a DevSandbox instance to your own OpenShift cluster as a non-admin. In this scenario you will be able to read some resources that can only be created as a cluster admin, such as limitranges.

As a namespace admin on both clusters you will be able to read and export the limitrange, but unable to create it on the destination.

This doesn't affect the application from migrating or running, but at present will cause the pipeline to fail.

In MTC we had the notion of a success with warnings, which would have covered the case where some resources could not be recreated.

[RFE] Generate new pipeline for handling image transfer

Relevant Slack conversation.

In the import wizard, we need to recognize when a source for import includes ImageStreams. If ImageStreams are found we ask the user if they wish to migrate them (future iterations may determine this for the user). The resulting pipeline should look something like:

  1. crane-export targeting source cluster, we must have the manifests
  2. oc-registry-info targeting source and destination clusters
  3. crane-skopeo-sync-gen using the emitted results from oc registry info and
    the export results stored in the common workspace
  4. skopeo-sync targeting destination cluster

Dependent issues include:

Updates based on Shawn's comment https://github.com/konveyor/enhancements/pull/77/files#r922514703 that made me realize we could fallback to oc get route when oc registry info doesn't get us what we want.

Regression in wizard: stale PVC form data can remain after changing source project

If the user proceeds past the Edit PVCs step of the wizard and then goes back to the first step and changes the source project name, the rest of the wizard form state should be reset. Instead, the selected PVCs and their edit values remain cached and e.g. if you proceed to the end of the wizard you may get a stage pipeline even though you didn't select any PVCs for the new project.

Changing anything on the "Source cluster and project" screen should reset the PVC select and edit steps (the form fields whose data comes from the source cluster).

I believe I already fixed a similar issue once, so this may be a regression.

Enable the project switcher bar at the top of the management page and wizard, handle all-projects state properly

See early attempt at this that was closed: #66

By changing the URL prefix to /k8s/ns/:namespace/* the console automatically shows this project switcher at the top of the page. However, when doing this, if the user selects "All projects" in the bar the UI ends up on a 404 page. We can likely work around this by handling that all-namespaces route, but there is a bug in the console that prevents this (BZ coming soon for that, will edit it in here).

161318810-66093b91-aef7-4fe0-b75e-a365a9efe997

However, the URL prefix change is possibly not the best way of implementing this. Comparing to the Add page and Pipelines page, we see they do this without using /k8s in their URL (which is intended for pages representing individual k8s resources) by using components that are not currently exposed by the plugin SDK, CreateProjectListPage and NamespacedPage. I attempted a PR to add these to the SDK but it needs reevaluation: openshift/console#11823

Also, currently when you reach the management page without a project selected, you reach a stub page that just directs you to the Projects page where you can select and create a project, then you have to navigate back to our management page. Using CreateProjectListPage to handle the "all projects" state is a better solution.

"Application Imports" management page - refresh credentials feature

On the management page being introduced in #88, there is an additional feature we've mentioned in meetings that I want to capture: a button somewhere (action in the kebab menu?) for letting the user refresh the oauth tokens stored in the secrets associated with the pipelines.

If the user created the pipelines some time ago, their tokens are likely to have expired. There should be an easy way to refresh them without having to create new pipelines or manually edit secrets. This includes (a) pasting in a new oauth token for the source cluster and (b) triggering a patch via crane-secret-service that will automatically refresh the oauth token for the target/host cluster. Not sure if these should be separate functions or always be done together.

Another idea @vconzola mentioned was that when the user clicks the Stage or Cutover buttons, the UI could first run a check via crane-reverse-proxy to see if the source cluster's token is still valid (and maybe also somehow check the host cluster's token) and prompt the user to refresh it before running the pipelines. We could also possibly just automatically refresh the host oauth token via crane-secret-service immediately before starting any pipelinerun, although that might be too much magic.

Wizard auth step: Once a source namespace is validated, it remains green even if cluster coordinates are changed

Something about the query caching or form state memoization is causing the "project name" field to stay green once it's green for any given value. It should only ever be green if the source cluster credentials are currently valid and that project exists in that cluster.

It's a corner case, but this could bite us if you:

  • Enter valid credentials for cluster A
  • Enter a namespace that is in cluster A, it's marked valid
  • Change the credentials to be valid for cluster B which does not contain the namespace
  • Everything is green and we can proceed through the wizard even though the source namespace doesn't exist

Replace summary tables with DescriptionList after PF bug fix

Now that patternfly/patternfly-react#7061 is merged, if we can upgrade PatternFly we can make use of the DescriptionList with a wider term column for the content at the top of the wizard's Review step (instead of our Table workaround which is less accessible).

I believe that fix is now available in the PF version used by OCP 4.11. We can also use this in other places we have key/value summaries, like on the Project Details step of the wizard and in the summary section of the management page.

Add rollback pipeline?

If we intend to support rollbacks, that would involve generating and managing an additional type of pipeline. Is this in scope? needs investigation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.