terraform-provider-azurerm icon indicating copy to clipboard operation
terraform-provider-azurerm copied to clipboard

New Resource: `azurerm_container_app_job`

Open jiaweitao001 opened this issue 1 year ago • 21 comments

  • All tests passed.
--- PASS: TestAccContainerAppJob_manualTrigger (751.94s)
--- PASS: TestAccContainerAppJob_basic (753.25s)
--- PASS: TestAccContainerAppJob_eventTrigger (755.72s)
--- PASS: TestAccContainerAppJob_scheduleTrigger (808.98s)

jiaweitao001 avatar Nov 12 '23 02:11 jiaweitao001

Hello @jiaweitao001 Great contribution! I am looking forward for this feature. But I am also curious why new resource is needed. I see in #23165 that maybe only additional parameters are needed. What do you think?

CaishenNefri avatar Dec 03 '23 09:12 CaishenNefri

Hello @jiaweitao001 Great contribution! I am looking forward for this feature. But I am also curious why new resource is needed. I see in #23165 that maybe only additional parameters are needed. What do you think?

Hi @CaishenNefri , container_app_job has a separate API than other azure container app resources, that's why we have to create a separate resource for it. We don't usually mix them together in azurerm.

jiaweitao001 avatar Dec 03 '23 10:12 jiaweitao001

@jiaweitao001 thank you for working on this. Do you have an estimate on when you have time to look at the comments by @ms-zhenhua?

eddy-vera avatar Dec 07 '23 10:12 eddy-vera

Hi @jiaweitao001 - I noticed this PR is still marked as a draft, I just wanted to check if this is ready for a re-review? Thanks!

catriona-m avatar Jan 03 '24 14:01 catriona-m

Hi @jiaweitao001 - I noticed this PR is still marked as a draft, I just wanted to check if this is ready for a re-review? Thanks!

Hi @catriona-m, I've updated this PR as discussed offline with Zhenhua. Now it's reusing models already existed for container app resource.

jiaweitao001 avatar Jan 08 '24 08:01 jiaweitao001

Looks good! Eager to start using this resource alongside our extensive container app environment.

Malagari avatar Jan 18 '24 22:01 Malagari

+1

syepes avatar Jan 23 '24 08:01 syepes

Any ETA for this? Eagerly awaiting this as well.

gercograndia avatar Jan 23 '24 14:01 gercograndia

@ms-zhenhua can this be merged or if it needs more reviewers can you tag them please? We'd really like to get this running in our environment.

albal avatar Jan 24 '24 15:01 albal

Same, highly anticipating on this new resource, we are using the az api for now, but using the native azurerm resource would be much better.

eddy-vera avatar Jan 25 '24 13:01 eddy-vera

Highly needed for my use case as well. Checks are green, would be very good to have another check from @katbyte @tombuildsstuff @ms-zhenhua

loadaverage avatar Jan 30 '24 00:01 loadaverage

Waiting for this update...

pavel-krasnousov-LX avatar Jan 31 '24 13:01 pavel-krasnousov-LX

I was forced to build a provider from that branch and use it in Terraform Cloud as private provider. As I don't want to mix bicep with azurerm and unfortunately can't wait so long. Thank your for contribution!

loadaverage avatar Feb 07 '24 00:02 loadaverage

Thank you!

This resource is useful for example to manage Azure DevOps or GitHub self hosted agents, like in https://learn.microsoft.com/en-us/azure/container-apps/tutorial-ci-cd-runners-jobs

It would be great if a maintainer could give some feedback. @stephybun maybe?

Miouge1 avatar Feb 07 '24 07:02 Miouge1

Welcome to the reality of the hashicorp community contributions, now you can better understand one of the main motivations of the OpenTofu fork

syepes avatar Feb 07 '24 09:02 syepes

Welcome to the reality of the hashicorp community contributions, now you can better understand one of the main motivations of the OpenTofu fork

True but opentofu is not gonna solve this.

gercograndia avatar Feb 07 '24 10:02 gercograndia

Hey @jiaweitao001, I'm seeing issues when building this out

