Commit Graph

1137 Commits

Author SHA1 Message Date
Matt Farina
6220ce51ef Merge pull request #491 from rancher-sandbox/488-scroll-textbox-into-view
The 'fullWindow' object doesn't scroll, its grandparent does
v0.4.0
2021-08-12 10:37:51 -04:00
Matt Farina
b8c3fc91af Merge pull request #489 from mook-as/port-forwarding-string-ports
K8s: Fix port fowarding for services with port names
2021-08-12 10:23:06 -04:00
Matt Farina
7f8a7bccec Merge pull request #490 from mook-as/win32-integration-missing
K8s: integrations missing on Windows
2021-08-12 09:48:04 -04:00
Eric Promislow
29de4c86ae The 'fullWindow' object doesn't scroll, its grandparent does
I worked this out by trial-and-error. I can only explain it as far as
vue adds various sub-elements and we need to work with them.

Also, scrolling needs to be done later (like on the next tick) because vue.js
probably hasn't finished rendering everything

Signed-off-by: Eric Promislow <epromislow@suse.com>
2021-08-11 18:48:46 -07:00
Mark Yen
a7ab24049b K8s: integrations missing on Windows
Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-08-11 17:41:15 -07:00
Mark Yen
d0ca7762ac K8s: Fix port fowarding for services with port names
When setting up services in Kubernetes, you could either supply a port
number or a port name when describing where to forward to.  In the case of
a port name, we need to look up the corresponding port number from the
endpoint definition.

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-08-11 16:45:26 -07:00
Matt Farina
6e0da0d646 Merge pull request #484 from rancher-sandbox/typo-in-windows-setup
fix typo
2021-08-11 17:06:09 -04:00
Eric Promislow
083d7446c5 fix typo
Signed-off-by: Eric Promislow <epromislow@suse.com>
2021-08-11 13:51:57 -07:00
Eric Promislow
319ea866ae Merge pull request #474 from rancher-sandbox/bump-lima
Bump to lima 0.6.0 plus lima PR#149
2021-08-10 15:55:06 -07:00
Mark Yen
eb5a4855be Merge pull request #479 from mook-as/lima-config-dupelicated-mounts
Lima: fix duplicated mounts in config
2021-08-10 13:35:39 -07:00
Mark Yen
c2fb00b9c6 Lima: don't append images & mounts
When both source and destination are arrays, deepmerge will append elements
to the array, which isn't what we want here; instead, use lodash merge,
which clobbers the existing array instead.

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-08-10 11:52:03 -07:00
Mark Yen
48999c680d k3s: make helper function protected
Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-08-10 11:52:03 -07:00
Eric Promislow
e178d2ab68 Merge pull request #477 from rancher-sandbox/458-fix-k8s-version-1.0.0
Dev only: restore the cache file (or absence of) after tests
2021-08-10 10:40:59 -07:00
Eric Promislow
3bb3e72b6d Dev only: restore the cache file (or absence of) after tests
This was manifesting as a failure to fetch
https://github.com/k3s-io/k3s/releases/download/v1.20.0/k3s-airgap-images-amd64.tar
at startup, and rd would freeze.

`~/Library/Caches/rancher-desktop/k3s-versions.json` contained one entry:

`["v1.20.0"]`

This is because unit tests created a cache file with that entry.

A partial fix is to restore the existing list of versions after running
tests, done here.

A better fix would be to use a different cache file, but that's probably
overkill for something that affects only devs. This doesn't affect the
CI system (which runs tests but not the final build) or end-users
(who run final builds but not unit tests).

