Skip to content

Commit

Permalink
MinioS3Server.hs: fix destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasjm committed Aug 2, 2024
1 parent eb057d6 commit 908ff28
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,13 @@ withK8SMinioS3Server' kubectlBinary kcc@(KubernetesClusterContext {..}) MinioOpe
createProcessWithLoggingAndStdin ((proc kubectlBinary ["apply", "-f", "-"]) { env = Just env }) (toString finalYaml)
>>= waitForProcess >>= (`shouldBe` ExitSuccess)

return userAndPassword
return (userAndPassword, finalYaml)

let destroy _ = do
let destroy (_, finalYaml) = do
info [i|-------------------------- DESTROYING --------------------------|]
runWithKubeConfig kubectlBinary ["delete", "-k", kustomizationDir
, "--namespace", toString minioS3ServerNamespace]
createProcessWithLoggingAndStdin ((proc kubectlBinary ["apply", "-f", "-"]) { env = Just env }) (toString finalYaml)
>>= waitForProcess >>= (`shouldBe` ExitSuccess)


let createNetworkPolicy = do
let (policyName, discoverPodPolicyName, yaml) = networkPolicy deploymentName
Expand All @@ -184,7 +185,7 @@ withK8SMinioS3Server' kubectlBinary kcc@(KubernetesClusterContext {..}) MinioOpe
runWithKubeConfig kubectlBinary ["delete", "NetworkPolicy", discoverPodPolicyName, "--namespace", toString minioS3ServerNamespace]

-- TODO: create network policy allowing ingress/egress for v1.min.io/tenant = deploymentName
bracket createNetworkPolicy destroyNetworkPolicy $ \_ -> bracket create destroy $ \(username, password) -> do
bracket createNetworkPolicy destroyNetworkPolicy $ \_ -> bracket create destroy $ \((username, password), _) -> do
do
uuid <- makeUUID
p <- createProcessWithLogging ((proc kubectlBinary [
Expand Down

0 comments on commit 908ff28

Please sign in to comment.