storage/kubernetes: remove shadowed ResourceVersion from Connector (#1673)
This commit is contained in:
parent
f6476b62f2
commit
cfae2eb720
@ -594,7 +594,6 @@ func testConnectorCRUD(t *testing.T, s storage.Storage) {
|
|||||||
ID: id1,
|
ID: id1,
|
||||||
Type: "Default",
|
Type: "Default",
|
||||||
Name: "Default",
|
Name: "Default",
|
||||||
ResourceVersion: "1",
|
|
||||||
Config: config1,
|
Config: config1,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -612,7 +611,6 @@ func testConnectorCRUD(t *testing.T, s storage.Storage) {
|
|||||||
ID: id2,
|
ID: id2,
|
||||||
Type: "Mock",
|
Type: "Mock",
|
||||||
Name: "Mock",
|
Name: "Mock",
|
||||||
ResourceVersion: "2",
|
|
||||||
Config: config2,
|
Config: config2,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -626,6 +624,8 @@ func testConnectorCRUD(t *testing.T, s storage.Storage) {
|
|||||||
t.Errorf("get connector: %v", err)
|
t.Errorf("get connector: %v", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// ignore resource version comparison
|
||||||
|
gr.ResourceVersion = ""
|
||||||
if diff := pretty.Compare(want, gr); diff != "" {
|
if diff := pretty.Compare(want, gr); diff != "" {
|
||||||
t.Errorf("connector retrieved from storage did not match: %s", diff)
|
t.Errorf("connector retrieved from storage did not match: %s", diff)
|
||||||
}
|
}
|
||||||
@ -650,11 +650,15 @@ func testConnectorCRUD(t *testing.T, s storage.Storage) {
|
|||||||
t.Errorf("list connectors: %v", err)
|
t.Errorf("list connectors: %v", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// ignore resource version comparison
|
||||||
|
for i := range connectors {
|
||||||
|
connectors[i].ResourceVersion = ""
|
||||||
|
}
|
||||||
sort.Slice(connectors, func(i, j int) bool {
|
sort.Slice(connectors, func(i, j int) bool {
|
||||||
return connectors[i].Name < connectors[j].Name
|
return connectors[i].Name < connectors[j].Name
|
||||||
})
|
})
|
||||||
if diff := pretty.Compare(want, connectors); diff != "" {
|
if diff := pretty.Compare(want, connectors); diff != "" {
|
||||||
t.Errorf("password list retrieved from storage did not match: %s", diff)
|
t.Errorf("connector list retrieved from storage did not match: %s", diff)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
listAndCompare(connectorList)
|
listAndCompare(connectorList)
|
||||||
|
@ -598,7 +598,6 @@ type Connector struct {
|
|||||||
ID string `json:"id,omitempty"`
|
ID string `json:"id,omitempty"`
|
||||||
Type string `json:"type,omitempty"`
|
Type string `json:"type,omitempty"`
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
ResourceVersion string `json:"resourceVersion,omitempty"`
|
|
||||||
// Config holds connector specific configuration information
|
// Config holds connector specific configuration information
|
||||||
Config []byte `json:"config,omitempty"`
|
Config []byte `json:"config,omitempty"`
|
||||||
}
|
}
|
||||||
@ -616,7 +615,6 @@ func (cli *client) fromStorageConnector(c storage.Connector) Connector {
|
|||||||
ID: c.ID,
|
ID: c.ID,
|
||||||
Type: c.Type,
|
Type: c.Type,
|
||||||
Name: c.Name,
|
Name: c.Name,
|
||||||
ResourceVersion: c.ResourceVersion,
|
|
||||||
Config: c.Config,
|
Config: c.Config,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -626,7 +624,7 @@ func toStorageConnector(c Connector) storage.Connector {
|
|||||||
ID: c.ID,
|
ID: c.ID,
|
||||||
Type: c.Type,
|
Type: c.Type,
|
||||||
Name: c.Name,
|
Name: c.Name,
|
||||||
ResourceVersion: c.ResourceVersion,
|
ResourceVersion: c.ObjectMeta.ResourceVersion,
|
||||||
Config: c.Config,
|
Config: c.Config,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user