Skip to content

Commit

Permalink
fix: [CDS-101073]: Terraform provider should recreate repo cred if de…
Browse files Browse the repository at this point in the history
…leted but exists in terraform state (#573)

Signed-off-by: Mirko Teodorovic <[email protected]>
  • Loading branch information
mteodor authored Sep 17, 2024
1 parent ec197bf commit 6de99ed
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions harness/nextgen/api_repository_credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,18 @@ func (a *RepositoryCredentialsApiService) AgentRepositoryCredentialsServiceGetCr
body: localVarBody,
error: localVarHttpResponse.Status,
}

if localVarHttpResponse.StatusCode >= 400 {
var v GatewayruntimeError
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}

if localVarHttpResponse.StatusCode == 200 {
var v Servicev1RepositoryCredentials
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
Expand Down Expand Up @@ -571,6 +583,18 @@ func (a *RepositoryCredentialsApiService) AgentRepositoryCredentialsServiceGetRe
body: localVarBody,
error: localVarHttpResponse.Status,
}

if localVarHttpResponse.StatusCode >= 400 {
var v GatewayruntimeError
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHttpResponse, newErr
}
newErr.model = v
return localVarReturnValue, localVarHttpResponse, newErr
}

if localVarHttpResponse.StatusCode == 200 {
var v Servicev1RepositoryCredentials
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
Expand Down Expand Up @@ -600,8 +624,9 @@ func (a *RepositoryCredentialsApiService) AgentRepositoryCredentialsServiceGetRe
/*
RepositoryCredentialsApiService List repository credentials
List repository credentials.
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param body
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param body
@return Servicev1RepositoryCredentialsList
*/
func (a *RepositoryCredentialsApiService) AgentRepositoryCredentialsServiceListRepositoryCredentials(ctx context.Context, body V1RepositoryCredentialsQuery) (Servicev1RepositoryCredentialsList, *http.Response, error) {
Expand Down

0 comments on commit 6de99ed

Please sign in to comment.