If the source repository is private, the handler routes to the Registry API (via `get-package-registry-incoming-channel`) to retrieve credentials before fetching the chart. For OCM-based multi-cluster deployments (`clusterManager: "ocm"`), it also routes through Registry API, passing the scheduler namespace read from `clusterMetadata`, and the chart is rewritten into a P2Code `ManifestWork` before it is stored.
If the source repository is private, the handler routes to the Registry API (via `get-package-registry-incoming-channel`) to retrieve credentials before fetching the chart. For OCM-based multi-cluster deployments (`clusterManager: "ocm"`), it also routes through Registry API, passing the scheduler namespace read from `clusterMetadata`, and the chart is rewritten into a `HypoSchedulingManifest` before it is stored.
Upon success, the handler publishes a response to `helm-engine-parse-result`:
@@ -281,25 +281,29 @@ For the OCM scheduler chart itself (installed on the hub as a plain Helm order,
During the parse phase, the Package Manager decodes `clusterMetadata`, extracts the `namespace` field, and stores it as the Helm chart annotation `sonata.engine/namespace`. This annotation is then read by the deploy, activate, and terminate handlers to determine the correct namespace of the OCM scheduler, instead of defaulting to the `serviceId`.
An example `clusterMetadata` payload (after Base64 decoding) for the **P2CODE** scheduler:
An example `clusterMetadata` payload (after Base64 decoding) for the **Hypo** OCM scheduler:
```yaml
apiVersion:scheduling.p2code.eu/v1alpha1
kind:P2CodeSchedulingManifest
apiVersion:scheduling.hypo.eu/v1alpha1
kind:HypoSchedulingManifest
metadata:
name:poc
namespace:p2code-scheduler-system
name:hypo-scheduler-test
namespace:hypo-scheduler-system
spec:
globalAnnotations:
-hypo.target.managedClusterSet=test
workloadAnnotations:
-name:httpd
annotations:
-p2code.filter.k8sdistribution=openshift
-hypo.filter.location=athens
-name:nginx
annotations:
-p2code.filter.k8sdistribution=kubernetes
-hypo.filter.location=patra
```
The `namespace` field (`p2code-scheduler-system` above) becomes the deployment namespace. During termination with OCM, the namespace is intentionally kept alive because the OCM scheduler manages its lifecycle.
`spec.manifests` is filled in from the rendered chart; any `manifests` already in `clusterMetadata` are replaced.
The `namespace` field (`hypo-scheduler-system` above) becomes the deployment namespace. During termination with OCM, the namespace is intentionally kept alive because the OCM scheduler manages its lifecycle.