-
Notifications
You must be signed in to change notification settings - Fork 18
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
Fix running api server locally #38
Conversation
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.
OK, the Porch server won't run locally for me now either on the latest Kubernetes. We need this.
serverConfig.OpenAPIConfig = genericapiserver.DefaultOpenAPIConfig(sampleopenapi.GetOpenAPIDefinitions, openapi.NewDefinitionNamer(apiserver.Scheme)) | ||
serverConfig.OpenAPIConfig.Info.Title = "Porch" | ||
serverConfig.OpenAPIConfig.Info.Version = "0.1" | ||
serverConfig.OpenAPIConfig.Info.Title = OpenAPITitle |
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.
Why did we have to change these lines?
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.
See above.
|
||
serverConfig.OpenAPIV3Config = genericapiserver.DefaultOpenAPIV3Config(sampleopenapi.GetOpenAPIDefinitions, openapi.NewDefinitionNamer(apiserver.Scheme)) | ||
serverConfig.OpenAPIConfig.Info.Title = OpenAPITitle | ||
serverConfig.OpenAPIConfig.Info.Version = OpenAPIVersion |
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.
Why dod we need to add these lines?
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.
See above.
const ( | ||
defaultEtcdPathPrefix = "/registry/porch.kpt.dev" | ||
OpenAPITitle = "Porch" | ||
OpenAPIVersion = "0.1" |
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.
And here, could you explain what's going on?
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.
Just defining some constants for the openapi(v3) config.
I downloaded this PR and Porch now runs locally for me. |
With the upgrade k8s apiserver, the ApplyTo(config *server.RecommendedConfig) requires that the *restclient.Config be set. With how the run is standalone-debug mode was being set up, the RecommendedOptions.CoreAPI was being set to nil meaning that the default restclient would not be setup. So the fix was to remove the nil set above. |
Thanks @efiacor |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: efiacor, liamfallon The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
No description provided.