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

feat: add default_apps field to coder_agent resource #147

Merged
merged 10 commits into from
Aug 30, 2023
Merged

Conversation

sreya
Copy link
Collaborator

@sreya sreya commented Aug 14, 2023

  • Enables a template admin to configure which apps are displayed to the user in the dashboard.

fixes the provider side of coder/coder#8033

It takes the form

resource "coder_agent" "dev" {
	os = "linux"
	arch = "amd64"
	display_apps {
		vscode = false
		vscode_insiders = true
		web_terminal = false
		port_forwarding_helper = false
		ssh_helper = false
	} 
}
  • If you do not add a display_apps block you opt-in to the defaults.
  • To opt out of all apps you must explicitly set them all to false.

- Enables a template admin to configure which apps are displayed
  to the user in the dashboard.
docs/resources/agent.md Outdated Show resolved Hide resolved
@sreya sreya requested review from kylecarbs and bpmct August 23, 2023 01:18
provider/agent.go Show resolved Hide resolved
os = "linux"
arch = "amd64"
display_apps {
vscode = false
Copy link
Member

Choose a reason for hiding this comment

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

Do we need an extra test case to check .tf with only a few apps selected:

display_apps {
   vscode = true
   web_terminal = true

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Since they all have default values I tested that specifying their non-defaults (in OK) and then omitting them to produce the defaults (in Omitted) produces the desired result. I added another one anyway but I don't think it adds much value.

provider/agent_test.go Show resolved Hide resolved
@matifali matifali changed the title feat: add default_apps field to agent feat: add default_apps field to coder_agent resource Aug 29, 2023
@sreya sreya requested a review from mtojek August 29, 2023 23:37
provider/examples_test.go Outdated Show resolved Hide resolved
Copy link
Member

@mtojek mtojek left a comment

Choose a reason for hiding this comment

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

👍

just take a look at the comment in examples_test.go

@sreya sreya merged commit 233ea60 into main Aug 30, 2023
9 checks passed
@sreya sreya deleted the jon/defaultapps branch August 30, 2023 19:02
@github-actions github-actions bot locked and limited conversation to collaborators Aug 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants