-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
153 changed files
with
2,906 additions
and
1,110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: "Create and promote release" | ||
run-name: Create and promote release ${{ inputs.name }} | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
name: | ||
description: 'Create release' | ||
default: "" | ||
required: true | ||
|
||
jobs: | ||
create-release: | ||
name: Create release | ||
uses: "./.github/workflows/create-release.yaml" | ||
with: | ||
name: ${{ inputs.name }} | ||
skip-sec-file-and-chart-bump: false | ||
dry-run: false | ||
secrets: inherit | ||
|
||
promote: | ||
name: Promote | ||
needs: create-release | ||
uses: "./.github/workflows/promote-keb-to-dev.yaml" | ||
with: | ||
releaseTag: ${{ inputs.name }} | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,6 +111,32 @@ func TestBinding(t *testing.T) { | |
assert.Equal(t, http.StatusOK, resp.StatusCode) | ||
}) | ||
|
||
t.Run("should return 200 when creating a second binding with the same id and params as an existing one", func(t *testing.T) { | ||
bid = uuid.New().String() | ||
resp = suite.CallAPI(http.MethodPut, fmt.Sprintf("oauth/v2/service_instances/%s/service_bindings/%s", iid, bid), | ||
`{ | ||
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281", | ||
"plan_id": "361c511f-f939-4621-b228-d0fb79a1fe15", | ||
"parameters": { | ||
"expiration_seconds": 600 | ||
} | ||
}`) | ||
|
||
time.Sleep(2 * time.Second) | ||
|
||
resp = suite.CallAPI(http.MethodPut, fmt.Sprintf("oauth/v2/service_instances/%s/service_bindings/%s", iid, bid), | ||
`{ | ||
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281", | ||
"plan_id": "361c511f-f939-4621-b228-d0fb79a1fe15", | ||
"parameters": { | ||
"expiration_seconds": 600 | ||
} | ||
}`) | ||
assert.Equal(t, http.StatusOK, resp.StatusCode) | ||
r, _ := io.ReadAll(resp.Body) | ||
fmt.Printf("%s", r) | ||
}) | ||
|
||
t.Run("should return 409 when creating a second binding with the same id as an existing one but different params", func(t *testing.T) { | ||
bid = uuid.New().String() | ||
resp = suite.CallAPI(http.MethodPut, fmt.Sprintf("oauth/v2/service_instances/%s/service_bindings/%s", iid, bid), | ||
|
@@ -197,6 +223,81 @@ func TestDeprovisioningWithExistingBindings(t *testing.T) { | |
suite.AssertBindingRemoval(iid, bindingID2) | ||
} | ||
|
||
func TestFailedProvisioning(t *testing.T) { | ||
// given | ||
cfg := fixConfig() | ||
// Disable EDP to have all steps successfully executed | ||
cfg.EDP.Disabled = true | ||
suite := NewBrokerSuiteTestWithConfig(t, cfg) | ||
defer suite.TearDown() | ||
iid := uuid.New().String() | ||
bindingID1 := uuid.New().String() | ||
|
||
response := suite.CallAPI(http.MethodPut, fmt.Sprintf("oauth/v2/service_instances/%s?accepts_incomplete=true", iid), | ||
`{ | ||
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281", | ||
"plan_id": "361c511f-f939-4621-b228-d0fb79a1fe15", | ||
"context": { | ||
"globalaccount_id": "g-account-id", | ||
"subaccount_id": "sub-id", | ||
"user_id": "[email protected]" | ||
}, | ||
"parameters": { | ||
"name": "testing-cluster", | ||
"region": "eu-central-1" | ||
} | ||
}`) | ||
opID := suite.DecodeOperationID(response) | ||
suite.failProvisioningByOperationID(opID) | ||
|
||
// when we create binding | ||
response = suite.CallAPI(http.MethodPut, fmt.Sprintf("oauth/v2/service_instances/%s/service_bindings/%s", iid, bindingID1), | ||
`{ | ||
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281", | ||
"plan_id": "361c511f-f939-4621-b228-d0fb79a1fe15" | ||
}`) | ||
|
||
// then expect 400 as agreed in the contract | ||
require.Equal(t, http.StatusBadRequest, response.StatusCode) | ||
} | ||
|
||
func TestProvisioningInProgress(t *testing.T) { | ||
// given | ||
cfg := fixConfig() | ||
// Disable EDP to have all steps successfully executed | ||
cfg.EDP.Disabled = true | ||
suite := NewBrokerSuiteTestWithConfig(t, cfg) | ||
defer suite.TearDown() | ||
iid := uuid.New().String() | ||
bindingID1 := uuid.New().String() | ||
|
||
response := suite.CallAPI(http.MethodPut, fmt.Sprintf("oauth/v2/service_instances/%s?accepts_incomplete=true", iid), | ||
`{ | ||
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281", | ||
"plan_id": "361c511f-f939-4621-b228-d0fb79a1fe15", | ||
"context": { | ||
"globalaccount_id": "g-account-id", | ||
"subaccount_id": "sub-id", | ||
"user_id": "[email protected]" | ||
}, | ||
"parameters": { | ||
"name": "testing-cluster", | ||
"region": "eu-central-1" | ||
} | ||
}`) | ||
opID := suite.DecodeOperationID(response) | ||
suite.WaitForProvisioningState(opID, domain.InProgress) | ||
// when we create binding | ||
response = suite.CallAPI(http.MethodPut, fmt.Sprintf("oauth/v2/service_instances/%s/service_bindings/%s", iid, bindingID1), | ||
`{ | ||
"service_id": "47c9dcbf-ff30-448e-ab36-d3bad66ba281", | ||
"plan_id": "361c511f-f939-4621-b228-d0fb79a1fe15" | ||
}`) | ||
|
||
// then expect 400 as agreed in the contract | ||
require.Equal(t, http.StatusBadRequest, response.StatusCode) | ||
} | ||
|
||
func TestRemoveBindingsFromSuspended(t *testing.T) { | ||
// given | ||
cfg := fixConfig() | ||
|
Oops, something went wrong.