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
7 changes: 5 additions & 2 deletions charts/opskubedbcom-druidopsrequest-editor/ui/create-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -689,14 +689,14 @@ step:
fullwidth: true
if:
type: function
name: returnFalse
name: isTlsEnabled
schema: schema/properties/spec/properties/tls/properties/remove
- type: switch
label: Rotate Certificates
fullwidth: true
if:
type: function
name: returnFalse
name: isTlsEnabled
schema: schema/properties/spec/properties/tls/properties/rotateCertificates
- type: block-layout
if:
Expand Down Expand Up @@ -740,6 +740,7 @@ step:
schema: schema/properties/spec/properties/tls/properties/issuerRef/properties/name
- type: block-layout
label: Certificates
showLabels: false
if:
type: function
name: showIssuerRefAndCertificates
Expand All @@ -757,6 +758,8 @@ step:
loader: fetchAliasOptions
disable: disableAlias
schema: alias
validation:
type: required
- type: input
label: Secret Name
schema: secretName
Expand Down
15 changes: 12 additions & 3 deletions charts/opskubedbcom-druidopsrequest-editor/ui/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,8 @@ export const useFunc = (model) => {
}

async function getDbDetails() {
machinesFromPreset = storeGet('/kubedbuiPresets')?.admin?.machineProfiles?.machines || []

const owner = storeGet('/route/params/user')
const cluster = storeGet('/route/params/cluster')
const namespace = storeGet('/route/query/namespace') || getValue(model, '/metadata/namespace')
Expand All @@ -455,6 +457,11 @@ export const useFunc = (model) => {
} else return {}
}

function isTlsEnabled() {
const dbDetails = getValue(discriminator, '/dbDetails')
return (dbDetails?.spec?.sslMode && dbDetails?.spec?.sslMode !== 'disabled' && dbDetails?.spec?.sslMode !== 'disable') || dbDetails?.spec?.tls
}