# github.com/hashicorp/go-azure-sdk/resource-manager/containerapps/2023-05-01/jobs
../../../vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerapps/2023-05-01/jobs/id_execution.go:13:32: cannot use ExecutionId{} (value of type ExecutionId) as resourceids.ResourceId value in variable declaration: ExecutionId does not implement resourceids.ResourceId (method FromParseResult has pointer receiver)
../../../vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerapps/2023-05-01/jobs/id_execution.go:35:52: cannot use ExecutionId{} (value of type ExecutionId) as resourceids.ResourceId value in argument to resourceids.NewParserFromResourceIdType: ExecutionId does not implement resourceids.ResourceId (method FromParseResult has pointer receiver)
../../../vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerapps/2023-05-01/jobs/id_execution.go:52:52: cannot use ExecutionId{} (value of type ExecutionId) as resourceids.ResourceId value in argument to resourceids.NewParserFromResourceIdType: ExecutionId does not implement resourceids.ResourceId (method FromParseResult has pointer receiver)
../../../vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerapps/2023-05-01/jobs/id_job.go:13:32: cannot use JobId{} (value of type JobId) as resourceids.ResourceId value in variable declaration: JobId does not implement resourceids.ResourceId (method FromParseResult has pointer receiver)
../../../vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerapps/2023-05-01/jobs/id_job.go:33:52: cannot use JobId{} (value of type JobId) as resourceids.ResourceId value in argument to resourceids.NewParserFromResourceIdType: JobId does not implement resourceids.ResourceId (method FromParseResult has pointer receiver)
../../../vendor/github.com/hashicorp/go-azure-sdk/resource-manager/containerapps/2023-05-01/jobs/id_job.go:50:52: cannot use JobId{} (value of type JobId) as resourceids.ResourceId value in argument to resourceids.NewParserFromResourceIdType: JobId does not implement resourceids.ResourceId (method FromParseResult has pointer receiver)
Process exited with code 1

could you chase that down before we continue with the review?

@mbfrahry , this is caused by a dependency upgrade happened recently. I'll update the code accordingly.

jiaweitao001 avatar Feb 13 '24 01:02 jiaweitao001

The tests are failing because the image couldn't be parsed. Could you take a look at fixing the tests up?

        Error: creating Job
        Resource Group Name: "acctest-CAJob240213103743537379"
        Job Name: "acctest-cajob240213103743537379"): performing CreateOrUpdate: jobs.JobsClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: Code="InvalidParameterValueInContainerTemplate" Message="The following field(s) are either invalid or missing. Field 'template.containers.testcontainerappsjob0.image' is invalid with details: 'Invalid value: \"repo/testcontainerAppsJob0:v1\": could not parse reference: repo/testcontainerAppsJob0:v1';."

@mbfrahry Updated.

jiaweitao001 avatar Feb 14 '24 09:02 jiaweitao001

Any news on this?

syepes avatar Feb 23 '24 22:02 syepes

Any news on this?

Lets wait until next changes in API or core, when author need to update code again because of the failed tests Ask author to update the code. Keep silence for a few weeks. Repeat

pavel-krasnousov-LX avatar Feb 26 '24 09:02 pavel-krasnousov-LX

@mbfrahry, is this fixed now and can it be merged?

guibranco avatar Feb 27 '24 11:02 guibranco

Guys, please merge. Would be awesome.

FakieHeelflip avatar Mar 05 '24 14:03 FakieHeelflip

Please can we get eyes on this. This is the most commented open PR in this repo - a lot of people would like this addition.

albal avatar Mar 05 '24 16:03 albal

Hey Folks

Unfortunately we're busy with other priorities at the moment, but @jackofallops will take a look as soon as he can.

Whilst we appreciate the enthusiasm around this PR, we'd ask that you refrain from posting when will this be merged or similar comments, since these actually delays us reviewing this due to phantom notifications - but we'll take a look as soon as we can.

Thanks!

tombuildsstuff avatar Mar 05 '24 16:03 tombuildsstuff

Hi @jackofallops , I've addressed the comments as requested.

jiaweitao001 avatar Apr 02 '24 05:04 jiaweitao001

Tests look good:

image

jackofallops avatar May 07 '24 05:05 jackofallops

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

github-actions[bot] avatar Jun 10 '24 02:06 github-actions[bot]