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

Consolidate all list and watch operation optional parameters into a single type #36

Closed
Arnavion opened this issue Mar 9, 2019 · 0 comments

Comments

@Arnavion
Copy link
Owner

Arnavion commented Mar 9, 2019

$spec = iwr 'https://github.com/kubernetes/kubernetes/blob/master/api/openapi-spec/swagger.json?raw=true' | ConvertFrom-Json
$operations = $spec.paths.PSObject.Properties | ?{ ($_.Value.get.'x-kubernetes-action' -eq 'list') -and ($_.Value.get.parameters.Length -gt 0) } | %{ New-Object psobject -Property @{ 'Name' = $_.Name; 'Parameters' = $_.Value.get.parameters | % name | sort } }
$first = $operations[0].Parameters -join ','; $operations | select -Skip 1 | ?{ ($_.Parameters -join ',') -ne $first }

suggests all list operations in the spec have the same optional parameters (except for the API discovery ones at the crate root that have no parameters at all): continue, fieldSelector, labelSelector, limit, resourceVersion, timeoutSeconds, watch

So all list operation functions could be a single type with those fields minus watch, and all watch operation functions could be the same type with those fields minus continue and watch.

Arnavion pushed a commit that referenced this issue Mar 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant