Skip to content
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

Preserve client ID when using Kubernetes storage #1536

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions storage/kubernetes/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ func (c *client) get(resource, name string, v interface{}) error {
}

func (c *client) getResource(apiVersion, namespace, resource, name string, v interface{}) error {
c.logger.Debugf("Retrieving resource: %s/%s %s/%s", apiVersion, namespace, resource, name)
url := c.urlFor(apiVersion, namespace, resource, name)
resp, err := c.client.Get(url)
if err != nil {
Expand Down
3 changes: 1 addition & 2 deletions storage/kubernetes/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,7 @@ func (cli *client) GetClient(id string) (storage.Client, error) {

func (cli *client) getClient(id string) (Client, error) {
var c Client
name := cli.idToName(id)
if err := cli.get(resourceClient, name, &c); err != nil {
if err := cli.get(resourceClient, id, &c); err != nil {
return Client{}, err
}
if c.ID != id {
Expand Down
2 changes: 1 addition & 1 deletion storage/kubernetes/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ func (cli *client) fromStorageClient(c storage.Client) Client {
APIVersion: cli.apiVersion,
},
ObjectMeta: k8sapi.ObjectMeta{
Name: cli.idToName(c.ID),
Name: c.ID,
Namespace: cli.namespace,
},
ID: c.ID,
Expand Down