mirror of
https://github.com/outbackdingo/cozystack.git
synced 2026-01-27 18:18:41 +00:00
Fix Terraform compatibility (#524)
Signed-off-by: Andrei Kvapil <kvapss@gmail.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced dynamic registration capabilities for internal API versions of `Application` and `ApplicationList`. - Added configuration management for server options, allowing users to specify a resource configuration path via command line. - **Bug Fixes** - Improved error handling for loading resource configurations. - **Documentation** - Updated OpenAPI specification handling by removing certain definitions post-processing. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
This commit is contained in:
@@ -72,6 +72,10 @@ func RegisterDynamicTypes(scheme *runtime.Scheme, cfg *config.ResourceConfig) er
|
||||
scheme.AddKnownTypeWithName(gvk, &Application{})
|
||||
scheme.AddKnownTypeWithName(gvk.GroupVersion().WithKind(kind+"List"), &ApplicationList{})
|
||||
|
||||
gvkInternal := schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal}.WithKind(kind)
|
||||
scheme.AddKnownTypeWithName(gvkInternal, &Application{})
|
||||
scheme.AddKnownTypeWithName(gvkInternal.GroupVersion().WithKind(kind+"List"), &ApplicationList{})
|
||||
|
||||
klog.V(1).Infof("Registered kind: %s\n", kind)
|
||||
RegisteredGVKs = append(RegisteredGVKs, gvk)
|
||||
}
|
||||
|
||||
@@ -256,6 +256,9 @@ func (o *AppsServerOptions) Config() (*apiserver.Config, error) {
|
||||
klog.V(6).Infof("PostProcessSpec: Added OpenAPI definition for %s\n", listResourceName)
|
||||
}
|
||||
|
||||
delete(defs, "com.github.aenix.io.cozystack.pkg.apis.apps.v1alpha1.Application")
|
||||
delete(defs, "com.github.aenix.io.cozystack.pkg.apis.apps.v1alpha1.ApplicationList")
|
||||
|
||||
swagger.Definitions = defs
|
||||
return swagger, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user