Set the registries a cluster's images may come from
curl --request PUT \
--url https://app.trustivan.com/api/v1/kubernetes/clusters/{id}/registries \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"registries": [
"<string>"
]
}
'import requests
url = "https://app.trustivan.com/api/v1/kubernetes/clusters/{id}/registries"
payload = { "registries": ["<string>"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({registries: ['<string>']})
};
fetch('https://app.trustivan.com/api/v1/kubernetes/clusters/{id}/registries', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/kubernetes/clusters/{id}/registries"
payload := strings.NewReader("{\n \"registries\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Set the registries a cluster's images may come from
Registry hosts (ghcr.io, registry.example.com:5000) or
registry/path prefixes (ghcr.io/acme). Images from anywhere else
fail k8s.container.untrusted-registry at the next collection and at
admission. An empty list ([]) turns the check off, and it reports
not_assessed rather than passing. At most 50 entries; docker.io
means Docker Hub.
Behind credentials:manage.
PUT
/
kubernetes
/
clusters
/
{id}
/
registries
Set the registries a cluster's images may come from
curl --request PUT \
--url https://app.trustivan.com/api/v1/kubernetes/clusters/{id}/registries \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"registries": [
"<string>"
]
}
'import requests
url = "https://app.trustivan.com/api/v1/kubernetes/clusters/{id}/registries"
payload = { "registries": ["<string>"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({registries: ['<string>']})
};
fetch('https://app.trustivan.com/api/v1/kubernetes/clusters/{id}/registries', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/kubernetes/clusters/{id}/registries"
payload := strings.NewReader("{\n \"registries\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Authorizations
Response
The list now stored, normalised and de-duplicated.