async function getDbVersions() {
const owner = storeGet('/route/params/user')
const cluster = storeGet('/route/params/cluster')
Expand Down Expand Up @@ -844,7 +851,7 @@ export const useFunc = (model) => {
memory: machineData.limits.memory,
},
}
} else return { text: machine, value: { machine } }
} else return { text: machine, value: { machine, cpu: limits.cpu, memory: limits.memory } }
}
})
} else {
Expand Down Expand Up @@ -894,8 +901,6 @@ export const useFunc = (model) => {
}
const machine = parsedInstance[type] || 'custom'

machinesFromPreset = storeGet('/kubedbuiPresets')?.admin?.machineProfiles?.machines || []

const machinePresets = machinesFromPreset.find((item) => item.id === machine)
if (machinePresets) {
return {
Expand Down Expand Up @@ -1741,6 +1746,9 @@ export const useFunc = (model) => {
return getIssuer(url)
}
return clusterIssuers
}else if (!kind) {
commit('wizard/model$delete', '/spec/tls/issuerRef/name')
return []
}

async function getIssuer(url) {
Expand Down Expand Up @@ -2163,5 +2171,6 @@ export const useFunc = (model) => {
getNestedValue,
hasTopologyType,
getResourceConfig,
isTlsEnabled
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1335,18 +1335,18 @@ step:
- temp/tlsOperation
schema: temp/tlsOperation
- type: switch
label: 'Remove TLS'
label: Remove TLS
fullwidth: true
if:
type: function
name: returnFalse
name: isTlsEnabled
schema: schema/properties/spec/properties/tls/properties/remove
- type: switch
label: 'Rotate Certificates'
label: Rotate Certificates
fullwidth: true
if:
type: function
name: returnFalse
name: isTlsEnabled
schema: schema/properties/spec/properties/tls/properties/rotateCertificates
- type: block-layout
label: Issuer Reference
Expand Down Expand Up @@ -1396,7 +1396,7 @@ step:
schema: schema/properties/spec/properties/tls/properties/issuerRef/properties/name
- type: block-layout
label: Certificates
showLabels: true
showLabels: false
if:
type: function
name: showIssuerRefAndCertificates
Expand All @@ -1412,6 +1412,8 @@ step:
loader: fetchAliasOptions
disable: disableAlias
schema: alias
validation:
type: required
- type: input
label: Secret Name
schema: secretName
Expand Down
15 changes: 12 additions & 3 deletions charts/opskubedbcom-elasticsearchopsrequest-editor/ui/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,8 @@ export const useFunc = (model) => {
}

async function getDbDetails() {
machinesFromPreset = storeGet('/kubedbuiPresets')?.admin?.machineProfiles?.machines || []

const owner = storeGet('/route/params/user')
const cluster = storeGet('/route/params/cluster')
const namespace = storeGet('/route/query/namespace') || getValue(model, '/metadata/namespace')
Expand Down Expand Up @@ -478,6 +480,11 @@ export const useFunc = (model) => {
} else return {}
}

function isTlsEnabled() {
const dbDetails = getValue(discriminator, '/dbDetails')
return (dbDetails?.spec?.sslMode && dbDetails?.spec?.sslMode !== 'disabled' && dbDetails?.spec?.sslMode !== 'disable') || dbDetails?.spec?.tls
}

function initDatabaseRef() {
// watchDependency('model#/metadata/namespace')
const { name } = route.params || {}
Expand Down Expand Up @@ -896,7 +903,7 @@ export const useFunc = (model) => {
memory: machineData.limits.memory,
},
}
} else return { text: machine, value: { machine } }
} else return { text: machine, value: { machine, cpu: limits.cpu, memory: limits.memory } }
}
})
} else {
Expand Down Expand Up @@ -945,8 +952,6 @@ export const useFunc = (model) => {
}
const machine = parsedInstance[type] || 'custom'

machinesFromPreset = storeGet('/kubedbuiPresets')?.admin?.machineProfiles?.machines || []

const machinePresets = machinesFromPreset.find((item) => item.id === machine)
if (machinePresets) {
return {
Expand Down Expand Up @@ -1664,6 +1669,9 @@ export const useFunc = (model) => {
return getIssuer(url)
}
return clusterIssuers
} else if (!kind) {
commit('wizard/model$delete', '/spec/tls/issuerRef/name')
return []
}

async function getIssuer(url) {
Expand Down Expand Up @@ -2070,5 +2078,6 @@ export const useFunc = (model) => {
setApplyToIfReady,
hasResourceValue,
hasVolumeExpansion,
isTlsEnabled
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -307,15 +307,15 @@ step:
label: Remove TLS
fullwidth: true
if:
name: returnFalse
name: isTlsEnabled
type: function
schema: schema/properties/spec/properties/tls/properties/remove
- type: switch
label: Rotate Certificates
fullwidth: true
schema: schema/properties/spec/properties/tls/properties/rotateCertificates
if:
name: returnFalse
name: isTlsEnabled
type: function
- type: block-layout
label: Issuer Reference
Expand Down Expand Up @@ -365,7 +365,7 @@ step:
schema: schema/properties/spec/properties/tls/properties/issuerRef/properties/name
- type: block-layout
label: Certificates
showLabels: true
showLabels: false
if:
name: showIssuerRefAndCertificates
type: function
Expand All @@ -381,6 +381,8 @@ step:
loader: fetchAliasOptions
disable: disableAlias
schema: alias
validation:
type: required
- type: input
label: Secret Name
schema: secretName
Expand Down
15 changes: 12 additions & 3 deletions charts/opskubedbcom-ferretdbopsrequest-editor/ui/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,11 @@ export const useFunc = (model) => {
return false
}

function isTlsEnabled() {
const dbDetails = getValue(discriminator, '/dbDetails')
return (dbDetails?.spec?.sslMode && dbDetails?.spec?.sslMode !== 'disabled' && dbDetails?.spec?.sslMode !== 'disable') || dbDetails?.spec?.tls
}

function isRancherManaged() {
const managers = storeGet('/cluster/clusterDefinition/result/clusterManagers')
const found = managers.find((item) => item === 'Rancher')
Expand Down Expand Up @@ -404,6 +409,8 @@ export const useFunc = (model) => {
}

async function getDbDetails() {
machinesFromPreset = storeGet('/kubedbuiPresets')?.admin?.machineProfiles?.machines || []

const owner = storeGet('/route/params/user')
const cluster = storeGet('/route/params/cluster')
const namespace = storeGet('/route/query/namespace') || getValue(model, '/metadata/namespace')
Expand Down Expand Up @@ -742,7 +749,7 @@ export const useFunc = (model) => {
memory: machineData.limits.memory,
},
}
} else return { text: machine, value: { machine } }
} else return { text: machine, value: { machine, cpu: limits.cpu, memory: limits.memory } }
}
})
} else {
Expand Down Expand Up @@ -784,8 +791,6 @@ export const useFunc = (model) => {
}
const machine = parsedInstance[type] || 'custom'

machinesFromPreset = storeGet('/kubedbuiPresets')?.admin?.machineProfiles?.machines || []

const machinePresets = machinesFromPreset.find((item) => item.id === machine)
if (machinePresets) {
return {
Expand Down Expand Up @@ -1035,6 +1040,9 @@ export const useFunc = (model) => {
return getIssuer(url)
}
return clusterIssuers
} else if (!kind) {
commit('wizard/model$delete', '/spec/tls/issuerRef/name')
return []
}

async function getIssuer(url) {
Expand Down Expand Up @@ -1272,5 +1280,6 @@ export const useFunc = (model) => {
setMachine,
onMachineChange,
isMachineCustom,
isTlsEnabled,
}
}
8 changes: 5 additions & 3 deletions charts/opskubedbcom-kafkaopsrequest-editor/ui/create-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -639,15 +639,15 @@ step:
label: Remove TLS
fullwidth: true
if:
name: returnFalse
name: isTlsEnabled
type: function
schema: schema/properties/spec/properties/tls/properties/remove
- type: switch
label: Rotate Certificates
fullwidth: true
schema: schema/properties/spec/properties/tls/properties/rotateCertificates
if:
name: returnFalse
name: isTlsEnabled
type: function
- type: block-layout
label: Issuer Reference
Expand Down Expand Up @@ -697,7 +697,7 @@ step:
schema: schema/properties/spec/properties/tls/properties/issuerRef/properties/name
- type: block-layout
label: Certificates
showLabels: true
showLabels: false
if:
name: showIssuerRefAndCertificates
type: function
Expand All @@ -713,6 +713,8 @@ step:
loader: fetchAliasOptions
disable: disableAlias
schema: alias
validation:
type: required
- type: input
label: Secret Name
schema: secretName
Expand Down
15 changes: 12 additions & 3 deletions charts/opskubedbcom-kafkaopsrequest-editor/ui/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,11 @@ export const useFunc = (model) => {
return false
}

function isTlsEnabled() {
const dbDetails = getValue(discriminator, '/dbDetails')
return (dbDetails?.spec?.sslMode && dbDetails?.spec?.sslMode !== 'disabled' && dbDetails?.spec?.sslMode !== 'disable') || dbDetails?.spec?.tls
}

function isRancherManaged() {
const managers = storeGet('/cluster/clusterDefinition/result/clusterManagers')
const found = managers.find((item) => item === 'Rancher')
Expand Down Expand Up @@ -407,6 +412,8 @@ export const useFunc = (model) => {
}

async function getDbDetails() {
machinesFromPreset = storeGet('/kubedbuiPresets')?.admin?.machineProfiles?.machines || []

const owner = storeGet('/route/params/user')
const cluster = storeGet('/route/params/cluster')
const namespace = storeGet('/route/query/namespace') || getValue(model, '/metadata/namespace')
Expand Down Expand Up @@ -766,7 +773,7 @@ export const useFunc = (model) => {
memory: machineData.limits.memory,
},
}
} else return { text: machine, value: { machine } }
} else return { text: machine, value: { machine, cpu: limits.cpu, memory: limits.memory } }
}
})
} else {
Expand Down Expand Up @@ -811,8 +818,6 @@ export const useFunc = (model) => {
}
const machine = parsedInstance[type] || 'custom'

machinesFromPreset = storeGet('/kubedbuiPresets')?.admin?.machineProfiles?.machines || []

const machinePresets = machinesFromPreset.find((item) => item.id === machine)
if (machinePresets) {
return {
Expand Down Expand Up @@ -1549,6 +1554,9 @@ export const useFunc = (model) => {
return getIssuer(url)
}
return clusterIssuers
} else if (!kind) {
commit('wizard/model$delete', '/spec/tls/issuerRef/name')
return []
}

async function getIssuer(url) {
Expand Down Expand Up @@ -1830,5 +1838,6 @@ export const useFunc = (model) => {
onRemoveConfigChange,
onNewConfigSecretChange,
onSelectedSecretChange,
isTlsEnabled,
}
}
Loading
Loading