-
Notifications
You must be signed in to change notification settings - Fork 7
Use stored versions for duck types #192
base: main
Are you sure you want to change the base?
Use stored versions for duck types #192
Conversation
Signed-off-by: Sebastian Vidrio <svidrio@vmware.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the stored version for the CRD is not also served?
const storedMeta = duckMetas.find(meta => meta.kind === cur[0] && meta.apiVersion.endsWith(cur[1].name)) | ||
return storedMeta ? acc.concat(storedMeta) : acc | ||
}, []) | ||
// const latestVersions = latestDuckTypeVersions(duckVersions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What this comment for?
Also looks like this was the only reference to latestDuckTypeVersions I think
const crdNames: string[] = uniqueMetas.map((meta) => { | ||
const group: string = meta?.apiVersion.split("/")[0] || "nogroup" | ||
// TODO: this is currently a guess and potentially risky | ||
const plural: string = meta?.kind.toLocaleLowerCase() + 's' || "noname" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we able to get the CRD? Or are you trying to avoid more API calls?
} | ||
return acc | ||
const stored = StoredVersions(sourceMetas) | ||
const storedMetas: ResourceMeta[] = stored.reduce((acc: ResourceMeta[], cur) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull out this reduce as a function from this and discovery?
Hmm, interesting. What would be the "best" version to display? The CLI currently just gets the "first served version," but that also runs into the issue we were seeing. It seems the Would it be better if we don't handle this at all and just push the bug upstream? |
It's possible that only select versions of the resources support the duck type you're looking for. Or it could be an issue in the conversion webhook for those resources. |
Switch to stored versions due to bug with missing sink information on other sources
Signed-off-by: Sebastian Vidrio svidrio@vmware.com