Skip to content

Commit

Permalink
remove enableTls
Browse files Browse the repository at this point in the history
Signed-off-by: Jeromy Cannon <jeromy@swirldslabs.com>
  • Loading branch information
jeromy-cannon committed Jan 26, 2024
1 parent 7dada78 commit 86931fc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 41 deletions.
20 changes: 5 additions & 15 deletions fullstack-network-manager/src/commands/flags.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -236,16 +236,7 @@ export const operatorKey = {
}
}

export const enableTls = {
name: 'enable-tls',
definition: {
describe: 'Enables TLS for gateway ingress services [grpcs, grpcWeb, hederaExplorer]', // TODO fix
default: false,
type: 'boolean'
}
}

export const tlsClusterIssuerName = {
export const tlsClusterIssuerName = { // tlsClusterIssuerType
name: 'tls-cluster-issuer-name',
definition: { // TODO fix
describe: 'The name of the TLS cluster issuer to use for gateway services, defaults to "self-signed-ca", another option for the acme-cluster-issuer is "letsencrypt-staging" and "letsencrypt-prod"',
Expand All @@ -254,7 +245,7 @@ export const tlsClusterIssuerName = {
}
}

export const selfSignedClusterIssuer = {
export const selfSignedClusterIssuer = { // delete
name: 'self-signed',
definition: {
describe: 'Enable the self signed cluster issuer',
Expand All @@ -263,7 +254,7 @@ export const selfSignedClusterIssuer = {
}
}

export const tlsClusterIssuerNamespace = {
export const tlsClusterIssuerNamespace = { // delete
name: 'tls-cluster-issuer-namespace',
definition: { // TODO fix
describe: 'The namespace of the TLS cluster issuer to use for gateway services, defaults to "cert-manager"',
Expand All @@ -272,7 +263,7 @@ export const tlsClusterIssuerNamespace = {
}
}

export const acmeClusterIssuer = {
export const acmeClusterIssuer = { // delete
name: 'acme-cluster-issuer',
definition: {
describe: 'The acme let\'s encrypt cert-manager cluster issuer, defaults to false',
Expand All @@ -281,7 +272,7 @@ export const acmeClusterIssuer = {
}
}

export const enableHederaExplorerTls = {
export const enableHederaExplorerTls = { // KEEP
name: 'enable-hedera-explorer-tls',
definition: {
describe: 'Enable the Hedera Explorer TLS, defaults to false',
Expand Down Expand Up @@ -322,7 +313,6 @@ export const allFlags = [
chainId,
operatorId,
operatorKey,
enableTls,
tlsClusterIssuerName,
tlsClusterIssuerNamespace,
enableHederaExplorerTls,
Expand Down
16 changes: 6 additions & 10 deletions fullstack-network-manager/src/commands/network.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { constants, Templates } from '../core/index.mjs'
import * as prompts from './prompts.mjs'

export class NetworkCommand extends BaseCommand {
getTlsValueArguments (enableTls, tlsClusterIssuerName, tlsClusterIssuerNamespace, enableHederaExplorerTls) {
getTlsValueArguments (tlsClusterIssuerName, tlsClusterIssuerNamespace, enableHederaExplorerTls) {
// TODO rebuild

return valuesArg
Expand All @@ -28,7 +28,7 @@ export class NetworkCommand extends BaseCommand {
return valuesArg
}

prepareValuesArg (chartDir, valuesFile, deployMirrorNode, deployHederaExplorer, enableTls, tlsClusterIssuerName,
prepareValuesArg (chartDir, valuesFile, deployMirrorNode, deployHederaExplorer, tlsClusterIssuerName,
tlsClusterIssuerNamespace, enableHederaExplorerTls, acmeClusterIssuer, selfSignedClusterIssuer) {
let valuesArg = ''
if (chartDir) {
Expand All @@ -41,9 +41,9 @@ export class NetworkCommand extends BaseCommand {
valuesArg += ` --set cloud.acmeClusterIssuer.enabled=${acmeClusterIssuer}`
valuesArg += ` --set cloud.selfSignedClusterIssuer.enabled=${selfSignedClusterIssuer}`

if (enableTls) {
valuesArg += this.getTlsValueArguments(enableTls, tlsClusterIssuerName, tlsClusterIssuerNamespace, enableHederaExplorerTls)
}
// if (enableTls) {
// valuesArg += this.getTlsValueArguments(enableTls, tlsClusterIssuerName, tlsClusterIssuerNamespace, enableHederaExplorerTls)
// }

return valuesArg
}
Expand All @@ -56,7 +56,6 @@ export class NetworkCommand extends BaseCommand {
const valuesFile = this.configManager.getFlag(flags.valuesFile)
const deployMirrorNode = this.configManager.getFlag(flags.deployMirrorNode)
const deployExplorer = this.configManager.getFlag(flags.deployHederaExplorer)
const enableTls = this.configManager.getFlag(flags.enableTls)
const tlsClusterIssuerName = this.configManager.getFlag(flags.tlsClusterIssuerName)
const tlsClusterIssuerNamespace = this.configManager.getFlag(flags.tlsClusterIssuerNamespace)
const enableHederaExplorerTls = this.configManager.getFlag(flags.enableHederaExplorerTls)
Expand All @@ -71,7 +70,6 @@ export class NetworkCommand extends BaseCommand {
valuesFile: await prompts.promptChartDir(task, valuesFile),
deployMirrorNode: await prompts.promptDeployMirrorNode(task, deployMirrorNode),
deployHederaExplorer: await prompts.promptDeployHederaExplorer(task, deployExplorer),
enableTls: await prompts.promptEnableTls(task, enableTls),
tlsClusterIssuerName: await prompts.promptTlsClusterIssuerName(task, tlsClusterIssuerName),
tlsClusterIssuerNamespace: await prompts.promptTlsClusterIssuerNamespace(task, tlsClusterIssuerNamespace),
enableHederaExplorerTls: await prompts.promptEnableHederaExplorerTls(task, enableHederaExplorerTls),
Expand All @@ -86,7 +84,7 @@ export class NetworkCommand extends BaseCommand {

config.valuesArg = this.prepareValuesArg(config.chartDir,
config.valuesFile, config.deployMirrorNode, config.deployHederaExplorer,
config.enableTls, config.tlsClusterIssuerName, config.tlsClusterIssuerNamespace, config.enableHederaExplorerTls,
config.tlsClusterIssuerName, config.tlsClusterIssuerNamespace, config.enableHederaExplorerTls,
config.acmeClusterIssuer, config.selfSignedClusterIssuer)

return config
Expand Down Expand Up @@ -298,7 +296,6 @@ export class NetworkCommand extends BaseCommand {
flags.deployJsonRpcRelay,
flags.valuesFile,
flags.chartDirectory,
flags.enableTls,
flags.tlsClusterIssuerName,
flags.tlsClusterIssuerNamespace,
flags.enableHederaExplorerTls,
Expand Down Expand Up @@ -351,7 +348,6 @@ export class NetworkCommand extends BaseCommand {
flags.deployHederaExplorer,
flags.valuesFile,
flags.chartDirectory,
flags.enableTls,
flags.tlsClusterIssuerName,
flags.tlsClusterIssuerNamespace,
flags.enableHederaExplorerTls,
Expand Down
16 changes: 0 additions & 16 deletions fullstack-network-manager/src/commands/prompts.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -351,22 +351,6 @@ export async function promptDeployHederaExplorer (task, input) {
}
}

export async function promptEnableTls (task, input) {
try {
if (input === undefined) {
input = await task.prompt(ListrEnquirerPromptAdapter).run({
type: 'toggle',
default: flags.enableTls.definition.default,
message: 'Would you like to enable TLS?'
})
}

return input
} catch (e) {
throw new FullstackTestingError(`input failed: ${flags.enableTls.name}`, e)
}
}

export async function promptSelfSignedClusterIssuer (task, input) {
try {
if (input === undefined) {
Expand Down

0 comments on commit 86931fc

Please sign in to comment.