-
Notifications
You must be signed in to change notification settings - Fork 988
feat: use app wildcards for apps if configured #4263
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
Changes from 4 commits
dbb2e0e
c8d2da9
5bd46a9
35596a7
6a8339e
4d75f5c
e51f69d
ea0a38f
4f6ab19
e4e8663
26b5e57
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,12 +27,14 @@ type agentAttributes struct { | |
|
||
// A mapping of attributes on the "coder_app" resource. | ||
type agentAppAttributes struct { | ||
AgentID string `mapstructure:"agent_id"` | ||
Name string `mapstructure:"name"` | ||
Icon string `mapstructure:"icon"` | ||
URL string `mapstructure:"url"` | ||
Command string `mapstructure:"command"` | ||
RelativePath bool `mapstructure:"relative_path"` | ||
AgentID string `mapstructure:"agent_id"` | ||
Name string `mapstructure:"name"` | ||
Icon string `mapstructure:"icon"` | ||
URL string `mapstructure:"url"` | ||
Command string `mapstructure:"command"` | ||
// RelativePath is optional, but it defaults to true so we have to make it | ||
// a pointer to be backwards compatible. | ||
RelativePath *bool `mapstructure:"relative_path"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this needs to be a pointer anymore There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We prefer the deprecated value over the new value if it's set, so we have to use a pointer for this to determine if it was explicitly set or not. I will add a comment |
||
Healthcheck []appHealthcheckAttributes `mapstructure:"healthcheck"` | ||
} | ||
|
||
|
@@ -238,6 +240,13 @@ func ConvertResources(module *tfjson.StateModule, rawGraph string) ([]*proto.Res | |
Threshold: attrs.Healthcheck[0].Threshold, | ||
} | ||
} | ||
|
||
// Default attrs.RelativePath to true if unspecified in Terraform. | ||
relativePath := true | ||
if attrs.RelativePath != nil { | ||
relativePath = *attrs.RelativePath | ||
} | ||
|
||
for _, agents := range resourceAgents { | ||
for _, agent := range agents { | ||
// Find agents with the matching ID and associate them! | ||
|
@@ -249,7 +258,7 @@ func ConvertResources(module *tfjson.StateModule, rawGraph string) ([]*proto.Res | |
Command: attrs.Command, | ||
Url: attrs.URL, | ||
Icon: attrs.Icon, | ||
RelativePath: attrs.RelativePath, | ||
RelativePath: relativePath, | ||
Healthcheck: healthcheck, | ||
}) | ||
} | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'll have to invert this on the provider to not break current deployments.
This is defaulting to
false
: https://github.com/coder/terraform-provider-coder/blob/main/provider/app.go#L62, which I believe would break everyone.eg. remove
relative_path
and addsubdomain
insteadThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!