Initialize HelmRepoManager on demand (#2591)

This commit is contained in:
Sebastian Malton authored and GitHub committed 2021-04-22 15:34:17 -04:00
1 parent 7132bf3834
commit b20bedfbae
6 files changed
+27 -24

No files matched your search

+2 -2
View File
@@ -60,7 +60,8 @@ export async function bootstrap(App: AppComponent) {
const filesystemStore = FilesystemProvisionerStore.createInstance();
const themeStore = ThemeStore.createInstance();
const hotbarStore = HotbarStore.createInstance();
const helmRepoManager = HelmRepoManager.createInstance();
HelmRepoManager.createInstance(); // initialize the manager
// preload common stores
await Promise.all([
@@ -70,7 +71,6 @@ export async function bootstrap(App: AppComponent) {
extensionsStore.load(),
filesystemStore.load(),
themeStore.init(),
helmRepoManager.init(),
]);
// Register additional store listeners
@@ -79,7 +79,7 @@ export class AddHelmRepoDialog extends React.Component<Props> {
async addCustomRepo() {
try {
await HelmRepoManager.getInstance().addСustomRepo(this.helmRepo);
await HelmRepoManager.addСustomRepo(this.helmRepo);
Notifications.ok(<>Helm repository <b>{this.helmRepo.name}</b> has added</>);
this.props.onAddRepo();
this.close();
@@ -34,7 +34,7 @@ export class HelmCharts extends React.Component {
try {
if (!this.repos.length) {
this.repos = await HelmRepoManager.getInstance().loadAvailableRepos(); // via https://helm.sh
this.repos = await HelmRepoManager.loadAvailableRepos();
}
const repos = await HelmRepoManager.getInstance().repositories(); // via helm-cli
@@ -49,7 +49,7 @@ export class HelmCharts extends React.Component {
async addRepo(repo: HelmRepo) {
try {
await HelmRepoManager.getInstance().addRepo(repo);
await HelmRepoManager.addRepo(repo);
this.addedRepos.set(repo.name, repo);
} catch (err) {
Notifications.error(<>Adding helm branch <b>{repo.name}</b> has failed: {String(err)}</>);
@@ -58,7 +58,7 @@ export class HelmCharts extends React.Component {
async removeRepo(repo: HelmRepo) {
try {
await HelmRepoManager.getInstance().removeRepo(repo);
await HelmRepoManager.removeRepo(repo);
this.addedRepos.delete(repo.name);
} catch (err) {
Notifications.error(