Skip to content

Commit 35ff9f3

Browse files
helderjsjosvazg
andauthored
CLOUDP-304797: Fix configuration to assess RH warnings (#2275)
* Fix configuration to assess RH warnings * Rebased and patched Signed-off-by: jose.vazquez <[email protected]> --------- Signed-off-by: jose.vazquez <[email protected]> Co-authored-by: jose.vazquez <[email protected]>
1 parent 8093227 commit 35ff9f3

26 files changed

+140
-35
lines changed

.github/actions/gen-install-scripts/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ RUN cd /usr/local/bin &&\
1515
RUN CONTROLLER_GEN_TMP_DIR=$(mktemp -d) && \
1616
cd $CONTROLLER_GEN_TMP_DIR && \
1717
go mod init tmp && \
18-
go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.16.1 && \
18+
go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.17.2 && \
1919
rm -rf $CONTROLLER_GEN_TMP_DIR && \
2020
CONTROLLER_GEN=${GOBIN}/controller-gen
2121

PROJECT

+8
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,12 @@ resources:
143143
kind: AtlasNetworkPeering
144144
path: github.com/mongodb/mongodb-atlas-kubernetes/v2/api/v1
145145
version: v1
146+
- api:
147+
crdVersion: v1
148+
namespaced: true
149+
domain: mongodb.com
150+
group: atlas
151+
kind: AtlasBackupCompliancePolicy
152+
path: github.com/mongodb/mongodb-atlas-kubernetes/v2/api/v1
153+
version: v1
146154
version: "3"

api/v1/atlasbackupcompliancepolicy_types.go

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ func init() {
3636
// +kubebuilder:subresource:status
3737
// +kubebuilder:resource:categories=atlas,shortName=abcp
3838
// +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].status`
39+
40+
// The AtlasBackupCompliancePolicy is a configuration that enforces specific backup and retention requirements
3941
type AtlasBackupCompliancePolicy struct {
4042
metav1.TypeMeta `json:",inline"`
4143
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -44,6 +46,7 @@ type AtlasBackupCompliancePolicy struct {
4446
Status status.BackupCompliancePolicyStatus `json:"status,omitempty"`
4547
}
4648

49+
// AtlasBackupCompliancePolicySpec is the specification of the desired configuration of backup compliance policy
4750
type AtlasBackupCompliancePolicySpec struct {
4851
// Email address of the user who authorized to update the Backup Compliance Policy settings.
4952
// +kubebuilder:validation:Required

config/crd/bases/atlas.mongodb.com_atlasbackupcompliancepolicies.yaml

+5-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.16.1
6+
controller-gen.kubebuilder.io/version: v0.17.2
77
name: atlasbackupcompliancepolicies.atlas.mongodb.com
88
spec:
99
group: atlas.mongodb.com
@@ -25,8 +25,8 @@ spec:
2525
name: v1
2626
schema:
2727
openAPIV3Schema:
28-
description: AtlasBackupCompliancePolicy defines the desired state of a compliance
29-
policy in Atlas.
28+
description: The AtlasBackupCompliancePolicy is a configuration that enforces
29+
specific backup and retention requirements
3030
properties:
3131
apiVersion:
3232
description: |-
@@ -46,6 +46,8 @@ spec:
4646
metadata:
4747
type: object
4848
spec:
49+
description: AtlasBackupCompliancePolicySpec is the specification of the
50+
desired configuration of backup compliance policy
4951
properties:
5052
authorizedEmail:
5153
description: Email address of the user who authorized to update the

config/crd/bases/atlas.mongodb.com_atlasbackuppolicies.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.16.1
6+
controller-gen.kubebuilder.io/version: v0.17.2
77
name: atlasbackuppolicies.atlas.mongodb.com
88
spec:
99
group: atlas.mongodb.com

config/crd/bases/atlas.mongodb.com_atlasbackupschedules.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.16.1
6+
controller-gen.kubebuilder.io/version: v0.17.2
77
name: atlasbackupschedules.atlas.mongodb.com
88
spec:
99
group: atlas.mongodb.com

config/crd/bases/atlas.mongodb.com_atlascustomroles.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.16.1
6+
controller-gen.kubebuilder.io/version: v0.17.2
77
name: atlascustomroles.atlas.mongodb.com
88
spec:
99
group: atlas.mongodb.com

config/crd/bases/atlas.mongodb.com_atlasdatabaseusers.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.16.1
6+
controller-gen.kubebuilder.io/version: v0.17.2
77
name: atlasdatabaseusers.atlas.mongodb.com
88
spec:
99
group: atlas.mongodb.com

config/crd/bases/atlas.mongodb.com_atlasdatafederations.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.16.1
6+
controller-gen.kubebuilder.io/version: v0.17.2
77
name: atlasdatafederations.atlas.mongodb.com
88
spec:
99
group: atlas.mongodb.com

config/crd/bases/atlas.mongodb.com_atlasdeployments.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.16.1
6+
controller-gen.kubebuilder.io/version: v0.17.2
77
name: atlasdeployments.atlas.mongodb.com
88
spec:
99
group: atlas.mongodb.com

config/crd/bases/atlas.mongodb.com_atlasfederatedauths.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.16.1
6+
controller-gen.kubebuilder.io/version: v0.17.2
77
name: atlasfederatedauths.atlas.mongodb.com
88
spec:
99
group: atlas.mongodb.com

config/crd/bases/atlas.mongodb.com_atlasipaccesslists.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.16.1
6+
controller-gen.kubebuilder.io/version: v0.17.2
77
name: atlasipaccesslists.atlas.mongodb.com
88
spec:
99
group: atlas.mongodb.com

config/crd/bases/atlas.mongodb.com_atlasnetworkcontainers.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.16.1
6+
controller-gen.kubebuilder.io/version: v0.17.2
77
name: atlasnetworkcontainers.atlas.mongodb.com
88
spec:
99
group: atlas.mongodb.com

config/crd/bases/atlas.mongodb.com_atlasnetworkpeerings.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.16.1
6+
controller-gen.kubebuilder.io/version: v0.17.2
77
name: atlasnetworkpeerings.atlas.mongodb.com
88
spec:
99
group: atlas.mongodb.com

config/crd/bases/atlas.mongodb.com_atlasprivateendpoints.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.16.1
6+
controller-gen.kubebuilder.io/version: v0.17.2
77
name: atlasprivateendpoints.atlas.mongodb.com
88
spec:
99
group: atlas.mongodb.com

config/crd/bases/atlas.mongodb.com_atlasprojects.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.16.1
6+
controller-gen.kubebuilder.io/version: v0.17.2
77
name: atlasprojects.atlas.mongodb.com
88
spec:
99
group: atlas.mongodb.com

config/crd/bases/atlas.mongodb.com_atlassearchindexconfigs.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.16.1
6+
controller-gen.kubebuilder.io/version: v0.17.2
77
name: atlassearchindexconfigs.atlas.mongodb.com
88
spec:
99
group: atlas.mongodb.com

config/crd/bases/atlas.mongodb.com_atlasstreamconnections.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.16.1
6+
controller-gen.kubebuilder.io/version: v0.17.2
77
name: atlasstreamconnections.atlas.mongodb.com
88
spec:
99
group: atlas.mongodb.com

config/crd/bases/atlas.mongodb.com_atlasstreaminstances.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.16.1
6+
controller-gen.kubebuilder.io/version: v0.17.2
77
name: atlasstreaminstances.atlas.mongodb.com
88
spec:
99
group: atlas.mongodb.com

config/crd/bases/atlas.mongodb.com_atlasteams.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.16.1
6+
controller-gen.kubebuilder.io/version: v0.17.2
77
name: atlasteams.atlas.mongodb.com
88
spec:
99
group: atlas.mongodb.com

config/manifests/bases/mongodb-atlas-kubernetes.clusterserviceversion.yaml

+38
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ metadata:
1414
features.operators.openshift.io/token-auth-aws: "false"
1515
features.operators.openshift.io/token-auth-azure: "false"
1616
features.operators.openshift.io/token-auth-gcp: "false"
17+
repository: https://github.com/mongodb/mongodb-atlas-kubernetes
18+
1719
labels:
1820
operatorframework.io/arch.amd64: supported
1921
operatorframework.io/arch.arm64: supported
@@ -34,6 +36,12 @@ spec:
3436
kind: AtlasSearchIndexConfig
3537
name: atlassearchindexconfigs.atlas.mongodb.com
3638
version: v1
39+
- description: The AtlasBackupCompliancePolicy is a configuration that enforces
40+
specific backup and retention requirements
41+
displayName: Atlas Backup Compliance Policy
42+
kind: AtlasBackupCompliancePolicy
43+
name: atlasbackupcompliancepolicies.atlas.mongodb.com
44+
version: v1
3745
- description: AtlasBackupPolicy is the Schema for the atlasbackuppolicies API
3846
displayName: Atlas Backup Policy
3947
kind: AtlasBackupPolicy
@@ -45,6 +53,11 @@ spec:
4553
kind: AtlasBackupSchedule
4654
name: atlasbackupschedules.atlas.mongodb.com
4755
version: v1
56+
- description: AtlasCustomRole is the Schema for the AtlasCustomRole API
57+
displayName: Atlas Custom Role
58+
kind: AtlasCustomRole
59+
name: atlascustomroles.atlas.mongodb.com
60+
version: v1
4861
- description: AtlasDatabaseUser is the Schema for the Atlas Database User API
4962
displayName: Atlas Database User
5063
kind: AtlasDatabaseUser
@@ -61,6 +74,31 @@ spec:
6174
kind: AtlasDeployment
6275
name: atlasdeployments.atlas.mongodb.com
6376
version: v1
77+
- description: AtlasIPAccessList is the Schema for the atlasipaccesslists API.
78+
displayName: Atlas IPAccess List
79+
kind: AtlasIPAccessList
80+
name: atlasipaccesslists.atlas.mongodb.com
81+
version: v1
82+
- description: AtlasNetworkContainer is the Schema for the AtlasNetworkContainer
83+
API
84+
displayName: Atlas Network Container
85+
kind: AtlasNetworkContainer
86+
name: atlasnetworkcontainers.atlas.mongodb.com
87+
version: v1
88+
- description: AtlasNetworkPeering is the Schema for the AtlasNetworkPeering API
89+
displayName: Atlas Network Peering
90+
kind: AtlasNetworkPeering
91+
name: atlasnetworkpeerings.atlas.mongodb.com
92+
version: v1
93+
- description: |-
94+
The AtlasPrivateEndpoint custom resource definition (CRD) defines a desired [Private Endpoint](https://www.mongodb.com/docs/atlas/security-private-endpoint/#std-label-private-endpoint-overview) configuration for an Atlas project.
95+
It allows a private connection between your cloud provider and Atlas that doesn't send information through a public network.
96+
97+
You can use private endpoints to create a unidirectional connection to Atlas clusters from your virtual network.
98+
displayName: Atlas Private Endpoint
99+
kind: AtlasPrivateEndpoint
100+
name: atlasprivateendpoints.atlas.mongodb.com
101+
version: v1
64102
- description: AtlasProject is the Schema for the atlasprojects API
65103
displayName: Atlas Project
66104
kind: AtlasProject
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apiVersion: atlas.mongodb.com/v1
2+
kind: AtlasBackupCompliancePolicy
3+
metadata:
4+
name: my-backup-compliance-policy
5+
spec:
6+
authorizedEmail: [email protected]
7+
authorizedUserFirstName: John
8+
authorizedUserLastName: Doe
9+
copyProtectionEnabled: false
10+
encryptionAtRestEnabled: false
11+
onDemandPolicy:
12+
retentionUnit: weeks
13+
retentionValue: 3
14+
overwriteBackupPolicies: false
15+
pointInTimeEnabled: true
16+
restoreWindowDays: 42
17+
scheduledPolicyItems:
18+
- frequencyInterval: 2
19+
frequencyType: daily
20+
retentionUnit: days
21+
retentionValue: 7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
apiVersion: atlas.mongodb.com/v1
2+
kind: AtlasCustomRole
3+
metadata:
4+
name: shard-operator-role
5+
spec:
6+
projectRef:
7+
name: my-project
8+
role:
9+
name: my-role
10+
actions:
11+
- name: getShardMap
12+
resources:
13+
- cluster: true
14+
- name: shardingState
15+
resources:
16+
- cluster: true
17+
- name: connPoolStats
18+
resources:
19+
- cluster: true
20+
- name: getLog
21+
resources:
22+
- cluster: true
23+
inheritedRoles:
24+
- name: operator-role-1
25+
database: admin

config/samples/kustomization.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,12 @@ resources:
1111
- atlas_v1_atlasipaccesslist.yaml
1212
- atlas_v1_atlasnetworkcontainer.yaml
1313
- atlas_v1_atlasnetworkpeering.yaml
14+
- atlas_v1_atlasstreaminstance.yaml
15+
- atlas_v1_atlasstreamconnection.yaml
16+
- atlas_v1_atlasdatafederation.yaml
17+
- atlas_v1_atlasfederatedauth.yaml
18+
- atlas_v1_atlasprivateendpoint.yaml
19+
- atlas_v1_atlassearchindexconfigs.yaml
20+
- atlas_v1_atlasbackupcompliancepolicy.yaml
21+
- atlas_v1_atlascustomrole.yaml
1422
# +kubebuilder:scaffold:manifestskustomizesamples

devbox.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
2121
"shellcheck@latest",
2222
23-
"kubernetes-controller-tools@0.16.1",
23+
"kubernetes-controller-tools@0.17.2",
2424
2525
"awscli2@latest",
2626
"go-mockery@latest",

0 commit comments

Comments
 (0)