Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
kerenlahav committed Aug 6, 2024
1 parent f6ad6c5 commit 687fed7
Show file tree
Hide file tree
Showing 5 changed files with 1,112 additions and 24 deletions.
5 changes: 0 additions & 5 deletions api/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,3 @@ type SecretKeyReference struct {
// The key of the secret to select from. Must be a valid secret key.
Key string `json:"key"`
}

type ResourceKey struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
}
15 changes: 0 additions & 15 deletions api/v1/zz_generated.deepcopy.go

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

2 changes: 1 addition & 1 deletion config/samples/services_v1_serviceinstance.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: services.cloud.sap.com/v1
kind: ServiceInstance
metadata:
name: sample-instance-2
name: sample-instance-1
spec:
serviceOfferingName: service-manager
servicePlanName: subaccount-audit
6 changes: 3 additions & 3 deletions controllers/serviceinstance_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (r *ServiceInstanceReconciler) Reconcile(ctx context.Context, req ctrl.Requ
log.Info(fmt.Sprintf("instance is not in final state, handling... (generation: %d, observedGen: %d", serviceInstance.Generation, serviceInstance.Status.ObservedGeneration))
serviceInstance.SetObservedGeneration(serviceInstance.Generation)

smClient, err := r.GetSMClient(ctx, r.Client, serviceInstance)
smClient, err := r.GetSMClient(ctx, serviceInstance)
if err != nil {
log.Error(err, "failed to get sm client")
return utils.MarkAsTransientError(ctx, r.Client, common.Unknown, err, serviceInstance)
Expand Down Expand Up @@ -266,7 +266,7 @@ func (r *ServiceInstanceReconciler) deleteInstance(ctx context.Context, serviceI
log := utils.GetLogger(ctx)

if controllerutil.ContainsFinalizer(serviceInstance, common.FinalizerName) {
smClient, err := r.GetSMClient(ctx, r.Client, serviceInstance)
smClient, err := r.GetSMClient(ctx, serviceInstance)
if err != nil {
log.Error(err, "failed to get sm client")
return utils.MarkAsTransientError(ctx, r.Client, common.Unknown, err, serviceInstance)
Expand Down Expand Up @@ -348,7 +348,7 @@ func (r *ServiceInstanceReconciler) handleInstanceSharing(ctx context.Context, s
func (r *ServiceInstanceReconciler) poll(ctx context.Context, serviceInstance *v1.ServiceInstance) (ctrl.Result, error) {
log := utils.GetLogger(ctx)
log.Info(fmt.Sprintf("resource is in progress, found operation url %s", serviceInstance.Status.OperationURL))
smClient, err := r.GetSMClient(ctx, r.Client, serviceInstance)
smClient, err := r.GetSMClient(ctx, serviceInstance)
if err != nil {
log.Error(err, "failed to get sm client")
return utils.MarkAsTransientError(ctx, r.Client, common.Unknown, err, serviceInstance)
Expand Down
Loading

0 comments on commit 687fed7

Please sign in to comment.