Skip to content

Commit

Permalink
fix http resp code 400 in the start of creating, isUpToDate fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirill Sushkov (teeverr) committed Oct 5, 2023
1 parent 726b81d commit cbc7f95
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/controller/servicecatalog/provisionedproduct/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package provisionedproduct
import (
"context"
"fmt"
"reflect"
"strings"

awsconfig "github.com/aws/aws-sdk-go-v2/config"
Expand Down Expand Up @@ -108,8 +107,8 @@ func prepareSetupExternal(cfClient *cfsdkv2.Client, kube client.Client) func(*ex
c := &custom{client: &clientset.CustomServiceCatalogClient{CfClient: cfClient, Client: e.client}, kube: kube}
e.preCreate = preCreate
e.preUpdate = c.preUpdate
e.isUpToDate = c.isUpToDate
e.lateInitialize = c.lateInitialize
e.isUpToDate = c.isUpToDate
e.preObserve = c.preObserve
e.postObserve = c.postObserve
e.preDelete = preDelete
Expand Down Expand Up @@ -156,8 +155,7 @@ func (c *custom) isUpToDate(ctx context.Context, ds *svcapitypes.ProvisionedProd
// to be queued for an update (which will be skipped due to UNDER_CHANGE), and once that update fails, we will
// recheck the status again. This will allow us to quickly transition from UNDER_CHANGE to AVAILABLE without having
// to wait for the entire polling interval to pass before re-checking the status.
if pointer.StringDeref(ds.Status.AtProvider.Status, "") == string(svcapitypes.ProvisionedProductStatus_SDK_UNDER_CHANGE) ||
reflect.ValueOf(ds.Status.AtProvider).IsZero() {
if pointer.StringDeref(resp.ProvisionedProductDetail.Status, "") == string(svcapitypes.ProvisionedProductStatus_SDK_UNDER_CHANGE) {
return true, "", nil
}

Expand Down Expand Up @@ -294,7 +292,9 @@ func (c *custom) provisioningParamsAreChanged(ctx context.Context, cfStackParams

cfStackKeyValue := make(map[string]string)
for _, v := range cfStackParams {
cfStackKeyValue[*v.ParameterKey] = pointer.StringDeref(v.ParameterValue, "")
if v.ParameterKey != nil {
cfStackKeyValue[*v.ParameterKey] = pointer.StringDeref(v.ParameterValue, "")
}
}

for _, v := range ds.Spec.ForProvider.ProvisioningParameters {
Expand Down Expand Up @@ -353,7 +353,7 @@ func (c *custom) getArtifactID(ds *svcapitypes.ProvisionedProductParameters) (st
for _, artifact := range output.ProvisioningArtifacts {
if pointer.StringDeref(ds.ProvisioningArtifactName, "") == *artifact.Name ||
pointer.StringDeref(ds.ProvisioningArtifactID, "") == *artifact.Id {
return pointer.StringDeref(artifact.Id, ""), nil
return *artifact.Id, nil
}
}
return "", errors.Wrap(errors.New("artifact not found"), errCouldNotLookupProduct)
Expand Down

0 comments on commit cbc7f95

Please sign in to comment.