@@ -699,6 +699,107 @@ var _ = Describe("Keystone controller", func() {
699699 })
700700 })
701701
702+ When ("Deployment rollout is progressing" , func () {
703+ BeforeEach (func () {
704+ DeferCleanup (
705+ k8sClient .Delete , ctx , CreateKeystoneMessageBusSecret (namespace , "rabbitmq-secret" ))
706+ DeferCleanup (th .DeleteInstance , CreateKeystoneAPI (keystoneAPIName , GetDefaultKeystoneAPISpec ()))
707+ DeferCleanup (
708+ k8sClient .Delete , ctx , CreateKeystoneAPISecret (namespace , SecretName ))
709+ DeferCleanup (infra .DeleteMemcached , infra .CreateMemcached (namespace , "memcached" , memcachedSpec ))
710+ DeferCleanup (
711+ mariadb .DeleteDBService ,
712+ mariadb .CreateDBService (
713+ namespace ,
714+ GetKeystoneAPI (keystoneAPIName ).Spec .DatabaseInstance ,
715+ corev1.ServiceSpec {
716+ Ports : []corev1.ServicePort {{Port : 3306 }},
717+ },
718+ ),
719+ )
720+ mariadb .SimulateMariaDBAccountCompleted (keystoneAccountName )
721+ mariadb .SimulateMariaDBDatabaseCompleted (keystoneDatabaseName )
722+ infra .SimulateTransportURLReady (types.NamespacedName {
723+ Name : fmt .Sprintf ("%s-keystone-transport" , keystoneAPIName .Name ),
724+ Namespace : namespace ,
725+ })
726+ infra .SimulateMemcachedReady (types.NamespacedName {
727+ Name : "memcached" ,
728+ Namespace : namespace ,
729+ })
730+ th .SimulateJobSuccess (dbSyncJobName )
731+ th .SimulateJobSuccess (bootstrapJobName )
732+ th .SimulateDeploymentProgressing (deploymentName )
733+ })
734+
735+ It ("shows the deployment progressing in DeploymentReadyCondition" , func () {
736+ th .ExpectConditionWithDetails (
737+ keystoneAPIName ,
738+ ConditionGetterFunc (KeystoneConditionGetter ),
739+ condition .DeploymentReadyCondition ,
740+ corev1 .ConditionFalse ,
741+ condition .RequestedReason ,
742+ condition .DeploymentReadyRunningMessage ,
743+ )
744+ th .ExpectCondition (
745+ keystoneAPIName ,
746+ ConditionGetterFunc (KeystoneConditionGetter ),
747+ condition .ReadyCondition ,
748+ corev1 .ConditionFalse ,
749+ )
750+ })
751+
752+ It ("still shows the deployment progressing in DeploymentReadyCondition when rollout hits ProgressDeadlineExceeded" , func () {
753+ th .SimulateDeploymentProgressDeadlineExceeded (deploymentName )
754+ th .ExpectConditionWithDetails (
755+ keystoneAPIName ,
756+ ConditionGetterFunc (KeystoneConditionGetter ),
757+ condition .DeploymentReadyCondition ,
758+ corev1 .ConditionFalse ,
759+ condition .RequestedReason ,
760+ condition .DeploymentReadyRunningMessage ,
761+ )
762+ th .ExpectCondition (
763+ keystoneAPIName ,
764+ ConditionGetterFunc (KeystoneConditionGetter ),
765+ condition .ReadyCondition ,
766+ corev1 .ConditionFalse ,
767+ )
768+ })
769+
770+ It ("reaches Ready when deployment rollout finished" , func () {
771+ th .ExpectConditionWithDetails (
772+ keystoneAPIName ,
773+ ConditionGetterFunc (KeystoneConditionGetter ),
774+ condition .DeploymentReadyCondition ,
775+ corev1 .ConditionFalse ,
776+ condition .RequestedReason ,
777+ condition .DeploymentReadyRunningMessage ,
778+ )
779+ th .ExpectCondition (
780+ keystoneAPIName ,
781+ ConditionGetterFunc (KeystoneConditionGetter ),
782+ condition .ReadyCondition ,
783+ corev1 .ConditionFalse ,
784+ )
785+
786+ th .SimulateDeploymentReplicaReady (deploymentName )
787+ th .ExpectCondition (
788+ keystoneAPIName ,
789+ ConditionGetterFunc (KeystoneConditionGetter ),
790+ condition .DeploymentReadyCondition ,
791+ corev1 .ConditionTrue ,
792+ )
793+
794+ th .ExpectCondition (
795+ keystoneAPIName ,
796+ ConditionGetterFunc (KeystoneConditionGetter ),
797+ condition .ReadyCondition ,
798+ corev1 .ConditionTrue ,
799+ )
800+ })
801+ })
802+
702803 When ("A KeystoneAPI is created with service override" , func () {
703804 BeforeEach (func () {
704805 spec := GetDefaultKeystoneAPISpec ()
0 commit comments