Skip to content

Commit

Permalink
Merge pull request #10 from uselagoon/fix-mongodb-provider
Browse files Browse the repository at this point in the history
fix: mongodbprovider crd name
  • Loading branch information
Marco Cadetg authored May 31, 2024
2 parents 27ac329 + 43389b2 commit 4018e84
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 28 deletions.
8 changes: 4 additions & 4 deletions api/v1alpha1/mongodbprovider_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ type MongoDBProviderStatus struct {
//+kubebuilder:object:root=true
//+kubebuilder:subresource:status

// MongoDBDProvider is the Schema for the mongodbproviders API
type MongoDBDProvider struct {
// MongoDBProvider is the Schema for the mongodbproviders API
type MongoDBProvider struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Expand All @@ -130,9 +130,9 @@ type MongoDBDProvider struct {
type MongoDBProviderList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []MongoDBDProvider `json:"items"`
Items []MongoDBProvider `json:"items"`
}

func init() {
SchemeBuilder.Register(&MongoDBDProvider{}, &MongoDBProviderList{})
SchemeBuilder.Register(&MongoDBProvider{}, &MongoDBProviderList{})
}
12 changes: 6 additions & 6 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions config/crd/bases/crd.lagoon.sh_mongodbdproviders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
name: mongodbdproviders.crd.lagoon.sh
name: mongodbproviders.crd.lagoon.sh
spec:
group: crd.lagoon.sh
names:
kind: MongoDBDProvider
listKind: MongoDBDProviderList
plural: mongodbdproviders
singular: mongodbdprovider
kind: MongoDBProvider
listKind: MongoDBProviderList
plural: mongodbproviders
singular: mongodbprovider
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: MongoDBDProvider is the Schema for the mongodbproviders API
description: MongoDBProvider is the Schema for the mongodbproviders API
properties:
apiVersion:
description: |-
Expand Down
12 changes: 6 additions & 6 deletions config/crd/bases/crd.lagoon.sh_mongodbproviders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
name: mongodbdproviders.crd.lagoon.sh
name: mongodbproviders.crd.lagoon.sh
spec:
group: crd.lagoon.sh
names:
kind: MongoDBDProvider
listKind: MongoDBDProviderList
plural: mongodbdproviders
singular: mongodbdprovider
kind: MongoDBProvider
listKind: MongoDBProviderList
plural: mongodbproviders
singular: mongodbprovider
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: MongoDBDProvider is the Schema for the mongodbproviders API
description: MongoDBProvider is the Schema for the mongodbproviders API
properties:
apiVersion:
description: |-
Expand Down
6 changes: 3 additions & 3 deletions internal/controller/mongodbprovider_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func (r *MongoDBProviderReconciler) Reconcile(ctx context.Context, req ctrl.Requ
logger := log.FromContext(ctx).WithName("mongodbprovider_controller")
logger.Info("Reconciling MongoDBProvider")

instance := &crdv1alpha1.MongoDBDProvider{}
instance := &crdv1alpha1.MongoDBProvider{}
if err := r.Get(ctx, req.NamespacedName, instance); err != nil {
if client.IgnoreNotFound(err) == nil {
logger.Info("MongoDBProvider resource not found. Ignoring since object must be deleted")
Expand Down Expand Up @@ -269,7 +269,7 @@ func (r *MongoDBProviderReconciler) Reconcile(ctx context.Context, req ctrl.Requ

func (r *MongoDBProviderReconciler) handleError(
ctx context.Context,
instance *crdv1alpha1.MongoDBDProvider,
instance *crdv1alpha1.MongoDBProvider,
promErr string,
err error,
) (ctrl.Result, error) {
Expand Down Expand Up @@ -310,7 +310,7 @@ func (r *MongoDBProviderReconciler) SetupWithManager(mgr ctrl.Manager) error {
)
r.Recorder = mgr.GetEventRecorderFor("mongodbprovider-controller")
return ctrl.NewControllerManagedBy(mgr).
For(&crdv1alpha1.MongoDBDProvider{}).
For(&crdv1alpha1.MongoDBProvider{}).
WithEventFilter(predicate.GenerationChangedPredicate{}).
// Only allow one reconcile at a time
WithOptions(controller.Options{
Expand Down
6 changes: 3 additions & 3 deletions internal/controller/mongodbprovider_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ var _ = Describe("MongoDBProvider Controller", func() {
Name: resourceName,
Namespace: "default",
}
mongodbprovider := &crdv1alpha1.MongoDBDProvider{}
mongodbprovider := &crdv1alpha1.MongoDBProvider{}

BeforeEach(func() {
By("creating the custom resource for the Kind MongoDBProvider")
Expand All @@ -68,7 +68,7 @@ var _ = Describe("MongoDBProvider Controller", func() {

err = k8sClient.Get(ctx, typeNamespacedName, mongodbprovider)
if err != nil && errors.IsNotFound(err) {
resource := &crdv1alpha1.MongoDBDProvider{
resource := &crdv1alpha1.MongoDBProvider{
ObjectMeta: metav1.ObjectMeta{
Name: resourceName,
Namespace: "default",
Expand All @@ -95,7 +95,7 @@ var _ = Describe("MongoDBProvider Controller", func() {

AfterEach(func() {
// TODO(user): Cleanup logic after each test, like removing the resource instance.
resource := &crdv1alpha1.MongoDBDProvider{}
resource := &crdv1alpha1.MongoDBProvider{}
err := k8sClient.Get(ctx, typeNamespacedName, resource)
Expect(err).NotTo(HaveOccurred())

Expand Down

0 comments on commit 4018e84

Please sign in to comment.