Skip to content

Commit

Permalink
Fix code
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Saratura committed Mar 25, 2024
1 parent ef44644 commit 69f1fea
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 31 deletions.
13 changes: 6 additions & 7 deletions controllers/database_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,8 @@ func (r *DatabaseReconciler) deleteDatabase(dr *DatabaseReconciliation, instance
r.Log.V(1).Info("setup Stardog Client from ", "ref", instance)
auth, disabled, err := dr.reconciliationContext.initStardogClientFromRef(r.Client, instance)
if err != nil || disabled {
if err != nil {
return fmt.Errorf("cannot initialize stardog client: %v", err)
}
r.Log.Info("skipping resource from reconciliation", "instance", instance.Name, "resource", srr.resource.Name)

Check failure on line 195 in controllers/database_controller.go

View workflow job for this annotation

GitHub Actions / dist

undefined: srr

Check failure on line 195 in controllers/database_controller.go

View workflow job for this annotation

GitHub Actions / test

undefined: srr
return nil
r.Log.Info("skipping resource from reconciliation", "instance", instance.Name, "resource", dr.resource.Name)
return nil
}
Expand Down Expand Up @@ -338,10 +337,10 @@ func (r *DatabaseReconciler) sync(dr *DatabaseReconciliation, instance stardogv1
customUserEnabled := customUser != ""

auth, disabled, err := rc.initStardogClientFromRef(r.Client, instance)
if err != nil || disabled {
if err != nil {
return fmt.Errorf("cannot initialize stardog client: %v", err)
}
if err != nil {
return fmt.Errorf("cannot initialize stardog client: %v", err)
}
if disabled {
r.Log.Info("skipping resource from reconciliation", "instance", instance.Name, "resource", dr.resource.Name)
return nil
}
Expand Down
17 changes: 9 additions & 8 deletions controllers/organization_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,10 @@ func (r *OrganizationReconciler) sync(or *OrganizationReconciliation, instance s
stardogClient := or.reconciliationContext.stardogClient

auth, disabled, err := rc.initStardogClientFromRef(r.Client, instance)
if err != nil || disabled {
if err != nil {
return fmt.Errorf("cannot initialize stardog client: %v", err)
}
if err != nil {
return fmt.Errorf("cannot initialize stardog client: %v", err)
}
if disabled {
r.Log.Info("skipping resource from reconciliation", "instance", instance.Name, "resource", or.resource.Name)
return nil
}
Expand Down Expand Up @@ -423,10 +423,11 @@ func (r *OrganizationReconciler) deleteOrganization(or *OrganizationReconciliati

r.Log.V(1).Info("setup Stardog Client from ", "ref", instance)
auth, disabled, err := or.reconciliationContext.initStardogClientFromRef(r.Client, instance)
if err != nil || disabled {
if err != nil {
return fmt.Errorf("cannot initialize stardog client: %v", err)
}
if err != nil {
return fmt.Errorf("cannot initialize stardog client: %v", err)

}
if disabled {
r.Log.Info("skipping resource from reconciliation", "instance", instance.Name, "resource", or.resource.Name)
return nil
}
Expand Down
16 changes: 8 additions & 8 deletions controllers/stardogrole_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ func (r *StardogRoleReconciler) syncRole(srr *StardogRoleReconciliation) error {

r.Log.V(1).Info("init Stardog Client from ", "ref", spec.StardogInstanceRef)
auth, disabled, err := srr.reconciliationContext.initStardogClientFromRef(r.Client, instance)
if err != nil || disabled {
if err != nil {
return fmt.Errorf("cannot initialize stardog client: %v", err)
}
if err != nil {
return fmt.Errorf("cannot initialize stardog client: %v", err)
}
if disabled {
r.Log.Info("skipping resource from reconciliation", "instance", instance.Name, "resource", srr.resource.Name)
return nil
}
Expand Down Expand Up @@ -258,10 +258,10 @@ func (r *StardogRoleReconciler) finalize(srr *StardogRoleReconciliation) error {
instance := v1beta1.NewStardogInstanceRef(spec.StardogInstanceRef, namespace)
r.Log.V(1).Info("setup Stardog Client from ", "ref", spec.StardogInstanceRef)
auth, disabled, err := srr.reconciliationContext.initStardogClientFromRef(r.Client, instance)
if err != nil || disabled {
if err != nil {
return fmt.Errorf("cannot initialize stardog client: %v", err)
}
if err != nil {
return fmt.Errorf("cannot initialize stardog client: %v", err)
}
if disabled {
r.Log.Info("skipping resource from reconciliation", "instance", instance.Name, "resource", srr.resource.Name)
return nil
}
Expand Down
16 changes: 8 additions & 8 deletions controllers/stardoguser_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ func (r *StardogUserReconciler) finalize(sur *StardogUserReconciliation) error {

r.Log.V(1).Info("setup Stardog Client from ", "ref", spec.StardogInstanceRef)
auth, disabled, err := rc.initStardogClientFromRef(r.Client, instance)
if err != nil || disabled {
if err != nil {
return fmt.Errorf("cannot initialize stardog client: %v", err)
}
if err != nil {
return fmt.Errorf("cannot initialize stardog client: %v", err)
}
if disabled {
r.Log.Info("skipping resource from reconciliation", "instance", instance.Name, "resource", sur.resource.Name)
return nil
}
Expand Down Expand Up @@ -176,10 +176,10 @@ func (r *StardogUserReconciler) syncUser(sur *StardogUserReconciliation) error {

r.Log.V(1).Info("init Stardog Client from ", "ref", spec.StardogInstanceRef)
auth, disabled, err := rc.initStardogClientFromRef(r.Client, instance)
if err != nil || disabled {
if err != nil {
return fmt.Errorf("cannot initialize stardog client: %v", err)
}
if err != nil {
return fmt.Errorf("cannot initialize stardog client: %v", err)
}
if disabled {
r.Log.Info("skipping resource from reconciliation", "instance", instance.Name, "resource", sur.resource.Name)
return nil
}
Expand Down

0 comments on commit 69f1fea

Please sign in to comment.