Skip to content

Commit

Permalink
Update snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
joyliu-q committed Oct 22, 2023
1 parent dc4f477 commit ef2e1c4
Show file tree
Hide file tree
Showing 13 changed files with 1,964 additions and 1,603 deletions.
72 changes: 39 additions & 33 deletions cdk/kittyhawk/src/application/redis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,40 +76,46 @@ export class RedisApplication extends Application {
deployment: {
image: redisProps.deployment?.image ?? "redis",
tag: redisProps.deployment?.tag ?? "6.0",

...((redisProps.persistData && {
volumeMounts: [
{
name: "data",
mountPath: "/redis-master-data",
},
{
name: "config",
mountPath: "/redis-master",
},
],
volumes: [
{
name: "data",
persistentVolumeClaim: {
claimName: `${appname}-pvc`,
},
},
{
name: "config",
configMap: {
name: CONFIG_MAP_NAME,
items: [
{
key: "redis-config",
path: "redis.conf",
volumeMounts: [
...(redisProps.persistData
? [
{
name: "data",
mountPath: "/redis-master-data",
},
{
name: "config",
mountPath: "/redis-master",
},
]
: []),
...(redisProps.deployment?.volumeMounts ?? []),
],
volumes: [
...(redisProps.persistData
? [
{
name: "data",
persistentVolumeClaim: {
claimName: `${appname}-pvc`,
},
],
},
},
],
}) ??
{}),
},
{
name: "config",
configMap: {
name: CONFIG_MAP_NAME,
items: [
{
key: "redis-config",
path: "redis.conf",
},
],
},
},
]
: []),
...(redisProps.deployment?.volumes ?? []),
],
...redisProps.deployment,
},
port: redisProps.port ?? 6379,
Expand Down
4 changes: 2 additions & 2 deletions cdk/kittyhawk/src/container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ export class Container implements ContainerInterface {
}

const secretVolumeName = (vm: VolumeMount) => {
const mountString = (a: string) => a.toLowerCase().split("_").join("-");
const mountString = (a: string) => a.toLowerCase().split("_").join("-") ?? "";
return `${mountString(vm.name)}${
vm.subPath && `-${mountString(vm.subPath)}`
vm.subPath ? `-${mountString(vm.subPath)}` : ""
}`;
};
export class SecretVolume implements VolumeInterface {
Expand Down
10 changes: 5 additions & 5 deletions cdk/kittyhawk/src/deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ export interface DeploymentProps extends ContainerProps {
*/
readonly secretMounts?: VolumeMount[];

/**
* Volume mounts for deployment container.
*/
readonly volumes?: Volume[];

/**
* Volume mounts for deployment container.
*
Expand All @@ -38,6 +33,11 @@ export interface DeploymentProps extends ContainerProps {
*/
readonly volumeMounts?: VolumeMount[];

/**
* Volume mounts for deployment container.
*/
readonly volumes?: Volume[];

/**
* The service account to be used to attach to any deployment pods.
* Default serviceAccountName: release name
Expand Down
Loading

0 comments on commit ef2e1c4

Please sign in to comment.