Skip to content

Commit

Permalink
fix: remove comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiGuranIonos committed Jul 4, 2024
1 parent d59437e commit 13e12e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 25 deletions.
4 changes: 2 additions & 2 deletions apis/dbaas/postgres/v1alpha1/database_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ type DatabaseStatus struct {
AtProvider DatabaseObservation `json:"atProvider,omitempty"`
}

// DatabaseObservation are the observable fields of a Cluster.
// DatabaseObservation are the observable fields of a Database.
type DatabaseObservation struct {
DatabaseID string `json:"DatabaseId,omitempty"`
}

// A PostgresDatabaseSpec defines the desired state of a Cluster.
// A PostgresDatabaseSpec defines the desired state of a Database.
type PostgresDatabaseSpec struct {
xpv1.ResourceSpec `json:",inline"`
ForProvider PostgresDatabaseParameters `json:"forProvider"`
Expand Down
23 changes: 0 additions & 23 deletions internal/controller/dbaas/postgresdatabase/postgresdatabase.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ func (u *externalDatabase) Observe(ctx context.Context, mg resource.Managed) (ma
}
return managed.ExternalObservation{}, fmt.Errorf("failed to get postgres database by name %s : %w", meta.GetExternalName(cr), err)
}
// lateInitialized := u.lateInitialize(ctx, cr)
cr.Status.AtProvider.DatabaseID = meta.GetExternalName(cr)
cr.SetConditions(xpv1.Available())
return managed.ExternalObservation{
Expand Down Expand Up @@ -182,25 +181,3 @@ func (u *externalDatabase) Delete(ctx context.Context, mg resource.Managed) erro
}
return nil
}

//
// // If credentials are supplied through credentials Source, set the hashed password to the Spec
// func (u *externalDatabase) lateInitialize(ctx context.Context, cr *v1alpha1.PostgresDatabase) bool {
// if cr.Spec.ForProvider.Credentials.Source == "" || cr.Spec.ForProvider.Credentials.Source == xpv1.CredentialsSourceNone {
// return false
// }
// creds, err := u.readCredentials(ctx, cr)
// if err != nil {
// return false
// }
// var hash []byte
// if hash, err = bcrypt.GenerateFromPassword([]byte(creds.Password), bcrypt.MinCost); err != nil {
// return false
// }
// if err = bcrypt.CompareHashAndPassword([]byte(cr.Spec.ForProvider.Credentials.Password), []byte(creds.Password)); err == nil {
// return false
// }
// hashStr := string(hash)
// cr.Spec.ForProvider.Credentials.Password = hashStr
// return true
// }

0 comments on commit 13e12e7

Please sign in to comment.