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:
Andrei Kvapil
2024-12-10 12:40:29 +01:00
committed by GitHub
parent 898374b533
commit ebe9a1b0a5
2 changed files with 7 additions and 0 deletions

View File

@@ -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)
}

View File

@@ -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
}