We use json.Unmarshal for files using JSON format, and convert the
YAML format files to JSON first and call json.Unmarshal on them as well.
The yaml to json conversion let to unquoted numbers getting converted to
scientific notation. So this commit fixes it by calling yaml.Unmarshal
directly on file with yaml format instead of converting them to json.
Added wait and timeout flags to multi-cluster apps. Removed
automatic CLI blocking behavior. Added multi-cluster apps
to rancher wait command. Made flags and descriptions more
clear. Prior, there was no way to configure wait and
timeout helm options for multi-cluster apps. This would
prevent apps which take longer than 5 minutes to fail
installing. Install would block CLI untill app was properly
installed. CLI text did not make it clear that wait/timeout
are helm options.
Problem:
defaultVersion on an app template does not take into account the rancher
server version so attempting to use that version to install an app can
cause errors
Solution:
Use a template filtered off the rancher server version to get the latest
version of the app to default to
Problem:
Rancher supports enforcing apps versions but all app templates are shown
even if they are not compatable with the version of rancher running
Solution:
Add the rancherVersion filter when getting templates so only valid app
templates are shown
Added wait and timeout flags. Added show-notes flag. Prior, there
was no way to tell helm to wait longer than the default of 300
seconds. This caused installs of certain apps to fail. Now, users
can configure the amount of time helm should wait before failing.
CLI no longer hangs while waiting for helm. User can use the
existing wait command for hanging behavior. Notes may not be ready
immediately, so user can now use the show-notes flag to print app
notes at any time after app creation.
Problem:
When upgrading a project scoped catalog app, the externalId is not constructed properly, therefore results in version not found error.
The cause is that url parsing does not preserve query orders, given that
it turns to a map under the hood. It
breaks since we introduced 'type' param to the externalId.
For example, "catalog://?catalog=cid&type=projectCatalog&template=grafana&version=0.0.30" becomes "catalog://?catalog=cid&template=grafana&type=projectCatalog&version=0.0.30". Therefore the externalId filter does not work.
Solution:
Change the url.Encode way to get externalId for newer version
If set flag is used, existing answers will reset before assigning
new answers. Prior, using set flag would add new answers to previous
answers. This has been changed to better mirror the behavior of helm.
**Problem:**
`app show-app`, `app ls` cannot indicate the chart information
**Solution:**
Fetch chart information from catalog `ExternalID` or
local chart template `Files`
Problem:
Cannot upgrade an app deployed from project level catalog. When constructing the externalId filter, catalog id gets url-encoded twice, therefore fails to get the templateversion.
Solution:
Construct the query properly.
Problem:
An app creates a namespace to deploy into and depending on the system it
might not be ready when attempting to install the app
Solution:
Poll the namespace to ensure it's active before proceeding with
installing the app
Problem:
Apps of the same name deploy into the same namespace. This fails when a
namespace is owned by another project
Solution:
Apps should be deployed into a unique namespace unless specified
otherwise.
Add a flag to specify the namespace
Create a namespace with a random suffix to deploy the app into if
namespace is not specified