Skip to content

Commit

Permalink
Merge branch 'main' into nginx-stream-values
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Rodríguez Hernández <carlosrh@vmware.com>
  • Loading branch information
carrodher committed Sep 18, 2024
2 parents 7847033 + 894aca0 commit 7424903
Show file tree
Hide file tree
Showing 397 changed files with 2,670 additions and 6,008 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cd-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
permissions:
contents: read
env:
CSP_API_URL: https://console.cloud.vmware.com
CSP_API_URL: https://console.tanzu.broadcom.com
CSP_API_TOKEN: ${{ secrets.CSP_API_TOKEN }}
VIB_PUBLIC_URL: https://cp.bromelia.vmware.com
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ jobs:
verification-mode: ${{ steps.get-asset-vib-config.outputs.verification_mode }}
runtime-parameters-file: ${{ steps.get-asset-vib-config.outputs.runtime_parameters_file }}
env:
CSP_API_URL: https://console.cloud.vmware.com
CSP_API_URL: https://console.tanzu.broadcom.com
CSP_API_TOKEN: ${{ secrets.CSP_API_TOKEN }}
VIB_PUBLIC_URL: https://cp.bromelia.vmware.com
# Target-Platform used by default
Expand Down
20 changes: 11 additions & 9 deletions .vib/consul/ginkgo/consul_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
. "github.com/onsi/gomega"
appsv1 "k8s.io/api/apps/v1"
batchv1 "k8s.io/api/batch/v1"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
)
Expand All @@ -35,6 +36,7 @@ var _ = Describe("Consul", Ordered, func() {

getAvailableReplicas := func(ss *appsv1.StatefulSet) int32 { return ss.Status.AvailableReplicas }
getSucceededJobs := func(j *batchv1.Job) int32 { return j.Status.Succeeded }
getRestartedAtAnnotation := func(pod *v1.Pod) string { return pod.Annotations["kubectl.kubernetes.io/restartedAt"] }
getOpts := metav1.GetOptions{}

By("checking all the replicas are available")
Expand Down Expand Up @@ -72,19 +74,19 @@ var _ = Describe("Consul", Ordered, func() {
return c.BatchV1().Jobs(namespace).Get(ctx, putKVJobName, getOpts)
}, timeout, PollingInterval).Should(WithTransform(getSucceededJobs, Equal(int32(1))))

By("scaling down to 0 replicas")
ss, err = utils.StsScale(
ctx, c, ss, 0)
By("rollout restart the statefulset")
_, err = utils.StsRolloutRestart(ctx, c, ss)
Expect(err).NotTo(HaveOccurred())

for i := int(origReplicas) - 1; i >= 0; i-- {
Eventually(func() (*v1.Pod, error) {
return c.CoreV1().Pods(namespace).Get(ctx, fmt.Sprintf("%s-%d", stsName, i), getOpts)
}, timeout, PollingInterval).Should(WithTransform(getRestartedAtAnnotation, Not(BeEmpty())))
}

Eventually(func() (*appsv1.StatefulSet, error) {
return c.AppsV1().StatefulSets(namespace).Get(ctx, stsName, getOpts)
}, timeout, PollingInterval).Should(WithTransform(getAvailableReplicas, BeZero()))

By("scaling up to the original replicas")
ss, err = utils.StsScale(
ctx, c, ss, origReplicas)
Expect(err).NotTo(HaveOccurred())
}, timeout, PollingInterval).Should(WithTransform(getAvailableReplicas, Equal(origReplicas)))

