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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>
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>
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>
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>