Skip to content

Commit

Permalink
Merge pull request #190 from SUSE/suse-tech-preview
Browse files Browse the repository at this point in the history
Tech preview for helm feature
  • Loading branch information
richard-cox authored Aug 28, 2019
2 parents fc1a20c + 64d772a commit 4ef4f85
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 55 deletions.
14 changes: 6 additions & 8 deletions custom-src/frontend/app/custom/custom.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ import { KubernetesSetupModule } from './kubernetes/kubernetes.setup.module';
import { KubeHealthCheck } from './kubernetes/store/kubernetes.actions';
import { SuseAboutInfoComponent } from './suse-about-info/suse-about-info.component';
import { SuseLoginComponent } from './suse-login/suse-login.component';
// import { HelmModule } from './helm/helm.module';
// import { HelmSetupModule } from './helm/helm.setup.module';
import { HelmModule } from './helm/helm.module';
import { HelmSetupModule } from './helm/helm.setup.module';

const SuseCustomizations: CustomizationsMetadata = {
copyright: '© 2019 SUSE',
hasEula: true,
aboutInfoComponent: SuseAboutInfoComponent
aboutInfoComponent: SuseAboutInfoComponent,
alwaysShowNavForEndpointTypes: (typ) => false,
};

@NgModule({
Expand All @@ -29,11 +30,8 @@ const SuseCustomizations: CustomizationsMetadata = {
SharedModule,
MDAppModule,
KubernetesSetupModule,
// #150 - Uncomment to enable helm plugin
// ---------------------------------------
// HelmModule,
// HelmSetupModule
// ---------------------------------------
HelmModule,
HelmSetupModule
],
declarations: [
SuseLoginComponent,
Expand Down
3 changes: 2 additions & 1 deletion custom-src/frontend/app/custom/helm/helm.store.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ const helmEndpointTypes: EndpointTypeExtensionConfig[] = [{
imagePath: '/core/assets/custom/helm.svg',
homeLink: (guid) => ['/monocular/repos', guid],
entitySchemaKeys: monocularEntityKeys,
doesNotSupportConnect: true
doesNotSupportConnect: true,
techPreview: true,
}];

@StratosExtension({
Expand Down
6 changes: 3 additions & 3 deletions src/jetstream/plugins/kubernetes/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package kubernetes

import (
"net/url"
"strconv"

"errors"

Expand Down Expand Up @@ -89,15 +90,14 @@ func (c *KubernetesSpecification) Connect(ec echo.Context, cnsiRecord interfaces
// Init the Kubernetes Jetstream plugin
func (c *KubernetesSpecification) Init() error {

// Register all of the providers
c.AddAuthProvider(auth.InitGKEKubeAuth(c.portalProxy))
c.AddAuthProvider(auth.InitAWSKubeAuth(c.portalProxy))
c.AddAuthProvider(auth.InitCertKubeAuth(c.portalProxy))
c.AddAuthProvider(auth.InitAzureKubeAuth(c.portalProxy))
c.AddAuthProvider(auth.InitOIDCKubeAuth(c.portalProxy))
c.AddAuthProvider(auth.InitKubeConfigAuth(c.portalProxy))

c.portalProxy.GetConfig().PluginConfig[kubeDashboardPluginConfigSetting] = "false"
// Kube dashboard is enabled by Tech Preview mode
c.portalProxy.GetConfig().PluginConfig[kubeDashboardPluginConfigSetting] = strconv.FormatBool(c.portalProxy.GetConfig().EnableTechPreview)

return nil
}
Expand Down
18 changes: 9 additions & 9 deletions src/jetstream/plugins/monocular/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ func (m *Monocular) GetChartStore() chartsvc.ChartSvcDatastore {

// Init performs plugin initialization
func (m *Monocular) Init() error {
return errors.New("Manually disabled")

// #150 - Uncomment to enable helm plugin
// ---------------------------------------
// m.ConfigureSQL()
// m.chartSvcRoutes = chartsvc.GetRoutes()
// m.InitSync()
// m.syncOnStartup()
// return nil

if !m.portalProxy.GetConfig().EnableTechPreview {
return errors.New("Feature is in Tech Preview")
}
m.ConfigureSQL()
m.chartSvcRoutes = chartsvc.GetRoutes()
m.InitSync()
m.syncOnStartup()
return nil
}

func (m *Monocular) syncOnStartup() {
Expand Down
13 changes: 2 additions & 11 deletions src/test-e2e/cloud-foundry/cloud-foundry-list-cf-e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,8 @@ describe('CF Endpoints Dashboard - ', () => {
.clearAllEndpoints();
});

beforeEach(() => {
nav.goto(SideNavMenuItem.CloudFoundry);
cloudFoundry.loadingIndicator.waitUntilNotShown();
});

it('should be the Endpoints page', () => {
expect(cloudFoundry.isActivePage()).toBeTruthy();
});

it('should show the `no registered endpoints` message', () => {
expect(cloudFoundry.hasNoCloudFoundryMessage).toBeTruthy();
it('No CF side nav when no CF connected', () => {
expect(nav.isMenuItemPresent(SideNavMenuItem.CloudFoundry)).toBeFalsy();
});
});

Expand Down
25 changes: 4 additions & 21 deletions src/test-e2e/endpoints/endpoints-e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
import { ApplicationsPage } from '../applications/applications.po';
import { CfTopLevelPage } from '../cloud-foundry/cf-level/cf-top-level-page.po';
import { e2e } from '../e2e';
import { ConsoleUserType } from '../helpers/e2e-helpers';
import { MenuComponent } from '../po/menu.po';
import { SideNavMenuItem } from '../po/side-nav.po';
import { SnackBarPo } from '../po/snackbar.po';
import { ServicesPage } from '../services/services.po';
import { EndpointsPage } from './endpoints.po';

describe('Endpoints', () => {
const endpointsPage = new EndpointsPage();
const applications = new ApplicationsPage();
const services = new ServicesPage();
const cloudFoundry = new CfTopLevelPage();

describe('Workflow on log in (admin/non-admin + no endpoints/some endpoints) -', () => {
describe('As Admin -', () => {
Expand Down Expand Up @@ -46,19 +40,8 @@ describe('Endpoints', () => {
expect(endpointsPage.isActivePage()).toBeTruthy();
});

it('Should show application wall with \'no clusters\' message', () => {
endpointsPage.sideNav.goto(SideNavMenuItem.Applications);
expect(applications.hasNoCloudFoundryMessage()).toBeTruthy();
});

it('Should show services view with \'no clusters\' message', () => {
endpointsPage.sideNav.goto(SideNavMenuItem.Services);
expect(services.hasNoCloudFoundryMessage()).toBeTruthy();
});

it('Should show Cloud Foundry view with \'no clusters\' message', () => {
endpointsPage.sideNav.goto(SideNavMenuItem.CloudFoundry);
expect(cloudFoundry.hasNoCloudFoundryMessage()).toBeTruthy();
it('No CF side nav when no CF connected', () => {
expect(endpointsPage.sideNav.isMenuItemPresent(SideNavMenuItem.CloudFoundry)).toBeFalsy();
});

it('Welcome snackbar message should be displayed', () => {
Expand Down Expand Up @@ -121,8 +104,8 @@ describe('Endpoints', () => {
const menu = new MenuComponent();
menu.waitUntilShown();
menu.getItemMap().then(items => {
expect(items['connect']).toBeDefined();
expect(items['disconnect']).not.toBeDefined();
expect(items.connect).toBeDefined();
expect(items.disconnect).not.toBeDefined();
});
return menu.close();
});
Expand Down
12 changes: 10 additions & 2 deletions src/test-e2e/po/side-nav.po.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { browser, by, element, promise } from 'protractor';
import { browser, by, element, ElementFinder, promise } from 'protractor';

import { E2EHelpers } from '../helpers/e2e-helpers';
import { Component } from './component.po';
Expand All @@ -23,9 +23,17 @@ export class SideNavigation extends Component {

// Goto the specified menu item
goto(menuItem: SideNavMenuItem): promise.Promise<void> {
return this.helpers.waitForElementAndClick(element(by.cssContainingText('.side-nav__item', menuItem)))
return this.helpers.waitForElementAndClick(this.getMenuItem(menuItem))
.then(() => browser.actions().mouseMove({ x: 500, y: 0 }).perform())
.then(() => browser.sleep(500));
}

isMenuItemPresent(menuItem: SideNavMenuItem) {
return this.getMenuItem(menuItem).isPresent();
}

getMenuItem(menuItem: SideNavMenuItem): ElementFinder {
return this.locator.element(by.cssContainingText('.side-nav__item', menuItem));
}

}

0 comments on commit 4ef4f85

Please sign in to comment.