Skip to content

Feat/separate swagger server#8

Merged
hellices merged 3 commits into
mainfrom
feat/separate-swagger-server
Jun 11, 2025
Merged

Feat/separate swagger server#8
hellices merged 3 commits into
mainfrom
feat/separate-swagger-server

Conversation

@hellices

Copy link
Copy Markdown
Owner

No description provided.

hellices added 3 commits June 4, 2025 16:50
This commit introduces a new SwaggerServer CRD and controller to manage the Swagger UI deployment independently. This decouples the Swagger UI from the OpenAPIAggregator controller.

Key changes:
- Added `SwaggerServer` CRD (`api/v1alpha1/swaggerserver_types.go`) and its controller (`internal/controller/swaggerserver_controller.go`).
- The `SwaggerServer` controller now deploys a pre-built Swagger UI image (`ghcr.io/hellices/openapi-multi-swagger:latest` by default) and configures it based on the `openapi-specs` ConfigMap.
- Modified `OpenAPIAggregator` controller:
    - Replaced `spec.labelSelector` with `spec.watchNamespaces` for service discovery.
        - If `watchNamespaces` is empty or not provided, it watches services in the OpenAPIAggregator CR's namespace.
        - If `watchNamespaces` is `[""]` or `["*"]`, it watches services in all namespaces (requires cluster-level RBAC).
    - The `openapi-specs` ConfigMap is always created in the OpenAPIAggregator CR's namespace.
    - ConfigMap data keys are now in the format `namespace.serviceName`.
- Updated RBAC rules (`config/rbac/role.yaml`, `config/rbac/role_binding.yaml`) to grant necessary cluster-wide permissions for watching services and managing ConfigMaps when `watchNamespaces` is set to all namespaces.
- Created sample ClusterRole and ClusterRoleBinding for users who want to grant cluster-wide read access to services for the operator.
- Removed the custom Swagger UI server code from `pkg/swagger`.
- Updated `README.md` to reflect these changes.
- Resolved duplicate `run` target in `Makefile`.
@hellices hellices merged commit 01ebd8c into main Jun 11, 2025
2 checks passed
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

Successfully merging this pull request may close these issues.

1 participant