Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions packages/kuma-gui/src/app/data-planes/features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import type { Features } from '@kumahq/settings/can'
export const features = () => {
return {
'use transparent-proxying': (_can: unknown, dataplaneOverview: DataplaneOverview) => {
// TODO: the feature `bind-outbounds` is not implemented yet and the name might change, double check again when implemented
// TODO: `dataplane.networking.transparentProxying` is deprecated and will be removed soon. Still checking for users that still use it.
return ('transparentProxying' in dataplaneOverview.dataplane.networking) ||
new Set(dataplaneOverview.dataplaneInsight.metadata.features).intersection(new Set(['feature-transparent-proxy-in-dataplane-metadata', 'bind-outbounds'])).size > 0
new Set(dataplaneOverview.dataplaneInsight.metadata.features).intersection(new Set(['feature-transparent-proxy-in-dataplane-metadata', 'feature-bind-outbounds'])).size > 0
},
'use unified-resource-naming': (_can: unknown, { dataplaneOverview, mesh }: { dataplaneOverview: DataplaneOverview, mesh: Mesh }) => {
return mesh.meshServices.mode === 'Exclusive' && dataplaneOverview.dataplaneType === 'standard' && dataplaneOverview.dataplaneInsight.metadata.features.includes('feature-unified-resource-naming')
Expand Down
3 changes: 3 additions & 0 deletions packages/kuma-http-api/mocks/Env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,7 @@ export type Env = keyof {
KUMA_DATAPLANE_TLS_ISSUED_MESHIDENTITY: string
KUMA_MESHIDENTITY_COUNT: string
KUMA_MESHTRUST_COUNT: string
KUMA_DATAPLANE_TRANSPARENT_PROXY: string
KUMA_DATAPLANE_BIND_OUTBOUNDS: string
KUMA_DATAPLANE_TCP_ACCESSLOG_VIA_NAMED_PIPE: string
}
9 changes: 0 additions & 9 deletions packages/kuma-http-api/mocks/FakeKuma.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,15 +307,6 @@ gbXR5RnEs0hDxugaIknJMKk1b0g=
}
}

dataplaneFeatures() {
return this.faker.helpers.arrayElements([
'feature-tcp-accesslog-via-named-pipe',
'feature-transparent-proxy-in-dataplane-metadata',
// TODO: not implemented yet, uncomment when implemented
// 'bind-outbounds',
])
}

ruleMatch({ kind }: { kind?: 'path' | 'method' | 'headers' | 'queryParams' } = { kind: 'path' }) {
const _kind = kind ?? this.faker.helpers.arrayElement<'path' | 'method' | 'headers' | 'queryParams'>(['path', 'method', 'headers', 'queryParams'])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ export default ({ env, fake }: Dependencies): ResponseHandler => (req) => {
const unifiedResourceNaming = env('KUMA_DATAPLANE_RUNTIME_UNIFIED_RESOURCE_NAMING_ENABLED', '')
const isTlsIssuedMeshIdentity = env('KUMA_DATAPLANE_TLS_ISSUED_MESHIDENTITY', `${fake.datatype.boolean()}`) === 'true'
const isUnifiedResourceNamingEnabled = unifiedResourceNaming.length ? unifiedResourceNaming === 'true' : fake.datatype.boolean()
const isTransparentProxyingEnabled = env('KUMA_DATAPLANE_TRANSPARENT_PROXY', `${fake.datatype.boolean()}`) === 'true'
const isBindOutboundsEnabled = env('KUMA_DATAPLANE_BIND_OUTBOUNDS', `${fake.datatype.boolean()}`) === 'true'
const isTcpAccesslogViaNamedPipeEnabled = env('KUMA_DATAPLANE_TCP_ACCESSLOG_VIA_NAMED_PIPE', `${fake.datatype.boolean()}`) === 'true'

const outboundCount = parseInt(env('KUMA_DATAPLANEOUTBOUND_COUNT', `${fake.number.int({ min: 1, max: 10 })}`))
const subscriptionCount = parseInt(env('KUMA_SUBSCRIPTION_COUNT', `${fake.number.int({ min: 1, max: 10 })}`))
Expand Down Expand Up @@ -180,8 +183,10 @@ export default ({ env, fake }: Dependencies): ResponseHandler => (req) => {
}),
metadata: {
features: [
...fake.kuma.dataplaneFeatures(),
...(isTcpAccesslogViaNamedPipeEnabled ? ['feature-tcp-accesslog-via-named-pipe'] : []),
...(isTransparentProxyingEnabled ? ['feature-transparent-proxy-in-dataplane-metadata'] : []),
...(isUnifiedResourceNamingEnabled ? ['feature-unified-resource-naming'] : []),
...(isBindOutboundsEnabled ? ['feature-bind-outbounds'] : []),
],
},
},
Expand Down