Merge pull request #41085 from deads2k/apiserver-07-move-runtime-config
Automatic merge from submit-queue (batch tested with PRs 41061, 40888, 40664, 41020, 41085) move --runtime-config to kubeapiserver `--runtime-config` is only useful if you have a lot of API groups in one server. If you have a single API group in your server (the vast majority of aggregated API servers), then the flag is unneeded and relatively complex. This moves it to closer to point of use. @sttts
This commit is contained in:
@@ -48,6 +48,7 @@ type ServerRunOptions struct {
|
||||
Authorization *kubeoptions.BuiltInAuthorizationOptions
|
||||
CloudProvider *kubeoptions.CloudProviderOptions
|
||||
StorageSerialization *kubeoptions.StorageSerializationOptions
|
||||
APIEnablement *kubeoptions.APIEnablementOptions
|
||||
|
||||
AllowPrivileged bool
|
||||
EventTTL time.Duration
|
||||
@@ -72,6 +73,7 @@ func NewServerRunOptions() *ServerRunOptions {
|
||||
Authorization: kubeoptions.NewBuiltInAuthorizationOptions(),
|
||||
CloudProvider: kubeoptions.NewCloudProviderOptions(),
|
||||
StorageSerialization: kubeoptions.NewStorageSerializationOptions(),
|
||||
APIEnablement: kubeoptions.NewAPIEnablementOptions(),
|
||||
|
||||
EventTTL: 1 * time.Hour,
|
||||
MasterCount: 1,
|
||||
@@ -107,6 +109,7 @@ func (s *ServerRunOptions) AddFlags(fs *pflag.FlagSet) {
|
||||
s.Authorization.AddFlags(fs)
|
||||
s.CloudProvider.AddFlags(fs)
|
||||
s.StorageSerialization.AddFlags(fs)
|
||||
s.APIEnablement.AddFlags(fs)
|
||||
|
||||
// Note: the weird ""+ in below lines seems to be the only way to get gofmt to
|
||||
// arrange these text blocks sensibly. Grrr.
|
||||
|
||||
@@ -203,7 +203,7 @@ func Run(s *options.ServerRunOptions) error {
|
||||
genericapiserver.NewDefaultResourceEncodingConfig(api.Registry), storageGroupsToEncodingVersion,
|
||||
// FIXME: this GroupVersionResource override should be configurable
|
||||
[]schema.GroupVersionResource{batch.Resource("cronjobs").WithVersion("v2alpha1")},
|
||||
master.DefaultAPIResourceConfigSource(), s.GenericServerRunOptions.RuntimeConfig)
|
||||
master.DefaultAPIResourceConfigSource(), s.APIEnablement.RuntimeConfig)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error in initializing storage factory: %s", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user