Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: addgroup_sync androle_sync forcoderd_organization_resource#147

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
aslilac merged 28 commits intomainfromlilac/idp-sync
Dec 3, 2024

Conversation

aslilac
Copy link
Member

@aslilacaslilac commentedNov 25, 2024
edited
Loading

Group and role sync settings can now be configured as such:

resource"coderd_organization""example" {group_sync {field="wibble"regex_filter="wib{2,}le"auto_create_missing=truemapping={wibble= ["6e57187f-6543-46ab-a62c-a10065dd4314"]}}role_sync {field="wobble"mapping={wobble= ["wobbly"]}}}

return
}

// data.GroupSync = ???

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I don't recall if you can write to a config block (blocks can't be computed) like this. I suspect you can't.

If you can, I assume it would just be to error if the post-apply plan isn't empty.
For that you'd need to usetypes.ObjectValueFrom and provide it the type of the object using amap[string]attr.Type. I've got an example on the template resource & data source.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I think I figured something out that works 😄

@aslilacaslilac marked this pull request as ready for reviewDecember 3, 2024 00:15
Copy link
Member

@ethanndicksonethanndickson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

few comments but otherwise nice, lgtm!

Copy link
Member

@ethanndicksonethanndicksonDec 3, 2024
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I just realised we're missing enterprise/premium entitlement checks on this and the provisioner key resource. We have them on the workspace proxy and the enterprise features of template resources, but they run duringapply, when they should really run duringplan. Let's not worry about it for now, and at some point I'll see if I can get them working at plan-time using a plan modifier (validators don't have the provider config we need).

If that doesn't work we can just copy the ones at apply-time to these two new resources.

aslilac reacted with thumbs up emoji
stringvalidator.LengthAtLeast(1),
},
},
"auto_create_missing": schema.BoolAttribute{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This defaults tofalse on coder right? Should just have adefault set in the schema, and then you can remove the null checks on it.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

would that preventgroup_sync from beingnull tho?

Copy link
Member

@ethanndicksonethanndicksonDec 4, 2024
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Nope, the default only gets computed if the parent is known, so:

    group_sync {}

would default any values within it, but omitting the block altogether would not.

If you wanted to default the block to known, and the bool to false, then you'd also add aDefault to the block itself.

@aslilacaslilac merged commit283e3cc intomainDec 3, 2024
13 checks passed
@aslilacaslilac deleted the lilac/idp-sync branchDecember 3, 2024 19:16
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ethanndicksonethanndicksonethanndickson approved these changes

@f0sself0sselAwaiting requested review from f0ssel

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@aslilac@ethanndickson

[8]ページ先頭

©2009-2025 Movatter.jp