Skip to content

Commit

Permalink
Repairs for deprecated service (#361)
Browse files Browse the repository at this point in the history
TL;DR
-----

Fixes setup and login failures for eliminated service

Details
-------

Updates all references to `id.replicated.com` to use the
`api.replicated.com` service endpoints that replaced the services from
that domain.
  • Loading branch information
crdant authored Feb 5, 2025
1 parent 44f4175 commit 1269f80
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions libs/header.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ get_api_token () {
password=$(get_password)
login=$( jq -n -c --arg email "${INSTRUQT_PARTICIPANT_ID}@replicated-labs.com" --arg password "${password}" '$ARGS.named' )
set +eu pipefail
token=$(curl -s -H "Content-Type: application/json" --request POST -d "$login" https://id.replicated.com/v1/login | jq -r ".token")
token=$(curl -s -H "Content-Type: application/json" --request POST -d "$login" https://api.replicated.com/vendor/v1/login | jq -r ".token")
set -eu pipefail

i=0
while [[ ( -z "$token" || "$token" == "null" ) && $i -lt 20 ]]
do
sleep $((i*5))
set +eu pipefail
token=$(curl -s -H "Content-Type: application/json" --request POST -d "$login" https://id.replicated.com/v1/login | jq -r ".token")
token=$(curl -s -H "Content-Type: application/json" --request POST -d "$login" https://api.replicated.com/vendor/v1/login | jq -r ".token")
set -eu pipefail
i=$((i+1))
done
Expand Down
2 changes: 1 addition & 1 deletion setup/cmd/kots-field-labs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func HandleRequest(event fieldlabs.LambdaEvent) error {
APIOrigin: "https://api.replicated.com/vendor",
GraphQLOrigin: "https://g.replicated.com/graphql",
KURLSHOrigin: "https://kurl.sh",
IDOrigin: "https://id.replicated.com",
IDOrigin: "https://api.replicated.com/vendor",
}

action, ok := actions[event.Action]
Expand Down
2 changes: 1 addition & 1 deletion setup/cmd/kots-field-labs/param.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func GetParams() (*fieldlabs.Params, error) {
params.KURLSHOrigin = "https://kurl.sh"
}
if params.IDOrigin == "" {
params.IDOrigin = "https://id.replicated.com"
params.IDOrigin = "https://api.replicated.com/vendor"
}

actionString := os.Getenv("REPLICATED_ACTION")
Expand Down

0 comments on commit 1269f80

Please sign in to comment.