-
Notifications
You must be signed in to change notification settings - Fork 23
chore!: remove deprecated items from coder_workspace
data source
#255
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
d14d6ee
chore!: remove deprecated owner-related fields from workspace data so…
matifali 1da8ba7
fix integration tests
matifali 4d5b168
remove remaining instances
matifali 4dbf571
Discard changes to integration/workspace-owner/main.tf
matifali c7ce74a
Discard changes to integration/test-data-source/main.tf
matifali d38e383
Discard changes to integration/integration_test.go
matifali ff0131f
fixup!
matifali c916802
cleanup
matifali f604605
more cleanup
matifali f4a4746
fixup!
matifali 28d764d
remove example
matifali 396eaff
fixup!
matifali 4ede0cd
Discard changes to examples/data-sources/coder_workspace/data-source.tf
matifali 001c185
elaborate example
matifali 7337eac
fmt
matifali 025afb1
`make gen`
matifali File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
elaborate example
- Loading branch information
commit 001c185bb4c5ab7d19d846aff2246c197a3604a2
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,46 @@ | ||
data "coder_workspace" "dev" { | ||
provider "coder" {} | ||
|
||
provider "docker" {} | ||
|
||
data "coder_workspace" "me" {} | ||
|
||
data "coder_workspace_owner" "me" {} | ||
|
||
resource "coder_agent" "dev" { | ||
arch = "amd64" | ||
os = "linux" | ||
dir = "/workspace" | ||
} | ||
|
||
resource "kubernetes_pod" "dev" { | ||
count = data.coder_workspace.dev.transition == "start" ? 1 : 0 | ||
resource "docker_container" "workspace" { | ||
count = data.coder_workspace.me.start_count | ||
image = docker_image.main.name | ||
# Uses lower() to avoid Docker restriction on container names. | ||
name = "coder-${data.coder_workspace_owner.me.name}-${lower(data.coder_workspace.me.name)}" | ||
# Hostname makes the shell more user friendly: coder@my-workspace:~$ | ||
hostname = data.coder_workspace.me.name | ||
# Use the docker gateway if the access URL is 127.0.0.1 | ||
entrypoint = ["sh", "-c", replace(coder_agent.main.init_script, "/localhost|127\\.0\\.0\\.1/", "host.docker.internal")] | ||
env = ["CODER_AGENT_TOKEN=${coder_agent.main.token}"] | ||
host { | ||
host = "host.docker.internal" | ||
ip = "host-gateway" | ||
} | ||
# Add labels in Docker to keep track of orphan resources. | ||
labels { | ||
label = "coder.owner" | ||
value = data.coder_workspace_owner.me.name | ||
} | ||
labels { | ||
label = "coder.owner_id" | ||
value = data.coder_workspace_owner.me.id | ||
} | ||
labels { | ||
label = "coder.workspace_id" | ||
value = data.coder_workspace.me.id | ||
} | ||
labels { | ||
label = "coder.workspace_name" | ||
value = data.coder_workspace.me.name | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Elaborated example usage. If its too much happy to simply it.