Signed-off-by: Eric Promislow <epromislow@suse.com>
2021-08-10 09:50:33 -07:00
Mark Yen
10376d26d7 Merge pull request #475 from mook-as/proxy-direct-ssl
Proxy: correctly handle SNI
2021-08-09 16:54:22 -07:00
Mark Yen
53e7d1b60f Proxy: correctly handle SNI
We need to pass the servername to tls.connect() in order for it to do
server name indication correctly.  Also, we must not pass in path, even if
it's null, otherwise it gets confused.

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-08-09 16:37:34 -07:00
Jan Dubois
e13b7da660 Bump to lima 0.6.0 plus lima PR#149
Signed-off-by: Jan Dubois <jan.dubois@suse.com>
2021-08-09 14:52:49 -07:00
Matt Farina
0318fdf36c Merge pull request #473 from mattfarina/bump-0.4-deps
Incrementing the Helm version to latest patch release
2021-08-09 17:40:09 -04:00
Matt Farina
482d0b17a0 Merge pull request #472 from mattfarina/bump-0.4
Bumping the internal version to 0.4.0
2021-08-09 17:26:41 -04:00
Matt Farina
48a3e9d531 Incrementing the Helm version to latest patch release
Signed-off-by: Matt Farina <matt.farina@suse.com>
2021-08-09 17:14:29 -04:00
Matt Farina
4fda47d632 Bumping the internal version to 0.4.0
Signed-off-by: Matt Farina <matt.farina@suse.com>
2021-08-09 17:08:34 -04:00
Matt Farina
c72fdca443 Merge pull request #435 from mook-as/system-proxy-custom
Support for system proxy configuration.
2021-08-09 17:07:12 -04:00
Mark Yen
83d1a15586 background: Support for system proxy configuration.
This adds support for use the system proxy configuration (by asking the
embedded Chrome to resolve the proxy configuration).  The idea to ask
Chrome was from the electron-proxy-agent package; however, it had
significant issues on supporting system CA certificates, and the result
ended up being a complete rewrite.

We need the wrapper classes for HttpsProxyAgent and SocksProxyAgent so that
we can pass the CA options down to the eventual tls.connect() call.  This
is due to https://github.com/TooTallNate/node-https-proxy-agent/issues/89

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-08-06 16:09:25 -07:00
Mark Yen
cf213be3cd Merge pull request #454 from mook-as/e2e-run-script
E2E: Use custom script for building
2021-08-06 15:18:08 -07:00
Mark Yen
d67bea1e4b Merge pull request #453 from mook-as/e2e-style
E2E: Make it clear that getting a page may fail.
2021-08-06 15:17:50 -07:00
Mark Yen
62e9c2c6ab Merge pull request #466 from mook-as/459-port-mismatch
K8s: Fix port display in UI
2021-08-06 15:14:37 -07:00
Mark Yen
6ad16550f2 K8s: Fix port display in UI
- Make the port number available explicitly be the _desired_ port, and not
  the current port; that is, it will reflect the target port number while
  the backend is still starting.
- Make the k8s page request the desired port when mounting.
Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-08-06 13:40:40 -07:00
Matt Farina
fbe2ff7ac8 Merge pull request #464 from mook-as/458-startup-issues
Fix various startup issues
2021-08-06 15:58:44 -04:00
Mark Yen
64f3ca9169 Lima: Don't print error stack when failing to get status
The error stack is not really useful (exit status is 1), and is misleading
as the issue is probably elsewhere.

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-08-06 10:36:46 -07:00
Mark Yen
c0ee32f275 Lima/WSL: Abort if user stopped before start finished
If the user attempts to quit before start has finished (e.g. while waiting
for the k3s components to download), quit immediately, instead of
continuing to start.  Otherwise the quit flag would be set without ever
attempting to quit, causing the app to orphan an instance if the user tries
again later.

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-08-06 10:36:46 -07:00
Mark Yen
d15a15c26d Merge pull request #465 from rancher-sandbox/lima-vm
alpine-lima repo has moved from rancher-sandbox to lima-vm org
2021-08-06 09:21:28 -07:00
Jan Dubois
bd8618d0e9 alpine-lima repo has moved from rancher-sandbox to lima-vm org
Signed-off-by: Jan Dubois <jan.dubois@suse.com>
2021-08-05 22:29:23 -07:00
Mark Yen
e496eb9d66 Merge pull request #461 from rancher-sandbox/459-squelch-reset-notifications-in-error-state
Squelch notifications on config differences when in error state.
2021-08-05 17:57:34 -07:00
Mark Yen
dd0782c917 K3s: Try to be more explicit about where we want the short version.
Since k3s internally wants a version string with the k3s build number (as
in v1.2.3+k3s.4), we need to do a better job of tracking which we mean when
we refer to a version.  This is unfortunately advisory only; TypeScript
does not see them as distinct types, and does no type checking.

