fix: pipeline fixes
[skip ci]
This commit is contained in:
parent
8c490da5ce
commit
0ba4612438
4 changed files with 11 additions and 8 deletions
4
.github/actions/acc_test/action.yaml
vendored
4
.github/actions/acc_test/action.yaml
vendored
|
|
@ -192,7 +192,7 @@ runs:
|
||||||
TF_ACC_KEK_SERVICE_ACCOUNT=${TF_ACC_KEK_SERVICE_ACCOUNT} \
|
TF_ACC_KEK_SERVICE_ACCOUNT=${TF_ACC_KEK_SERVICE_ACCOUNT} \
|
||||||
go test ${{ inputs.test_file }} -count=1 -timeout=30m
|
go test ${{ inputs.test_file }} -count=1 -timeout=30m
|
||||||
env:
|
env:
|
||||||
TF_PROJECT_ID: ${{ inputs.project_id }}
|
TF_ACC_PROJECT_ID: ${{ inputs.project_id }}
|
||||||
TF_ACC_REGION: ${{ inputs.region }}
|
TF_ACC_REGION: ${{ inputs.region }}
|
||||||
TF_ACC_TEST_PROJECT_USER_EMAIL: ${{ inputs.project_user_email }}
|
TF_ACC_TEST_PROJECT_USER_EMAIL: ${{ inputs.project_user_email }}
|
||||||
TF_ACC_KEK_KEY_ID: ${{ inputs.tf_acc_kek_key_id }}
|
TF_ACC_KEK_KEY_ID: ${{ inputs.tf_acc_kek_key_id }}
|
||||||
|
|
@ -220,7 +220,7 @@ runs:
|
||||||
TF_ACC_KEK_SERVICE_ACCOUNT=${TF_ACC_KEK_SERVICE_ACCOUNT} \
|
TF_ACC_KEK_SERVICE_ACCOUNT=${TF_ACC_KEK_SERVICE_ACCOUNT} \
|
||||||
go test ./... -count=1 -timeout=30m
|
go test ./... -count=1 -timeout=30m
|
||||||
env:
|
env:
|
||||||
TF_PROJECT_ID: ${{ inputs.project_id }}
|
TF_ACC_PROJECT_ID: ${{ inputs.project_id }}
|
||||||
TF_ACC_REGION: ${{ inputs.region }}
|
TF_ACC_REGION: ${{ inputs.region }}
|
||||||
TF_ACC_TEST_PROJECT_USER_EMAIL: ${{ inputs.project_user_email }}
|
TF_ACC_TEST_PROJECT_USER_EMAIL: ${{ inputs.project_user_email }}
|
||||||
TF_ACC_KEK_KEY_ID: ${{ inputs.tf_acc_kek_key_id }}
|
TF_ACC_KEK_KEY_ID: ${{ inputs.tf_acc_kek_key_id }}
|
||||||
|
|
|
||||||
2
.github/workflows/tf-acc-test.yaml
vendored
2
.github/workflows/tf-acc-test.yaml
vendored
|
|
@ -18,7 +18,7 @@ jobs:
|
||||||
uses: ./.github/actions/acc_test
|
uses: ./.github/actions/acc_test
|
||||||
with:
|
with:
|
||||||
go-version: ${{ env.GO_VERSION }}
|
go-version: ${{ env.GO_VERSION }}
|
||||||
project_id: ${{ vars.TEST_PROJECT_ID }}
|
project_id: ${{ vars.TF_ACC_PROJECT_ID }}
|
||||||
region: 'eu01'
|
region: 'eu01'
|
||||||
service_account_json_content_b64: "${{ secrets.TF_ACC_SERVICE_ACCOUNT_JSON_B64 }}"
|
service_account_json_content_b64: "${{ secrets.TF_ACC_SERVICE_ACCOUNT_JSON_B64 }}"
|
||||||
project_user_email: ${{ vars.TEST_PROJECT_USER_EMAIL }}
|
project_user_email: ${{ vars.TEST_PROJECT_USER_EMAIL }}
|
||||||
|
|
|
||||||
|
|
@ -196,9 +196,9 @@ func (r *instanceResource) Create(
|
||||||
|
|
||||||
ctx = core.InitProviderContext(ctx)
|
ctx = core.InitProviderContext(ctx)
|
||||||
|
|
||||||
projectId := model.ProjectId.ValueString()
|
projectID := model.ProjectId.ValueString()
|
||||||
region := model.Region.ValueString()
|
region := model.Region.ValueString()
|
||||||
ctx = tflog.SetField(ctx, "project_id", projectId)
|
ctx = tflog.SetField(ctx, "project_id", projectID)
|
||||||
ctx = tflog.SetField(ctx, "region", region)
|
ctx = tflog.SetField(ctx, "region", region)
|
||||||
|
|
||||||
var netAcl []string
|
var netAcl []string
|
||||||
|
|
@ -214,7 +214,7 @@ func (r *instanceResource) Create(
|
||||||
// Create new instance
|
// Create new instance
|
||||||
createResp, err := r.client.DefaultAPI.CreateInstanceRequest(
|
createResp, err := r.client.DefaultAPI.CreateInstanceRequest(
|
||||||
ctx,
|
ctx,
|
||||||
projectId,
|
projectID,
|
||||||
region,
|
region,
|
||||||
).CreateInstanceRequestPayload(payload).Execute()
|
).CreateInstanceRequestPayload(payload).Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -231,7 +231,7 @@ func (r *instanceResource) Create(
|
||||||
|
|
||||||
// Set data returned by API in identity
|
// Set data returned by API in identity
|
||||||
identity := InstanceResourceIdentityModel{
|
identity := InstanceResourceIdentityModel{
|
||||||
ProjectID: types.StringValue(projectId),
|
ProjectID: types.StringValue(projectID),
|
||||||
Region: types.StringValue(region),
|
Region: types.StringValue(region),
|
||||||
InstanceID: types.StringPointerValue(instanceID),
|
InstanceID: types.StringPointerValue(instanceID),
|
||||||
}
|
}
|
||||||
|
|
@ -240,7 +240,7 @@ func (r *instanceResource) Create(
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
waitResp, err := wait.CreateInstanceWaitHandler(ctx, r.client.DefaultAPI, projectId, region, *instanceID).
|
waitResp, err := wait.CreateInstanceWaitHandler(ctx, r.client.DefaultAPI, projectID, region, *instanceID).
|
||||||
WaitWithContext(ctx)
|
WaitWithContext(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
core.LogAndAddError(
|
core.LogAndAddError(
|
||||||
|
|
|
||||||
|
|
@ -297,6 +297,9 @@ func TestAccInstanceWithUsers(t *testing.T) {
|
||||||
data := getExample()
|
data := getExample()
|
||||||
|
|
||||||
userName := "testUser"
|
userName := "testUser"
|
||||||
|
if pID, ok := os.LookupEnv("TF_ACC_PROJECT_ID"); !ok || pID == "" {
|
||||||
|
t.Errorf("TF_ACC_PROJECT_ID is not set")
|
||||||
|
}
|
||||||
data.Users = []User{
|
data.Users = []User{
|
||||||
{
|
{
|
||||||
Name: userName,
|
Name: userName,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue