Skip to content

Commit

Permalink
Prepare for next version (#401)
Browse files Browse the repository at this point in the history
* Copy of Kiali frontend source code
Kiali frontend source originated from:
* git ref:    v2.2
* git commit: cb33b859493abf0d2706068ddaaace5656dc0d4d
* GitHub URL: https://github.com/kiali/kiali/tree/cb33b859493abf0d2706068ddaaace5656dc0d4d/frontend/src

Signed-off-by: kiali-bot <[email protected]>

* Release v2.2.0

* Prepare for next version

---------

Signed-off-by: kiali-bot <[email protected]>
Co-authored-by: kiali-bot <[email protected]>
  • Loading branch information
github-actions[bot] and kiali-bot authored Dec 3, 2024
1 parent 3db69ba commit f195018
Show file tree
Hide file tree
Showing 45 changed files with 469 additions and 315 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SHELL=/bin/bash

# Identifies the current build. Match the same version of Kiali Server and Operator.
VERSION ?= v2.2.0-SNAPSHOT
VERSION ?= v2.3.0-SNAPSHOT
COMMIT_HASH ?= $(shell git rev-parse HEAD)

# Directories based on the root project directory
Expand Down
2 changes: 1 addition & 1 deletion plugin/cypress/integration/kiali/common/apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Then('user sees span details', () => {
.eq(1) // take 1st row
.find('td')
.eq(4) // take 5th cell (kebab)
.should('be.visible');
.should('exist');

cy.get('table')
.should('be.visible')
Expand Down
16 changes: 14 additions & 2 deletions plugin/cypress/integration/kiali/common/workload_logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,20 @@ Given(
'I am on the logs tab of the {string} workload detail page of the {string} namespace',
(workload: string, namespace: string) => {
cy.visit({ url: `/console/namespaces/${namespace}/workloads/${workload}?tab=logs&refresh=0` });
cy.get('#metrics_filter_interval_duration-toggle').click();
cy.get('#1800').click();

const changeIntervalDuration = (): void => {
cy.get('#metrics_filter_interval_duration-toggle').click();
cy.get('#1800').click();
};

// In OSSMC, the duration interval is configured using the time duration modal component
if (Cypress.env('OSSMC')) {
cy.get('#time_duration').click();
changeIntervalDuration();
cy.get('#time-duration-modal').find('button').contains('Confirm').click();
} else {
changeIntervalDuration();
}
}
);

Expand Down
2 changes: 1 addition & 1 deletion plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ossmconsole",
"version": "2.2.0",
"version": "2.3.0",
"private": true,
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion plugin/plugin-metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ConsolePluginBuildMetadata } from '@openshift-console/dynamic-plugin-sd

const metadata: ConsolePluginBuildMetadata = {
name: 'ossmconsole',
version: '2.2.0',
version: '2.3.0',
displayName: 'OpenShift Service Mesh Console',
description: 'Provides Service Mesh/Istio Observability',
exposedModules: {
Expand Down
6 changes: 3 additions & 3 deletions plugin/src/kiali/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

Copy of Kiali frontend source code
Kiali frontend source originated from:
* git ref: master
* git commit: f9f04eef5bdaa9df626030a778d3ba53a40df75e
* GitHub URL: https://github.com/kiali/kiali/tree/f9f04eef5bdaa9df626030a778d3ba53a40df75e/frontend/src
* git ref: v2.2
* git commit: cb33b859493abf0d2706068ddaaace5656dc0d4d
* GitHub URL: https://github.com/kiali/kiali/tree/cb33b859493abf0d2706068ddaaace5656dc0d4d/frontend/src
4 changes: 2 additions & 2 deletions plugin/src/kiali/components/Envoy/tables/ClusterTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { kialiStyle } from 'styles/StyleUtils';
import { isParentKiosk } from '../../Kiosk/KioskActions';
import { SortableTh } from 'components/Table/SimpleTable';
import { t } from 'utils/I18nUtils';
import { dicIstioTypeToGVK } from '../../../types/IstioConfigList';
import { dicTypeToGVK, gvkType } from '../../../types/IstioConfigList';

export class ClusterTable implements SummaryTable {
kiosk: string;
Expand Down Expand Up @@ -271,7 +271,7 @@ export class ClusterTable implements SummaryTable {
value.subset,
value.direction,
value.type,
istioConfigLink(value.destination_rule, dicIstioTypeToGVK['DestinationRule'])
istioConfigLink(value.destination_rule, dicTypeToGVK[gvkType.DestinationRule])
]
};
}
Expand Down
4 changes: 2 additions & 2 deletions plugin/src/kiali/components/Envoy/tables/RouteTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { KialiIcon } from 'config/KialiIcon';
import { kialiStyle } from 'styles/StyleUtils';
import { isParentKiosk } from '../../Kiosk/KioskActions';
import { SortableTh } from 'components/Table/SimpleTable';
import { dicIstioTypeToGVK } from '../../../types/IstioConfigList';
import { dicTypeToGVK, gvkType } from '../../../types/IstioConfigList';

export class RouteTable implements SummaryTable {
kiosk: string;
Expand Down Expand Up @@ -187,7 +187,7 @@ export class RouteTable implements SummaryTable {
summary.name,
serviceLink(summary.domains, this.namespaces, this.namespace, true, parentKiosk),
summary.match,
istioConfigLink(summary.virtual_service, dicIstioTypeToGVK['VirtualService'])
istioConfigLink(summary.virtual_service, dicTypeToGVK[gvkType.VirtualService])
]
};
}
Expand Down
62 changes: 33 additions & 29 deletions plugin/src/kiali/components/IstioWizards/ServiceWizard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ import { ConfigPreviewItem, IstioConfigPreview } from 'components/IstioConfigPre
import { KialiIcon } from '../../config/KialiIcon';
import { ApiResponse } from 'types/Api';
import { t } from 'utils/I18nUtils';
import { dicIstioTypeToGVK } from '../../types/IstioConfigList';
import { dicTypeToGVK, gvkType } from '../../types/IstioConfigList';
import { getGVKTypeString } from '../../utils/IstioConfigUtils';

const emptyServiceWizardState = (fqdnServiceName: string): ServiceWizardState => {
Expand Down Expand Up @@ -371,7 +371,7 @@ export class ServiceWizard extends React.Component<ServiceWizardProps, ServiceWi
promises.push(
API.createIstioConfigDetail(
this.props.namespace,
dicIstioTypeToGVK['Gateway'],
dicTypeToGVK[gvkType.Gateway],
JSON.stringify(gw),
this.props.cluster
)
Expand All @@ -382,7 +382,7 @@ export class ServiceWizard extends React.Component<ServiceWizardProps, ServiceWi
promises.push(
API.createIstioConfigDetail(
this.props.namespace,
dicIstioTypeToGVK['K8sGateway'],
dicTypeToGVK[gvkType.K8sGateway],
JSON.stringify(k8sgateway),
this.props.cluster
)
Expand All @@ -394,7 +394,7 @@ export class ServiceWizard extends React.Component<ServiceWizardProps, ServiceWi
promises.push(
API.updateIstioConfigDetail(
this.props.namespace,
dicIstioTypeToGVK['DestinationRule'],
dicTypeToGVK[gvkType.DestinationRule],
dr.metadata.name,
JSON.stringify(dr),
this.props.cluster
Expand All @@ -406,7 +406,7 @@ export class ServiceWizard extends React.Component<ServiceWizardProps, ServiceWi
promises.push(
API.updateIstioConfigDetail(
this.props.namespace,
dicIstioTypeToGVK['VirtualService'],
dicTypeToGVK[gvkType.VirtualService],
vs.metadata.name,
JSON.stringify(vs),
this.props.cluster
Expand All @@ -418,7 +418,7 @@ export class ServiceWizard extends React.Component<ServiceWizardProps, ServiceWi
promises.push(
API.updateIstioConfigDetail(
this.props.namespace,
dicIstioTypeToGVK['K8sHTTPRoute'],
dicTypeToGVK[gvkType.K8sHTTPRoute],
k8shttproute.metadata.name,
JSON.stringify(k8shttproute),
this.props.cluster
Expand All @@ -430,7 +430,7 @@ export class ServiceWizard extends React.Component<ServiceWizardProps, ServiceWi
promises.push(
API.updateIstioConfigDetail(
this.props.namespace,
dicIstioTypeToGVK['K8sGRPCRoute'],
dicTypeToGVK[gvkType.K8sGRPCRoute],
k8sgrpcroute.metadata.name,
JSON.stringify(k8sgrpcroute),
this.props.cluster
Expand All @@ -447,7 +447,7 @@ export class ServiceWizard extends React.Component<ServiceWizardProps, ServiceWi
promises.push(
API.createIstioConfigDetail(
this.props.namespace,
dicIstioTypeToGVK['DestinationRule'],
dicTypeToGVK[gvkType.DestinationRule],
JSON.stringify(dr),
this.props.cluster
)
Expand All @@ -458,7 +458,7 @@ export class ServiceWizard extends React.Component<ServiceWizardProps, ServiceWi
promises.push(
API.createIstioConfigDetail(
this.props.namespace,
dicIstioTypeToGVK['VirtualService'],
dicTypeToGVK[gvkType.VirtualService],
JSON.stringify(vs),
this.props.cluster
)
Expand All @@ -469,7 +469,7 @@ export class ServiceWizard extends React.Component<ServiceWizardProps, ServiceWi
promises.push(
API.createIstioConfigDetail(
this.props.namespace,
dicIstioTypeToGVK['K8sHTTPRoute'],
dicTypeToGVK[gvkType.K8sHTTPRoute],
JSON.stringify(k8shttproute),
this.props.cluster
)
Expand All @@ -480,7 +480,7 @@ export class ServiceWizard extends React.Component<ServiceWizardProps, ServiceWi
promises.push(
API.createIstioConfigDetail(
this.props.namespace,
dicIstioTypeToGVK['K8sGRPCRoute'],
dicTypeToGVK[gvkType.K8sGRPCRoute],
JSON.stringify(k8sgrpcroute),
this.props.cluster
)
Expand All @@ -491,7 +491,7 @@ export class ServiceWizard extends React.Component<ServiceWizardProps, ServiceWi
promises.push(
API.createIstioConfigDetail(
this.props.namespace,
dicIstioTypeToGVK['PeerAuthentication'],
dicTypeToGVK[gvkType.PeerAuthentication],
JSON.stringify(pa),
this.props.cluster
)
Expand Down Expand Up @@ -539,7 +539,7 @@ export class ServiceWizard extends React.Component<ServiceWizardProps, ServiceWi
promises.push(
API.createIstioConfigDetail(
this.props.namespace,
dicIstioTypeToGVK['PeerAuthentication'],
dicTypeToGVK[gvkType.PeerAuthentication],
JSON.stringify(pa),
this.props.cluster
)
Expand All @@ -548,7 +548,7 @@ export class ServiceWizard extends React.Component<ServiceWizardProps, ServiceWi
promises.push(
API.updateIstioConfigDetail(
this.props.namespace,
dicIstioTypeToGVK['PeerAuthentication'],
dicTypeToGVK[gvkType.PeerAuthentication],
dr.metadata.name,
JSON.stringify(pa),
this.props.cluster
Expand All @@ -559,7 +559,7 @@ export class ServiceWizard extends React.Component<ServiceWizardProps, ServiceWi
promises.push(
API.deleteIstioConfigDetail(
this.props.namespace,
dicIstioTypeToGVK['PeerAuthentication'],
dicTypeToGVK[gvkType.PeerAuthentication],
dr.metadata.name,
this.props.cluster
)
Expand Down Expand Up @@ -756,13 +756,17 @@ export class ServiceWizard extends React.Component<ServiceWizardProps, ServiceWi
};

onConfirmPreview = (items: ConfigPreviewItem[]): void => {
const dr = items.filter(it => getGVKTypeString(it.objectGVK) === getGVKTypeString('DestinationRule'))[0];
const gw = items.filter(it => getGVKTypeString(it.objectGVK) === getGVKTypeString('Gateway'))[0];
const k8sgateway = items.filter(it => getGVKTypeString(it.objectGVK) === getGVKTypeString('K8sGateway'))[0];
const pa = items.filter(it => getGVKTypeString(it.objectGVK) === getGVKTypeString('PeerAuthentication'))[0];
const vs = items.filter(it => getGVKTypeString(it.objectGVK) === getGVKTypeString('VirtualService'))[0];
const k8shttproute = items.filter(it => getGVKTypeString(it.objectGVK) === getGVKTypeString('K8sHTTPRoute'))[0];
const k8sgrpcroute = items.filter(it => getGVKTypeString(it.objectGVK) === getGVKTypeString('K8sGRPCRoute'))[0];
const dr = items.filter(it => getGVKTypeString(it.objectGVK) === getGVKTypeString(gvkType.DestinationRule))[0];
const gw = items.filter(it => getGVKTypeString(it.objectGVK) === getGVKTypeString(gvkType.Gateway))[0];
const k8sgateway = items.filter(it => getGVKTypeString(it.objectGVK) === getGVKTypeString(gvkType.K8sGateway))[0];
const pa = items.filter(it => getGVKTypeString(it.objectGVK) === getGVKTypeString(gvkType.PeerAuthentication))[0];
const vs = items.filter(it => getGVKTypeString(it.objectGVK) === getGVKTypeString(gvkType.VirtualService))[0];
const k8shttproute = items.filter(
it => getGVKTypeString(it.objectGVK) === getGVKTypeString(gvkType.K8sHTTPRoute)
)[0];
const k8sgrpcroute = items.filter(
it => getGVKTypeString(it.objectGVK) === getGVKTypeString(gvkType.K8sGRPCRoute)
)[0];

const previews: WizardPreviews = {
dr: dr ? (dr.items[0] as DestinationRule) : undefined,
Expand All @@ -783,51 +787,51 @@ export class ServiceWizard extends React.Component<ServiceWizardProps, ServiceWi
if (this.state.previews) {
if (this.state.previews.dr) {
items.push({
objectGVK: dicIstioTypeToGVK['DestinationRule'],
objectGVK: dicTypeToGVK[gvkType.DestinationRule],
items: [this.state.previews.dr],
title: 'Destination Rule'
});
}

if (this.state.previews.gw) {
items.push({ objectGVK: dicIstioTypeToGVK['Gateway'], items: [this.state.previews.gw], title: 'Gateway' });
items.push({ objectGVK: dicTypeToGVK[gvkType.Gateway], items: [this.state.previews.gw], title: 'Gateway' });
}

if (this.state.previews.k8sgateway) {
items.push({
objectGVK: dicIstioTypeToGVK['K8sGateway'],
objectGVK: dicTypeToGVK[gvkType.K8sGateway],
items: [this.state.previews.k8sgateway],
title: 'K8s Gateway'
});
}

if (this.state.previews.k8shttproute) {
items.push({
objectGVK: dicIstioTypeToGVK['K8sHTTPRoute'],
objectGVK: dicTypeToGVK[gvkType.K8sHTTPRoute],
items: [this.state.previews.k8shttproute],
title: 'K8s HTTPRoute'
});
}

if (this.state.previews.k8sgrpcroute) {
items.push({
objectGVK: dicIstioTypeToGVK['K8sGRPCRoute'],
objectGVK: dicTypeToGVK[gvkType.K8sGRPCRoute],
items: [this.state.previews.k8sgrpcroute],
title: 'K8s GRPCRoute'
});
}

if (this.state.previews.pa) {
items.push({
objectGVK: dicIstioTypeToGVK['PeerAuthentication'],
objectGVK: dicTypeToGVK[gvkType.PeerAuthentication],
items: [this.state.previews.pa],
title: 'Peer Authentication'
});
}

if (this.state.previews.vs) {
items.push({
objectGVK: dicIstioTypeToGVK['VirtualService'],
objectGVK: dicTypeToGVK[gvkType.VirtualService],
items: [this.state.previews.vs],
title: 'VirtualService'
});
Expand Down
6 changes: 4 additions & 2 deletions plugin/src/kiali/components/IstioWizards/WizardActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
ConnectionPoolSettings,
DestinationRule,
Gateway,
GroupVersionKind,
HTTPMatchRequest,
HTTPRoute,
HTTPRouteDestination,
Expand Down Expand Up @@ -68,6 +69,7 @@ import { ADD, SET, REQ_MOD, RESP_MOD, REQ_RED, REQ_MIR } from './K8sRequestRouti
import { ANYTHING, PRESENCE } from './RequestRouting/MatchBuilder';
import { t } from 'utils/I18nUtils';
import { defaultGatewayLabel, defaultGatewayLabelValue } from 'config/Constants';
import { dicTypeToGVK, gvkType } from '../../types/IstioConfigList';

export const WIZARD_TRAFFIC_SHIFTING = 'traffic_shifting';
export const WIZARD_TCP_TRAFFIC_SHIFTING = 'tcp_traffic_shifting';
Expand Down Expand Up @@ -2366,7 +2368,7 @@ export const buildNamespaceInjectionPatch = (enable: boolean, remove: boolean, r
return JSON.stringify(patch);
};

export const buildWorkloadInjectionPatch = (workloadType: string, enable: boolean, remove: boolean): string => {
export const buildWorkloadInjectionPatch = (gvk: GroupVersionKind, enable: boolean, remove: boolean): string => {
const patch = {};

// environments prefer to use the pod label over the annotation
Expand All @@ -2375,7 +2377,7 @@ export const buildWorkloadInjectionPatch = (workloadType: string, enable: boolea
labels[serverConfig.istioAnnotations.istioInjectionAnnotation] = remove ? null : enable ? 'true' : 'false';
const annotations = {};
annotations[serverConfig.istioAnnotations.istioInjectionAnnotation] = null;
if (workloadType === 'Pod') {
if (gvk.Kind === dicTypeToGVK[gvkType.Pod].Kind) {
patch['labels'] = labels;
patch['annotations'] = annotations;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import { renderDisabledDropdownOption } from 'utils/DropdownUtils';
import { MessageType } from 'types/MessageCenter';
import { groupMenuStyle } from 'styles/DropdownStyles';
import { t } from 'utils/I18nUtils';
import { getGVKTypeString } from '../../utils/IstioConfigUtils';
import { gvkType } from '../../types/IstioConfigList';

type Props = {
actionsLabel: boolean;
Expand All @@ -34,11 +36,11 @@ export const WorkloadWizardActionsDropdownGroup: React.FunctionComponent<Props>
case WIZARD_REMOVE_AUTO_INJECTION:
const remove = key === WIZARD_REMOVE_AUTO_INJECTION;
const enable = key === WIZARD_ENABLE_AUTO_INJECTION;
const jsonInjectionPatch = buildWorkloadInjectionPatch(props.workload.type, enable, remove);
const jsonInjectionPatch = buildWorkloadInjectionPatch(props.workload.gvk, enable, remove);
API.updateWorkload(
props.namespace,
props.workload.name,
props.workload.type,
props.workload.gvk,
jsonInjectionPatch,
undefined,
props.workload.cluster
Expand Down Expand Up @@ -139,7 +141,7 @@ export const WorkloadWizardActionsDropdownGroup: React.FunctionComponent<Props>
}

// Annotations
if (props.annotations && props.workload.type === 'Deployment') {
if (props.annotations && getGVKTypeString(props.workload.gvk) === getGVKTypeString(gvkType.Deployment)) {
const annotationsAction = (
<DropdownItem
data-test={WIZARD_EDIT_ANNOTATIONS}
Expand Down
Loading

0 comments on commit f195018

Please sign in to comment.