Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions cli/configssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"fmt"
"io"
"io/fs"
"net/http"
"os"
"path/filepath"
"runtime"
Expand Down Expand Up @@ -456,15 +455,7 @@ func (r *RootCmd) configSSH() *serpent.Command {

coderdConfig, err := client.SSHConfiguration(ctx)
if err != nil {
// If the error is 404, this deployment does not support
// this endpoint yet. Do not error, just assume defaults.
// TODO: Remove this in 2 months (May 31, 2023). Just return the error
// and remove this 404 check.
var sdkErr *codersdk.Error
if !xerrors.As(err, &sdkErr) || sdkErr.StatusCode() != http.StatusNotFound {
return xerrors.Errorf("fetch coderd config failed: %w", err)
}
coderdConfig.HostnamePrefix = "coder."
return xerrors.Errorf("fetch coderd config failed: %w", err)
}

configOptions, err := mergeSSHOptions(sshConfigOpts, coderdConfig, string(root), coderBinary)
Expand Down
14 changes: 4 additions & 10 deletions coderd/httpmw/organizationparam.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,10 @@ func ExtractOrganizationParam(db database.Store) func(http.Handler) http.Handler
var organization database.Organization
var dbErr error

// If the name is exactly "default", then we fetch the default
// organization. This is a special case to make it easier
// for single org deployments.
//
// arg == uuid.Nil.String() should be a temporary workaround for
// legacy provisioners that don't provide an organization ID.
// This prevents a breaking change.
// TODO: This change was added March 2024. Nil uuid returning the
// default org should be removed some number of months after
// that date.
// If the name is exactly "default" or the nil UUID, then we fetch
// the default organization. This is a special case to make it
// easier for single org deployments, and external callers depend
// on the nil UUID resolving to the default org.
Comment thread
aslilac marked this conversation as resolved.
Outdated
if arg == codersdk.DefaultOrganization || arg == uuid.Nil.String() {
organization, dbErr = db.GetDefaultOrganization(ctx)
} else {
Expand Down
5 changes: 1 addition & 4 deletions coderd/httpmw/organizationparam_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,7 @@ func TestOrganizationParam(t *testing.T) {
defer res.Body.Close()
require.Equal(t, http.StatusOK, res.StatusCode, "by default keyword")

// Try by legacy
// TODO: This can be removed when legacy nil uuids are no longer supported.
// This is a temporary measure to ensure as legacy provisioners use
// nil uuids as the org id and expect the default org.
// Try by nil uuid, which resolves to the default org.
chi.RouteContext(r.Context()).URLParams.Add("organization", uuid.Nil.String())
chi.RouteContext(r.Context()).URLParams.Add("user", user.ID.String())
rtr.ServeHTTP(rw, r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,6 @@ function terraform_apply() {
EOL
}

# TODO: remove
echo "$@" >>/tmp/blah

case "$1" in
version)
terraform_version
Expand Down
Loading