Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to define TeamRoutingRule with timeRestrictions #51

Closed
fronti90 opened this issue May 18, 2022 · 1 comment · Fixed by #53
Closed

Unable to define TeamRoutingRule with timeRestrictions #51

fronti90 opened this issue May 18, 2022 · 1 comment · Fixed by #53
Assignees
Labels
kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed

Comments

@fronti90
Copy link

What happened?

I am trying to define a TeamRoutingRule with timeRestrictions, but there seems to be an issue with TeamRoutingRule.TimeRestrictions[0].Restriction[0].EndDay and TeamRoutingRule.TimeRestrictions[0].Restriction[0].StartDay.

Steps to reproduce

const testTeamRoutingRule = new opsgenie.TeamRoutingRule('Test routing rule', {
	criterias: [
		{
			conditions: [
				{
					expectedValue: 'test',
					field: 'source',
					not: false,
					operation: 'contains',
				},
			],
			type: 'match-all-conditions',
		},
	],
	notifies: [
		{
			name: scheduleName,
			type: 'schedule',
		},
	],
	order: 0,
	teamId: teamId,
	timeRestrictions: [
		{
			restrictions: [
				{
					endDay: 'monday',
					endHour: 18,
					endMin: 30,
					startDay: 'monday',
					startHour: 8,
					startMin: 0,
				},
			],
			type: 'weekday-and-time-of-day',
		},
	],
})
$ pulumi preview                                                                                                        
Previewing update (opsgenie.test):
     Type                               Name                        Plan     Info
     pulumi:pulumi:Stack               opsgenie.test          6 messages
     └─ opsgenie:index:TeamRoutingRule  Test routing rule           2 errors

Diagnostics:
  opsgenie:index:TeamRoutingRule (Test routing rule):
    error: opsgenie:index/teamRoutingRule:TeamRoutingRule resource 'Test routing rule' has a problem: Invalid or unknown key. Examine values at 'TeamRoutingRule.TimeRestrictions[0].Restriction[0].EndDay'.
    error: opsgenie:index/teamRoutingRule:TeamRoutingRule resource 'Test routing rule' has a problem: Invalid or unknown key. Examine values at 'TeamRoutingRule.TimeRestrictions[0].Restriction[0].StartDay'.

Expected Behavior

Routing Rule is created successfully with a time restriction set.

Actual Behavior

Routing Rule isn't created at all (see Steps to reproduce)

Versions used

CLI
Version 3.28.0
Go Version go1.18.1
Go Compiler gc

Plugins
NAME VERSION
nodejs unknown
opsgenie 1.1.5

Additional context

When not using timeRestrictions the routing rule is created successfully, so all other parameters seem to be fine.
Seems to be a similar issue as in #17

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@fronti90 fronti90 added the kind/bug Some behavior is incorrect or out of spec label May 18, 2022
@guineveresaenger
Copy link
Contributor

Hi @fronti90 - thank you so much for filing.

I believe this is a bug caused by multiple restriction(s) blocks in the Terraform provider - an upstream issue outlines some of this.

I'll need to verify, but I do believe you are correct that this is a repeat of #17, just on a different resource, where the auto-generated plural version assumes to have the same fields as the singular, which is not the case here.

Hoping that will fix it! 🤞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants