-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] CLOUDP-278384: Support Independent ID config generation #3330
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
akoapi "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api" | ||
akov2 "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1" | ||
akov2common "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/common" | ||
akov2provider "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/provider" | ||
Check failure on line 28 in internal/kubernetes/operator/deployment/deployment.go GitHub Actions / docs
Check failure on line 28 in internal/kubernetes/operator/deployment/deployment.go GitHub Actions / unit-tests (ubuntu-latest)
Check failure on line 28 in internal/kubernetes/operator/deployment/deployment.go GitHub Actions / unit-tests (windows-latest)
Check failure on line 28 in internal/kubernetes/operator/deployment/deployment.go GitHub Actions / unit-tests (macos-latest)
|
||
akov2status "github.com/mongodb/mongodb-atlas-kubernetes/v2/pkg/api/v1/status" | ||
atlasClustersPinned "go.mongodb.org/atlas-sdk/v20240530005/admin" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
|
@@ -124,10 +124,13 @@ | |
}, | ||
}, | ||
Spec: akov2.AtlasDeploymentSpec{ | ||
Project: akov2common.ResourceRefNamespaced{ | ||
Project: &akov2common.ResourceRefNamespaced{ | ||
Name: resources.NormalizeAtlasName(projectName, dictionary), | ||
Namespace: targetNamespace, | ||
}, | ||
ExternalProjectRef: &akov2.ExternalProjectReference{ | ||
ID: projectID, | ||
}, | ||
DeploymentSpec: advancedSpec, | ||
ServerlessSpec: nil, | ||
ProcessArgs: nil, | ||
|
@@ -490,7 +493,7 @@ | |
}, | ||
}, | ||
Spec: akov2.AtlasDeploymentSpec{ | ||
Project: akov2common.ResourceRefNamespaced{ | ||
Project: &akov2common.ResourceRefNamespaced{ | ||
Name: resources.NormalizeAtlasName(projectName, dictionary), | ||
Namespace: targetNamespace, | ||
}, | ||
|
@@ -544,3 +547,15 @@ | |
} | ||
return result, nil | ||
} | ||
|
||
func FixReference(deployment *akov2.AtlasDeployment, independentResource bool, credentials string) *akov2.AtlasDeployment { | ||
if independentResource { | ||
deployment.Spec.Project = nil | ||
deployment.Spec.ConnectionSecret = &akoapi.LocalObjectReference{ | ||
Name: credentials, | ||
} | ||
return deployment | ||
} | ||
deployment.Spec.ExternalProjectRef = nil | ||
return deployment | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is required for local development, but will not work on the CI, obviously.
This PR needs to wait for the 2.5 release to happen, or at least for the
v2.5.0
to exist.