We do change to making the desired version be the short version, as we will
persist it if we successfully start without a version saved.

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-08-05 17:56:43 -07:00
Mark Yen
9801535d0e Lima: When failing to get status, set the result to undefined
We use undefined to signal that the machine isn't registered; we could end
up with an exception in that case (because lima throws an exception if the
machine state directory is missing).

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-08-05 17:56:01 -07:00
Mark Yen
f832dadf7b Lima: Force-terminate any stray k3s instances before start
When we restart k3s (e.g. when we change versions), we can end up with a
stray k3s process on a VM.  This often does not come with a matching host-
side porocess.  Force terminate any k3s instances before we start a new one
to ensure that we can listen on the port correctly.

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-08-05 17:56:01 -07:00
Mark Yen
8b00bddaf7 Lima: Don't randomly assign ssh port if VM is running
We can't change the port of a running VM (unless we restart it); just
return the existing port if if it's already running, since we will have no
issues with it failing to listen (it has already done so).

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-08-05 17:56:00 -07:00
Mark Yen
fbed6c4e7c Merge pull request #462 from rancher-sandbox/460-run-desired-version
Ensure the actual running k8s version is in sync with the UI
2021-08-05 17:55:13 -07:00
Eric Promislow
ecc6f846ad Ensure the actual running k8s version is in sync with the UI
Signed-off-by: Eric Promislow <epromislow@suse.com>
2021-08-05 14:45:15 -07:00
Mark Yen
48d34c8be0 Merge pull request #440 from mook-as/kim-reinstall-endpoint
Kim: Check for the correct endpoint
2021-08-05 14:23:06 -07:00
Eric Promislow
6f4a22a312 Squelch notifications on config differences when in error state.
Signed-off-by: Eric Promislow <epromislow@suse.com>
2021-08-05 14:10:51 -07:00
Mark Yen
f703f4fb41 scripts: Default NODE_ENV to production
This maintains the old behaviour.

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-08-05 13:50:42 -07:00
Eric Promislow
f8192cd023 Merge pull request #451 from rancher-sandbox/439-clean-up-hyperkit
Remove hyperkit files when moving to lima
2021-08-05 13:50:15 -07:00
Eric Promislow
d3fc593859 Merge pull request #409 from rancher-sandbox/366-scan-images-with-trivy
Add a command to use trivy to scan images for vulnerabilities
2021-08-05 13:41:24 -07:00
Eric Promislow
ec5fcd6d5b fix lint errors
Signed-off-by: Eric Promislow <epromislow@suse.com>
2021-08-05 10:56:32 -07:00
Eric Promislow
e900f0588e Remove hyperkit files when moving to lima
This only happens when:
1. running on macos
2. Starting up with a preferences file of version 1 or 2

This means in the future we can safely use the directory
~/Library/State/rancher-desktop/driver
as long as the settings file has a version # > 3

Yes, this is piggy-backing on the settings upgrade mechanism
to avoid writing yet another one.  If you think of it as
an `at-startup-upgrade mechanism' it's less problematic.

Signed-off-by: Eric Promislow <epromislow@suse.com>
2021-08-05 10:56:32 -07:00
Mark Yen
92e133de6f E2E: Use custom script for building
This lets us drop the SPECTRON_RUN environment variable, so we can be sure
that users will not accidentally stumble upon it (causing the deprecated
remoting API to be enabled).

Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-08-04 17:17:00 -07:00
Mark Yen
93cf153af4 E2E: Make it clear that getting a page may fail.
Signed-off-by: Mark Yen <mark.yen@suse.com>
2021-08-04 17:04:39 -07:00
Mark Yen
a54d69f82c Merge pull request #425 from rancher-sandbox/spectron-e2e-test-setup-jest
Spectron e2e test setup jest
2021-08-04 16:42:16 -07:00
Gunasekhar Matamalam
aa357aa233 Modified the condition to make the element exists check working
Signed-off-by: Gunasekhar Matamalam <gunasekhar.matamalam@suse.com>
2021-08-04 16:22:04 -07:00