Repository: devopsspiral/KubeLibrary (language: python)

Issue:
Running from withing the cluster
Running from withing the cluster


Discussion / hints:

Fix patch:
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 7571c211..94eb1ec1 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -134,6 +134,7 @@ jobs:
           step-name: Run Grafana examples
           command: |
             # Grafana tests
+            K8S_VERSION=$(echo ${K3D_CLUSTER_VERSION:1} | cut -d "-" -f1)
             docker run --rm \
             --network container:k3d-${K3D_CLUSTER}-serverlb \
             --volumes-from kubeconfig \
@@ -141,6 +142,7 @@ jobs:
             -e KLIB_POD_PATTERN='grafana.*' \
             -e KLIB_POD_ANNOTATIONS='{"kubelibrary":"testing"}' \
             -e KLIB_POD_NAMESPACE=default \
+            -e KUBELET_VERSION=$K8S_VERSION \
             kubelibrary -i grafana /testcases/
   publish-to-pypi:
     executor: python/default


Test patch:
diff --git a/testcases/daemonset/daemonsets_kw.robot b/testcases/daemonset/daemonsets_kw.robot
index c05f3fef..8ad5fb04 100644
--- a/testcases/daemonset/daemonsets_kw.robot
+++ b/testcases/daemonset/daemonsets_kw.robot
@@ -8,19 +8,24 @@ Library           KubeLibrary
 
 *** Keywords ***
 List all daemonsets
-    Sleep  10s
     [Arguments]  ${namespace} 
     @{namespace_daemonsets}=  Get Daemonsets In Namespace    ${namespace}  
     Length Should Be  ${namespace_daemonsets}  1
     Log  \nDaemonsets ${namespace_daemonsets}:  console=True
     FOR  ${daemonset}  IN  @{namespace_daemonsets}
-        ${daemonset_details}=  Get Daemonset Details In Namespace  ${daemonset}  ${namespace}
-        Log  \nDaemonset - ${daemonset}:  console=True
-        Log  \n\tDesired Number Scheduled : ${daemonset_details.status.desired_number_scheduled}   console=True
-        Log  \n\tNumber Ready : ${daemonset_details.status.number_ready} :  console=True
-        Should be equal   ${daemonset_details.status.desired_number_scheduled}    ${daemonset_details.status.number_ready}
+        Wait Until Keyword Succeeds  1min  5sec  Check Daemonset readiness  ${daemonset}  ${namespace} 
     END
 
+Check Daemonset readiness
+    [Arguments]  ${daemonset}  ${namespace}
+    ${daemonset_details}=  Get Daemonset Details In Namespace  ${daemonset}  ${namespace}
+    Log  \nDaemonset - ${daemonset}:  console=True
+    Log  \n\tDesired Number Scheduled : ${daemonset_details.status.desired_number_scheduled}   console=True
+    Log  \n\tNumber Ready : ${daemonset_details.status.number_ready} :  console=True
+    Should be True  ${daemonset_details.status.number_ready} > 0
+    Should be equal   ${daemonset_details.status.desired_number_scheduled}    ${daemonset_details.status.number_ready}
+
+
 List daemonsets filtered by label
     [Arguments]  ${namespace}   ${label}
     @{namespace_daemonsets}=  Get Daemonsets In Namespace    ${namespace}    ${label}