Skip to content
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

fix: mongodbprovider crd name #10

Merged
merged 1 commit into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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