Eventually(func() (*appsv1.StatefulSet, error) {
return c.AppsV1().StatefulSets(namespace).Get(ctx, stsName, getOpts)
Expand Down
20 changes: 11 additions & 9 deletions .vib/elasticsearch/ginkgo/elasticsearch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
. "github.com/onsi/gomega"
appsv1 "k8s.io/api/apps/v1"
batchv1 "k8s.io/api/batch/v1"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
)
Expand All @@ -33,6 +34,7 @@ var _ = Describe("Elasticsearch", Ordered, func() {
When("an index is created and Elasticsearch is scaled down to 0 replicas and back up", func() {
It("should have access to the created index", func() {
getReplicaCount := func(ss *appsv1.StatefulSet) int32 { return ss.Status.Replicas }
getRestartedAtAnnotation := func(pod *v1.Pod) string { return pod.Annotations["kubectl.kubernetes.io/restartedAt"] }
getReadyReplicas := func(ss *appsv1.StatefulSet) int32 { return ss.Status.ReadyReplicas }
getSucceededJobs := func(j *batchv1.Job) int32 { return j.Status.Succeeded }
getOpts := metav1.GetOptions{}
Expand Down Expand Up @@ -71,19 +73,19 @@ var _ = Describe("Elasticsearch", Ordered, func() {
return c.BatchV1().Jobs(namespace).Get(ctx, createDBJobName, getOpts)
}, timeout, PollingInterval).Should(WithTransform(getSucceededJobs, Equal(int32(1))))

By("scaling down to 0 replicas")
ss, err = utils.StsScale(
ctx, c, ss, 0)
By("rollout restart the statefulset")
_, err = utils.StsRolloutRestart(ctx, c, ss)
Expect(err).NotTo(HaveOccurred())

for i := int(origReplicas) - 1; i >= 0; i-- {
Eventually(func() (*v1.Pod, error) {
return c.CoreV1().Pods(namespace).Get(ctx, fmt.Sprintf("%s-%d", stsName, i), getOpts)
}, timeout, PollingInterval).Should(WithTransform(getRestartedAtAnnotation, Not(BeEmpty())))
}

Eventually(func() (*appsv1.StatefulSet, error) {
return c.AppsV1().StatefulSets(namespace).Get(ctx, stsName, getOpts)
}, timeout, PollingInterval).Should(WithTransform(getReplicaCount, BeZero()))

By("scaling up to the original replicas")
ss, err = utils.StsScale(
ctx, c, ss, origReplicas)
Expect(err).NotTo(HaveOccurred())
}, timeout, PollingInterval).Should(WithTransform(getReplicaCount, Equal(origReplicas)))

Eventually(func() (*appsv1.StatefulSet, error) {
return c.AppsV1().StatefulSets(namespace).Get(ctx, stsName, getOpts)
Expand Down
30 changes: 10 additions & 20 deletions .vib/etcd/ginkgo/etcd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
. "github.com/onsi/gomega"
appsv1 "k8s.io/api/apps/v1"
batchv1 "k8s.io/api/batch/v1"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
)
Expand All @@ -34,6 +35,7 @@ var _ = Describe("etcd", Ordered, func() {
It("should have access to the created database", func() {

getAvailableReplicas := func(ss *appsv1.StatefulSet) int32 { return ss.Status.AvailableReplicas }
getRestartedAtAnnotation := func(pod *v1.Pod) string { return pod.Annotations["kubectl.kubernetes.io/restartedAt"] }
getSucceededJobs := func(j *batchv1.Job) int32 { return j.Status.Succeeded }
getOpts := metav1.GetOptions{}

Expand Down Expand Up @@ -71,28 +73,16 @@ var _ = Describe("etcd", Ordered, func() {
return c.BatchV1().Jobs(namespace).Get(ctx, createKeyJobName, getOpts)
}, timeout, PollingInterval).Should(WithTransform(getSucceededJobs, Equal(int32(1))))

// We cannot scale the cluster to 0 because etcd needs a minimum quorum to work. Therefore
// we will delete one pod, ensure it's back in the cluster, and then move onto the next
// https://etcd.io/docs/v3.5/op-guide/recovery/
for i := 0; i < int(origReplicas); i++ {
By(fmt.Sprintf("Redeploying replica %d", i))
podName := fmt.Sprintf("%s-%d", stsName, i)
err = c.CoreV1().Pods(namespace).Delete(ctx, podName, metav1.DeleteOptions{})
Expect(err).NotTo(HaveOccurred())
// In order to avoid race conditions, we ensure that the number of available replicas is N-1
// and then we check that it's back to N
Eventually(func() (*appsv1.StatefulSet, error) {
return c.AppsV1().StatefulSets(namespace).Get(ctx, stsName, getOpts)
}, timeout, PollingInterval).Should(WithTransform(getAvailableReplicas, Equal(origReplicas-1)))
Eventually(func() (*appsv1.StatefulSet, error) {
return c.AppsV1().StatefulSets(namespace).Get(ctx, stsName, getOpts)
}, timeout, PollingInterval).Should(WithTransform(getAvailableReplicas, Equal(origReplicas)))
}

By("scaling up to the original replicas")
ss, err = utils.StsScale(ctx, c, ss, origReplicas)
By("rollout restart the statefulset")
_, err = utils.StsRolloutRestart(ctx, c, ss)
Expect(err).NotTo(HaveOccurred())

for i := int(origReplicas) - 1; i >= 0; i-- {
Eventually(func() (*v1.Pod, error) {
return c.CoreV1().Pods(namespace).Get(ctx, fmt.Sprintf("%s-%d", stsName, i), getOpts)
}, timeout, PollingInterval).Should(WithTransform(getRestartedAtAnnotation, Not(BeEmpty())))
}

Eventually(func() (*appsv1.StatefulSet, error) {
return c.AppsV1().StatefulSets(namespace).Get(ctx, stsName, getOpts)
}, timeout, PollingInterval).Should(WithTransform(getAvailableReplicas, Equal(origReplicas)))
Expand Down
File renamed without changes.
20 changes: 9 additions & 11 deletions .vib/kafka/ginkgo/kafka_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
. "github.com/onsi/gomega"
appsv1 "k8s.io/api/apps/v1"
batchv1 "k8s.io/api/batch/v1"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
)
Expand All @@ -34,6 +35,7 @@ var _ = Describe("Kafka", Ordered, func() {
It("should have access to the created topic", func() {

getAvailableReplicas := func(ss *appsv1.StatefulSet) int32 { return ss.Status.AvailableReplicas }
getRestartedAtAnnotation := func(pod *v1.Pod) string { return pod.Annotations["kubectl.kubernetes.io/restartedAt"] }
getSucceededJobs := func(j *batchv1.Job) int32 { return j.Status.Succeeded }
getOpts := metav1.GetOptions{}

Expand Down Expand Up @@ -71,19 +73,15 @@ var _ = Describe("Kafka", Ordered, func() {
return c.BatchV1().Jobs(namespace).Get(ctx, createTPJobName, getOpts)
}, timeout, PollingInterval).Should(WithTransform(getSucceededJobs, Equal(int32(1))))

By("scaling down to 0 replicas")
ss, err = utils.StsScale(
ctx, c, ss, 0)
By("rollout restart the statefulset")
_, err = utils.StsRolloutRestart(ctx, c, ss)
Expect(err).NotTo(HaveOccurred())

Eventually(func() (*appsv1.StatefulSet, error) {
return c.AppsV1().StatefulSets(namespace).Get(ctx, stsName, getOpts)
}, timeout, PollingInterval).Should(WithTransform(getAvailableReplicas, BeZero()))

By("scaling up to the original replicas")
ss, err = utils.StsScale(
ctx, c, ss, origReplicas)
Expect(err).NotTo(HaveOccurred())
for i := int(origReplicas) - 1; i >= 0; i-- {
Eventually(func() (*v1.Pod, error) {
return c.CoreV1().Pods(namespace).Get(ctx, fmt.Sprintf("%s-%d", stsName, i), getOpts)
}, timeout, PollingInterval).Should(WithTransform(getRestartedAtAnnotation, Not(BeEmpty())))
}

Eventually(func() (*appsv1.StatefulSet, error) {
return c.AppsV1().StatefulSets(namespace).Get(ctx, stsName, getOpts)
Expand Down
14 changes: 0 additions & 14 deletions .vib/magento/cypress/cypress.config.js

This file was deleted.

60 changes: 0 additions & 60 deletions .vib/magento/cypress/cypress/e2e/magento.cy.js

This file was deleted.

8 changes: 0 additions & 8 deletions .vib/magento/cypress/cypress/fixtures/customers.json

This file was deleted.

6 changes: 0 additions & 6 deletions .vib/magento/cypress/cypress/fixtures/discounts.json

This file was deleted.

Binary file not shown.
5 changes: 0 additions & 5 deletions .vib/magento/cypress/cypress/fixtures/pages.json

This file was deleted.

6 changes: 0 additions & 6 deletions .vib/magento/cypress/cypress/fixtures/products.json

This file was deleted.

77 changes: 0 additions & 77 deletions .vib/magento/cypress/cypress/support/commands.js

This file was deleted.

Loading

0 comments on commit 7424903

Please sign in to comment.