Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tech preview for helm feature #190

Merged
merged 9 commits into from
Aug 28, 2019
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));
}

}