1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
Commit Graph

19 Commits

Author SHA1 Message Date
Mikko Aspiala
293cdb87ec Simplify dependencies for a component
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Mikko Aspiala <mikko.aspiala@houston-inc.com>
2021-12-04 12:19:29 +02:00
Mikko Aspiala
cfaf5f9402 Bundle dependencies of a component to a composing object
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Mikko Aspiala <mikko.aspiala@houston-inc.com>
2021-12-04 12:19:12 +02:00
Mikko Aspiala
e0d5c41b3b Add todo for unit testing a weird complication without full understanding
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Mikko Aspiala <mikko.aspiala@houston-inc.com>
2021-12-04 12:18:36 +02:00
Mikko Aspiala
78a989a72a Implement first meaningful unit tests for a complete behavior
Note: in this case, the behavior is even asynchronous, and thus a tool "asyncFn" is used to keep the test as simple as possible.

Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Mikko Aspiala <mikko.aspiala@gmail.com>
2021-12-04 12:18:17 +02:00
Janne Savolainen
ec075ad957 Fix code style
Signed-off-by: Janne Savolainen <janne.savolainen@houston-inc.com>
2021-12-04 12:16:33 +02:00
Janne Savolainen
a2f9a76add Kludge first unit test with more than minimal data
This is a kludge because extraction of segregated interface for KubeObject is very difficult. This commit uses actual instance of KubeObject instead as a fake.

Signed-off-by: Janne Savolainen <janne.savolainen@houston-inc.com>
2021-12-04 12:16:33 +02:00
Janne Savolainen
94d3f6b5fb Make typing of dependency functions more strict
Signed-off-by: Janne Savolainen <janne.savolainen@houston-inc.com>
2021-12-04 12:16:33 +02:00
Janne Savolainen
a0f0d3e811 Improve naming of type parameter
Signed-off-by: Janne Savolainen <janne.savolainen@houston-inc.com>
2021-12-04 12:16:33 +02:00
Janne Savolainen
73e3dd95f4 Make another dependency a segregated interface instead of concrete instance
Notice how interface is in fact segregated, i.e. it only advertises the minimal properties currently required.

With this we satisfy Interface Segregation Principle and thus permit e.g. minimal requirement for stubbing in future unit tests.

Signed-off-by: Janne Savolainen <janne.savolainen@houston-inc.com>
2021-12-04 12:16:33 +02:00
Janne Savolainen
d9e8821d33 Simplify a way of getting cluster name
Signed-off-by: Janne Savolainen <janne.savolainen@houston-inc.com>
2021-12-04 12:16:33 +02:00
Janne Savolainen
29d0634729 Demonstrate even step further to have an interface as dependency instead of concrete instance
Signed-off-by: Janne Savolainen <janne.savolainen@houston-inc.com>
2021-12-04 12:16:33 +02:00
Janne Savolainen
91b14ee3fc Demonstrate a step further to have an interface as dependency instead of concrete instance
With this we get yet closer to satisfaction of Dependency Inversion Principle.

Signed-off-by: Janne Savolainen <janne.savolainen@houston-inc.com>
2021-12-04 12:16:33 +02:00
Janne Savolainen
8d0abcc9d5 Demonstrate naive way to make component not responsible of it's dependencies and not use global shared state
This is to make a step towards satisfaction of Dependency Inversion Principle. It's not fully satisfied because we still depend on concrete instances of classes instead of interfaces.

This will start chain of thought to pursue warm and friendly unit testing and introduction of SOLID principles.

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>
2021-12-04 12:16:33 +02:00
Janne Savolainen
b07b8dc096 Rename method to not be misleading
Signed-off-by: Janne Savolainen <janne.savolainen@houston-inc.com>
2021-12-04 11:55:19 +02:00
Janne Savolainen
10eb95ae67 Implement breadcrumbs for deleting different kube objects
This was done in a naive way by disregarding stuff such as:
- Avoidance of shared global state (dependency inversion principle)
- Unit testing
- Minimal implementation over defensive code (elvis, just in case)
- Full understanding for use cases of all different kube objects

Signed-off-by: Janne Savolainen <janne.savolainen@houston-inc.com>
2021-12-04 11:55:07 +02:00
Sebastian Malton
41863e87ce
Lint: object-curly-spacing (error) (#4198) 2021-11-01 08:45:45 -04:00
Sebastian Malton
4705a66632
Use JSON patch for editing components (#3674) 2021-10-04 16:28:19 -04:00
Jari Kolehmainen
58a446bd45
Refactor k8s api to common (#3553)
* refactor kube api to common

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* refactor more utils to common

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* refactor more utils to common

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* fix tests

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* switch to use node-fetch on both sides

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* cleanup

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* improve logger

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* fix lint errors

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* fix/improve tests

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* fix tests

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* fix node-fetch require error on prod build

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* preload fix

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* fixes

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* read serverAddress from apiBase

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* cleanup

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
2021-08-10 13:26:14 +03:00
Sebastian Malton
fb74859f66
Split KubeObject related components into seperate folders (#3533) 2021-08-03 17:39:29 -04:00