Skip to content

Commit a43cb61

Browse files
github-actions[bot]igor-karpukhinleo-ri
authored
Release 0.8.1 (#507)
* Pushing deploy/all-in-one.yaml using GitHub API * Pushing deploy/clusterwide/clusterwide-config.yaml using GitHub API * Pushing deploy/clusterwide/crds.yaml using GitHub API * Pushing deploy/openshift/crds.yaml using GitHub API * Pushing deploy/openshift/openshift.yaml using GitHub API * Pushing deploy/crds/atlas.mongodb.com_atlasprojects.yaml using GitHub API * Pushing deploy/crds/atlas.mongodb.com_atlasclusters.yaml using GitHub API * Pushing deploy/crds/atlas.mongodb.com_atlasdatabaseusers.yaml using GitHub API * Pushing deploy/namespaced/namespaced-config.yaml using GitHub API * Pushing deploy/namespaced/crds.yaml using GitHub API * Pushing third_party_licenses.txt using GitHub API * Pushing bundle/metadata/annotations.yaml using GitHub API * Pushing bundle/manifests/mongodb-atlas-metrics-reader_rbac.authorization.k8s.io_v1_clusterrole.yaml using GitHub API * Pushing bundle/manifests/mongodb-atlas-controller-manager-metrics-service_v1_service.yaml using GitHub API * Pushing bundle/manifests/atlas.mongodb.com_atlasprojects.yaml using GitHub API * Pushing bundle/manifests/mongodb-atlas-kubernetes.clusterserviceversion.yaml using GitHub API * Pushing bundle/manifests/atlas.mongodb.com_atlasclusters.yaml using GitHub API * Pushing bundle/manifests/atlas.mongodb.com_atlasdatabaseusers.yaml using GitHub API * Pushing bundle/tests/scorecard/config.yaml using GitHub API * Pushing bundle.Dockerfile using GitHub API * Fixed broken main.go * Change log level for dev by default, update linter (#487) * update post-release workflow * remove patch replace * Backport of 08e3e87 * removed unused method * Fixed dbUserTest * Fixed dbUserTest * Fixed linter config * Increased timeout for the Openshift test * Fix for operator tag Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Igor Karpukhin <[email protected]> Co-authored-by: Svetlana <[email protected]>
1 parent 6928e04 commit a43cb61

File tree

14 files changed

+184
-111
lines changed

14 files changed

+184
-111
lines changed

.github/actions/set-tag/entrypoint.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,7 @@ if [ -z "${branch_name}" ]; then
1212
fi
1313
branch_name=$(echo "${branch_name}" | sed 's/\//-/g')
1414
tag="${branch_name}-${commit_id}"
15+
16+
# Replace all dots with dashes
17+
tag=$(echo "${tag}" | awk '{gsub(/\./, "-", $0); print $0}')
1518
echo "::set-output name=tag::$tag"

.github/workflows/lint.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,21 @@ jobs:
1717
steps:
1818
- uses: actions/[email protected]
1919

20+
- name: Setup Go
21+
uses: actions/setup-go@v2
22+
with:
23+
go-version: "1.17"
24+
2025
- name: golangci-lint
21-
uses: golangci/golangci-lint-action@v2.5.2
26+
uses: golangci/golangci-lint-action@v3.1.0
2227
with:
2328
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
24-
version: v1.36
29+
version: v1.45.2
2530

2631
# Optional: working directory, useful for monorepos
2732
# working-directory:
2833

29-
args: --timeout 10m
34+
args: --timeout 10m --exclude=dupl
3035
# Optional: show only new issues if it's a pull request. The default value is `false`.
3136
# only-new-issues: true
3237

.github/workflows/release-post-merge.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
uses: actions/[email protected]
5050
with:
5151
fetch-depth: 0 #needs for tags
52+
ref: ${{ github.event.pull_request.head.ref }}
5253

5354
- name: Create configuration package
5455
run: |

bundle/manifests/mongodb-atlas-kubernetes.clusterserviceversion.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ metadata:
6969
description: The MongoDB Atlas Kubernetes Operator enables easy management of Clusters in MongoDB Atlas
7070
operators.operatorframework.io/builder: operator-sdk-v1.15.0+git
7171
operators.operatorframework.io/project_layout: go.kubebuilder.io/v2
72-
name: mongodb-atlas-kubernetes.v0.8.0
72+
name: mongodb-atlas-kubernetes.v0.8.1
7373
namespace: placeholder
7474
spec:
7575
apiservicedefinitions: {}
@@ -327,7 +327,7 @@ spec:
327327
valueFrom:
328328
fieldRef:
329329
fieldPath: metadata.annotations['olm.targetNamespaces']
330-
image: registry.connect.redhat.com/mongodb/mongodb-atlas-kubernetes-operator:0.8.0
330+
image: registry.connect.redhat.com/mongodb/mongodb-atlas-kubernetes-operator:0.8.1
331331
imagePullPolicy: Always
332332
livenessProbe:
333333
httpGet:
@@ -402,5 +402,5 @@ spec:
402402
maturity: beta
403403
provider:
404404
name: MongoDB, Inc
405-
version: 0.8.0
406-
replaces: mongodb-atlas-kubernetes.v0.7.0
405+
version: 0.8.1
406+
replaces: mongodb-atlas-kubernetes.v0.8.0

deploy/all-in-one.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1413,7 +1413,7 @@ spec:
14131413
valueFrom:
14141414
fieldRef:
14151415
fieldPath: metadata.namespace
1416-
image: mongodb/mongodb-atlas-kubernetes-operator:0.8.0
1416+
image: mongodb/mongodb-atlas-kubernetes-operator:0.8.1
14171417
imagePullPolicy: Always
14181418
livenessProbe:
14191419
httpGet:

deploy/clusterwide/clusterwide-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ spec:
214214
valueFrom:
215215
fieldRef:
216216
fieldPath: metadata.namespace
217-
image: mongodb/mongodb-atlas-kubernetes-operator:0.8.0
217+
image: mongodb/mongodb-atlas-kubernetes-operator:0.8.1
218218
imagePullPolicy: Always
219219
livenessProbe:
220220
httpGet:

deploy/namespaced/namespaced-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ spec:
220220
valueFrom:
221221
fieldRef:
222222
fieldPath: metadata.namespace
223-
image: mongodb/mongodb-atlas-kubernetes-operator:0.8.0
223+
image: mongodb/mongodb-atlas-kubernetes-operator:0.8.1
224224
imagePullPolicy: Always
225225
livenessProbe:
226226
httpGet:

deploy/openshift/openshift.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ spec:
219219
valueFrom:
220220
fieldRef:
221221
fieldPath: metadata.namespace
222-
image: mongodb/mongodb-atlas-kubernetes-operator:0.8.0
222+
image: mongodb/mongodb-atlas-kubernetes-operator:0.8.1
223223
imagePullPolicy: Always
224224
livenessProbe:
225225
httpGet:

test/e2e/openshift_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ var _ = Describe("Openshift UI test", Label("openshift"), func() {
4343
opm.Version()
4444

4545
operatorTag = strings.Split(s["BUNDLE_IMAGE"], ":")[1]
46+
operatorTag = strings.ReplaceAll(operatorTag, ".", "-")
4647
operatorTag = strings.ToLower(operatorTag)
4748
Expect(s["BUNDLE_IMAGE"]).ShouldNot(BeEmpty(), "Could not get a image name. Please, set up BUNDLE_IMAGE environment variable")
4849
Expect(operatorTag).ShouldNot(BeEmpty())
@@ -54,9 +55,9 @@ var _ = Describe("Openshift UI test", Label("openshift"), func() {
5455
if CurrentSpecReport().Failed() && !strings.Contains(page.URL(), "token") {
5556
pagereport.MakeScreenshot(page, "error")
5657
}
57-
oc.Delete(path) // we delete it all the time, because of shared space
58-
closeBrowser(pw, browser, page)
58+
oc.Delete(path)
5959
kubecli.DeleteResource("configmap", lockNamespace, lockNamespace) // clean lockConfig Map
60+
closeBrowser(pw, browser, page)
6061
})
6162

6263
It("User can deploy Atlas Kubernetes operator from openshift", func() {

test/e2e/ui/openshift/pom/operator_hub.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,13 @@ func (m *MarketPage) ChooseProviderType(catalogName string) *MarketPage {
5353

5454
func (m *MarketPage) InstallAtlasOperator() *MarketPage {
5555
atlasOperatorLoc := fmt.Sprintf("[data-test=\"mongodb-atlas-kubernetes-%s-openshift-marketplace\"]", m.CatalogSourceName)
56-
Expect(m.P.Click(atlasOperatorLoc, playwright.PageClickOptions{
57-
Timeout: playwright.Float(timeoutShort),
58-
})).ShouldNot(HaveOccurred())
56+
err := m.P.Click(atlasOperatorLoc, playwright.PageClickOptions{
57+
Timeout: playwright.Float(timeout),
58+
})
59+
Expect(err).ShouldNot(HaveOccurred(), "Please, make sure the test-catalog is deployed")
5960
Expect(m.P.Click(installConfirmLoc)).ShouldNot(HaveOccurred())
6061
Expect(m.P.Click(installButtonLoc)).ShouldNot(HaveOccurred())
61-
_, err := m.P.WaitForSelector(viewOperatorLoc, playwright.PageWaitForSelectorOptions{
62+
_, err = m.P.WaitForSelector(viewOperatorLoc, playwright.PageWaitForSelectorOptions{
6263
State: playwright.WaitForSelectorStateAttached,
6364
Timeout: playwright.Float(timeout),
6465
})

test/int/cluster_test.go

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -638,8 +638,11 @@ var _ = Describe("AtlasCluster", Label("int", "AtlasCluster"), func() {
638638
createdCluster.ObjectMeta.Annotations = map[string]string{customresource.ResourcePolicyAnnotation: customresource.ResourcePolicyKeep}
639639
Expect(k8sClient.Create(context.Background(), createdCluster)).ToNot(HaveOccurred())
640640

641-
Eventually(testutil.WaitFor(k8sClient, createdCluster, status.TrueCondition(status.ReadyType), validateClusterCreatingFunc()),
642-
30*time.Minute, interval).Should(BeTrue())
641+
Eventually(
642+
func(g Gomega) {
643+
success := testutil.WaitFor(k8sClient, createdCluster, status.TrueCondition(status.ReadyType), validateClusterCreatingFuncGContext(g))()
644+
g.Expect(success).To(BeTrue())
645+
}).WithTimeout(30 * time.Minute).WithPolling(interval).Should(Succeed())
643646
})
644647
By("Deleting the cluster - stays in Atlas", func() {
645648
Expect(k8sClient.Delete(context.Background(), createdCluster)).To(Succeed())
@@ -664,8 +667,11 @@ var _ = Describe("AtlasCluster", Label("int", "AtlasCluster"), func() {
664667
By(`Creating the cluster with reconciliation policy "skip" first`, func() {
665668
createdCluster = mdbv1.DefaultAWSCluster(namespace.Name, createdProject.Name).Lightweight()
666669
Expect(k8sClient.Create(context.Background(), createdCluster)).ToNot(HaveOccurred())
667-
Eventually(testutil.WaitFor(k8sClient, createdCluster, status.TrueCondition(status.ReadyType), validateClusterCreatingFunc()),
668-
30*time.Minute, interval).Should(BeTrue())
670+
Eventually(
671+
func(g Gomega) {
672+
success := testutil.WaitFor(k8sClient, createdCluster, status.TrueCondition(status.ReadyType), validateClusterCreatingFuncGContext(g))()
673+
g.Expect(success).To(BeTrue())
674+
}).WithTimeout(30 * time.Minute).WithPolling(interval).Should(Succeed())
669675

670676
createdCluster.ObjectMeta.Annotations = map[string]string{customresource.ReconciliationPolicyAnnotation: customresource.ReconciliationPolicySkip}
671677
createdCluster.Spec.ClusterSpec.Labels = append(createdCluster.Spec.ClusterSpec.Labels, mdbv1.LabelSpec{
@@ -698,8 +704,11 @@ var _ = Describe("AtlasCluster", Label("int", "AtlasCluster"), func() {
698704
By(fmt.Sprintf("Creating the Advanced Cluster %s", kube.ObjectKeyFromObject(createdCluster)), func() {
699705
Expect(k8sClient.Create(context.Background(), createdCluster)).ToNot(HaveOccurred())
700706

701-
Eventually(testutil.WaitFor(k8sClient, createdCluster, status.TrueCondition(status.ReadyType), validateClusterCreatingFunc()),
702-
30*time.Minute, interval).Should(BeTrue())
707+
Eventually(
708+
func(g Gomega) {
709+
success := testutil.WaitFor(k8sClient, createdCluster, status.TrueCondition(status.ReadyType), validateClusterCreatingFuncGContext(g))()
710+
g.Expect(success).To(BeTrue())
711+
}).WithTimeout(30 * time.Minute).WithPolling(interval).Should(Succeed())
703712

704713
doAdvancedClusterStatusChecks()
705714
checkAdvancedAtlasState()
@@ -717,7 +726,7 @@ func validateClusterCreatingFunc() func(a mdbv1.AtlasCustomResource) {
717726
}
718727
// When the create request has been made to Atlas - we expect the following status
719728
if startedCreation {
720-
Expect(c.Status.StateName).To(Equal("CREATING"), fmt.Sprintf("Current conditions: %+v", c.Status.Conditions))
729+
Expect(c.Status.StateName).To(Or(Equal("CREATING"), Equal("IDLE")), fmt.Sprintf("Current conditions: %+v", c.Status.Conditions))
721730
expectedConditionsMatchers := testutil.MatchConditions(
722731
status.FalseCondition(status.ClusterReadyType).WithReason(string(workflow.ClusterCreating)).WithMessageRegexp("cluster is provisioning"),
723732
status.FalseCondition(status.ReadyType),
@@ -731,6 +740,29 @@ func validateClusterCreatingFunc() func(a mdbv1.AtlasCustomResource) {
731740
}
732741
}
733742
}
743+
func validateClusterCreatingFuncGContext(g Gomega) func(a mdbv1.AtlasCustomResource) {
744+
startedCreation := false
745+
return func(a mdbv1.AtlasCustomResource) {
746+
c := a.(*mdbv1.AtlasCluster)
747+
if c.Status.StateName != "" {
748+
startedCreation = true
749+
}
750+
// When the create request has been made to Atlas - we expect the following status
751+
if startedCreation {
752+
g.Expect(c.Status.StateName).To(Or(Equal("CREATING"), Equal("IDLE")), fmt.Sprintf("Current conditions: %+v", c.Status.Conditions))
753+
expectedConditionsMatchers := testutil.MatchConditions(
754+
status.FalseCondition(status.ClusterReadyType).WithReason(string(workflow.ClusterCreating)).WithMessageRegexp("cluster is provisioning"),
755+
status.FalseCondition(status.ReadyType),
756+
status.TrueCondition(status.ValidationSucceeded),
757+
)
758+
g.Expect(c.Status.Conditions).To(ConsistOf(expectedConditionsMatchers))
759+
} else {
760+
// Otherwise there could have been some exception in Atlas on creation - let's check the conditions
761+
condition, ok := testutil.FindConditionByType(c.Status.Conditions, status.ClusterReadyType)
762+
g.Expect(ok).To(BeFalse(), fmt.Sprintf("Unexpected condition: %v", condition))
763+
}
764+
}
765+
}
734766

735767
func validateClusterUpdatingFunc() func(a mdbv1.AtlasCustomResource) {
736768
isIdle := true

test/int/clusterwide/dbuser_test.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,11 @@ var _ = Describe("ClusterWide", Label("int", "ClusterWide"), func() {
111111

112112
Expect(k8sClient.Create(context.Background(), createdClusterAWS)).ToNot(HaveOccurred())
113113

114-
Eventually(testutil.WaitFor(k8sClient, createdClusterAWS, status.TrueCondition(status.ReadyType), validateClusterCreatingFunc()),
115-
30*time.Minute, interval).Should(BeTrue())
114+
Eventually(
115+
func(g Gomega) {
116+
success := testutil.WaitFor(k8sClient, createdClusterAWS, status.TrueCondition(status.ReadyType), validateClusterCreatingFuncGContext(g))()
117+
g.Expect(success).To(BeTrue())
118+
}).WithTimeout(30 * time.Minute).WithPolling(interval).Should(Succeed())
116119

117120
createdDBUser = mdbv1.DefaultDBUser(userNS.Name, "test-db-user", createdProject.Name).WithPasswordSecret(UserPasswordSecret)
118121
createdDBUser.Spec.Project.Namespace = namespace.Name
@@ -186,7 +189,7 @@ func checkAtlasProjectRemoved(projectID string) func() bool {
186189
}
187190
}
188191

189-
func validateClusterCreatingFunc() func(a mdbv1.AtlasCustomResource) {
192+
func validateClusterCreatingFuncGContext(g Gomega) func(a mdbv1.AtlasCustomResource) {
190193
startedCreation := false
191194
return func(a mdbv1.AtlasCustomResource) {
192195
c := a.(*mdbv1.AtlasCluster)
@@ -195,17 +198,17 @@ func validateClusterCreatingFunc() func(a mdbv1.AtlasCustomResource) {
195198
}
196199
// When the create request has been made to Atlas - we expect the following status
197200
if startedCreation {
198-
Expect(c.Status.StateName).To(Equal("CREATING"), fmt.Sprintf("Current conditions: %+v", c.Status.Conditions))
201+
g.Expect(c.Status.StateName).To(Or(Equal("CREATING"), Equal("IDLE")), fmt.Sprintf("Current conditions: %+v", c.Status.Conditions))
199202
expectedConditionsMatchers := testutil.MatchConditions(
200203
status.FalseCondition(status.ClusterReadyType).WithReason(string(workflow.ClusterCreating)).WithMessageRegexp("cluster is provisioning"),
201204
status.FalseCondition(status.ReadyType),
202205
status.TrueCondition(status.ValidationSucceeded),
203206
)
204-
Expect(c.Status.Conditions).To(ConsistOf(expectedConditionsMatchers))
207+
g.Expect(c.Status.Conditions).To(ConsistOf(expectedConditionsMatchers))
205208
} else {
206209
// Otherwise there could have been some exception in Atlas on creation - let's check the conditions
207210
condition, ok := testutil.FindConditionByType(c.Status.Conditions, status.ClusterReadyType)
208-
Expect(ok).To(BeFalse(), fmt.Sprintf("Unexpected condition: %v", condition))
211+
g.Expect(ok).To(BeFalse(), fmt.Sprintf("Unexpected condition: %v", condition))
209212
}
210213
}
211214
}

0 commit comments

Comments
 (0)