Skip to content

Commit bbd956c

Browse files
committed
fix: install sealed secrets in kube-system
1 parent 56e92df commit bbd956c

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

build-and-deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ WEBTOP_IMAGE=$(cat helm/wrongsecrets-ctf-party/values.yaml | yq '.virtualdesktop
1818
WEBTOP_TAG=$(cat helm/wrongsecrets-ctf-party/values.yaml | yq '.virtualdesktop.tag')
1919
echo "doing workaround for selaed secrets"
2020
helm repo add sealed-secrets https://bitnami-labs.github.io/sealed-secrets
21-
helm install ws-sealedsecret sealed-secrets/sealed-secrets
21+
helm install ws-sealedsecrets sealed-secrets/sealed-secrets -n kube-system
2222
echo "Pulling in required images to actually run $WRONGSECRETS_IMAGE:$WRONGSECRETS_TAG & $WEBTOP_IMAGE:$WEBTOP_TAG."
2323
echo "If you see an authentication failure: pull them manually by the following 2 commands"
2424
echo "'docker pull $WRONGSECRETS_IMAGE:$WRONGSECRETS_TAG'"

wrongsecrets-balancer/src/kubernetes.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,16 +129,10 @@ const checkSealedSecretsController = async () => {
129129
try {
130130
logger.info('Checking Sealed Secrets controller deployment status...');
131131
const response = await safeApiCall(
132-
() => k8sAppsApi.readNamespacedDeployment({name: 'sealed-secrets-controller', namespace:'kube-system'}),
132+
() => k8sAppsApi.readNamespacedDeployment({name: 'ws-sealedsecrets-sealed-secrets', namespace:'kube-system'}),
133133
'Check Sealed Secrets controller'
134134
);
135-
// const response = await k8sAppsApi.readNamespacedDeployment('sealed-secrets-controller', 'kube-system');
136-
if (!response || !response.body) {
137-
logger.warn('Sealed Secrets controller deployment not found');
138-
return false;
139-
}
140-
141-
const deployment = response.body;
135+
const deployment = response;
142136
const isReady = deployment.status && deployment.status.readyReplicas > 0;
143137

144138
logger.info(`Sealed Secrets controller status: ${isReady ? 'Ready' : 'Not Ready'}`);

wrongsecrets-balancer/src/teams/teams.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,11 @@ async function createTeam(req, res) {
376376
});
377377
} catch (error) {
378378
logger.error(`Error while creating deployment or service for team ${team}: ${error.message}`);
379+
if (!res.headersSent) {
379380
res.status(500).send({ message: 'Failed to Create Instance' });
381+
} else {
382+
logger.error('Could not send error response because headers were already sent');
383+
}
380384
}
381385
}
382386

0 commit comments

Comments
 (0)