sandwich-contexts-kubernetes 0.1.1.0 → 0.1.1.1
raw patch · 2 files changed
+16/−7 lines, 2 files
Files
- lib/Test/Sandwich/Contexts/Kubernetes/KataContainers.hs +15/−5
- sandwich-contexts-kubernetes.cabal +1/−2
lib/Test/Sandwich/Contexts/Kubernetes/KataContainers.hs view
@@ -81,7 +81,7 @@ defaultKataContainersOptions :: KataContainersOptions defaultKataContainersOptions = KataContainersOptions { kataContainersSourceCheckout = SourceCheckoutNixDerivation kataContainersDerivation- , kataContainersKataDeployImage = Just "quay.io/kata-containers/kata-deploy:3.9.0"+ , kataContainersKataDeployImage = Just kataContainersDeployImage , kataContainersPreloadImages = True , kataContainersLabelNode = True }@@ -173,15 +173,18 @@ loadImageIfNecessary' kcc (ImageLoadSpecDocker image IfNotPresent) -- Install kata-deploy+ debug [i|Applying kata-rbac.yaml|] createProcessWithLoggingAndStdin ((proc kubectlBinary ["apply", "-f", "-"]) { env = Just env }) (toString rbacContents) >>= waitForProcess >>= (`shouldBe` ExitSuccess)+ debug [i|Applying kata-deploy.yaml|] createProcessWithLoggingAndStdin ((proc kubectlBinary ["apply", "-f", "-"]) { env = Just env }) (toString deploymentContents) >>= waitForProcess >>= (`shouldBe` ExitSuccess) + debug [i|Waiting for kata-deploy pod to exist|] podName <- waitUntil 600 $ do pods <- (T.words . toText) <$> readCreateProcessWithLogging ((- (proc "kubectl" ["-n", "kube-system"- , "get", "pods", "-o=name"]) { env = Just env }+ (proc kubectlBinary ["-n", "kube-system"+ , "get", "pods", "-o=name"]) { env = Just env } ) { env = Just env }) "" case headMay [t | t <- pods, "pod/kata-deploy" `T.isPrefixOf` t] of@@ -207,24 +210,31 @@ toText sout `textShouldContain` "sleep infinity" -- Now install the runtime classes+ debug [i|Applying kata-runtimeClasses.yaml|] runtimeClassesContents <- liftIO $ T.readFile $ kataRoot </> "tools/packaging/kata-deploy/runtimeclasses/kata-runtimeClasses.yaml" createProcessWithLoggingAndStdin ((proc kubectlBinary ["apply", "-f", "-"]) { env = Just env }) (toString runtimeClassesContents) >>= waitForProcess >>= (`shouldBe` ExitSuccess) -- Finally, label the node(s)+ debug [i|Labeling nodes with katacontainers.io/kata-runtime=true|] when kataContainersLabelNode $ do createProcessWithLoggingAndStdin ((proc kubectlBinary ["label", "nodes", "--all", "--overwrite", "katacontainers.io/kata-runtime=true"]) { env = Just env }) (toString deploymentContents) >>= waitForProcess >>= (`shouldBe` ExitSuccess) action $ KataContainersContext options +kataContainersDeployImage :: Text+kataContainersDeployImage = "quay.io/kata-containers/kata-deploy:3.19.1"++-- | Checkout of the @kata-containers@ repo. Currently at release 3.19.1.+kataContainersDerivation :: Text kataContainersDerivation = [__i|{fetchFromGitHub}: fetchFromGitHub { owner = "kata-containers"; repo = "kata-containers";- rev = "cdaaf708a18da8e5f7e2b9824fa3e43b524893a5";- sha256 = "sha256-aBcu59LybgZ9xkCDUzZXb60FeClQNG1ivfC6lWQdlb0=";+ rev = "acae4480ac84701d7354e679714cc9d084b37f44";+ sha256 = "sha256-h9Jsto2l1NhQEwIQoecT/D+yt/QbGoqqH/l6NNzJOwk="; } |]
sandwich-contexts-kubernetes.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: sandwich-contexts-kubernetes-version: 0.1.1.0+version: 0.1.1.1 synopsis: Sandwich test contexts for Kubernetes description: Please see README.md author: Tom McLaughlin@@ -125,7 +125,6 @@ ghc-options: -Wunused-packages -Wall -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N build-depends: base >=4.11 && <5- , exceptions , random , relude , sandwich