diff --git a/Makefile b/Makefile index 30c29824..a3b1b42f 100644 --- a/Makefile +++ b/Makefile @@ -256,6 +256,9 @@ update: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/ uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion. $(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f - +.PHONY: reinstall +reinstall: uninstall install ## Reinstall CRDs from the K8s cluster specified in ~/.kube/config. + .PHONY: deploy deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config. cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG} diff --git a/test/e2e/ytsaurus_controller_test.go b/test/e2e/ytsaurus_controller_test.go index 01765e34..267b4055 100644 --- a/test/e2e/ytsaurus_controller_test.go +++ b/test/e2e/ytsaurus_controller_test.go @@ -633,25 +633,29 @@ func deployAndCheck(ytsaurus *ytv1.Ytsaurus, namespace string) { func getSimpleUpdateScenario(namespace, newImage string) func(ctx context.Context) { return func(ctx context.Context) { By("Creating a Ytsaurus resource") - ytsaurus := ytv1.CreateBaseYtsaurusResource(namespace) DeferCleanup(deleteYtsaurus, ytsaurus) name := types.NamespacedName{Name: ytsaurus.GetName(), Namespace: namespace} deployAndCheck(ytsaurus, namespace) By("Run cluster update") - + podsBeforeUpdate := getComponentPods(ctx, namespace) Expect(k8sClient.Get(ctx, name, ytsaurus)).Should(Succeed()) ytsaurus.Spec.CoreImage = newImage Expect(k8sClient.Update(ctx, ytsaurus)).Should(Succeed()) EventuallyYtsaurus(ctx, name, reactionTimeout).Should(HaveClusterState(ytv1.ClusterStateUpdating)) By("Wait cluster update complete") - EventuallyYtsaurus(ctx, name, upgradeTimeout).Should(HaveClusterState(ytv1.ClusterStateRunning)) g := ytconfig.NewGenerator(ytsaurus, "local") ytClient := getYtClient(g, namespace) checkClusterBaseViability(ytClient) + + podsAfterFullUpdate := getComponentPods(ctx, namespace) + podDiff := diffPodsCreation(podsBeforeUpdate, podsAfterFullUpdate) + Expect(podDiff.created.IsEmpty()).To(BeTrue(), "unexpected pod diff created %v", podDiff.created) + Expect(podDiff.deleted.IsEmpty()).To(BeTrue(), "unexpected pod diff deleted %v", podDiff.deleted) + Expect(podDiff.recreated.Equal(NewStringSetFromMap(podsBeforeUpdate))).To(BeTrue(), "unexpected pod diff recreated %v", podDiff.recreated) } }