Skip to content

Providers bootstrap APIs#612

Open
gman0 wants to merge 6 commits intoplatform-mesh:mainfrom
gman0:providers-api
Open

Providers bootstrap APIs#612
gman0 wants to merge 6 commits intoplatform-mesh:mainfrom
gman0:providers-api

Conversation

@gman0
Copy link
Copy Markdown

@gman0 gman0 commented May 5, 2026

This PR is a first iteration for https://github.com/platform-mesh/architecture/blob/main/rfc/006_provider-bootstrap-operator.md

It ensures the ManagedProvider Reconciliation Flow (see RFC) with caveats -- i.e. TODOs:

  • Uses long-term SA token for auth
  • Uses * RBACs for provider's SA
  • No APIExport for provider
  • No docs

These (and more) will be amended in follow ups.

gman0 added 5 commits May 5, 2026 06:04
* Implements first iteration of ManagedProvider and Provider APIs.
* Adds a new Providers operator
* Adds feature-enable-provider-manager

On-behalf-of: @SAP robert.vasek@sap.com
Signed-off-by: Robert Vasek <robert.vasek@clyso.com>
@gman0 gman0 requested review from a team as code owners May 5, 2026 04:22
@gman0 gman0 changed the title Providers api Providers bootstrap APIs May 5, 2026
Comment on lines +112 to +122
// Ensure Role.
role := &rbacv1.Role{ObjectMeta: metav1.ObjectMeta{Name: roleName, Namespace: providerSANamespace}}
if _, err := controllerutil.CreateOrUpdate(ctx, cl, role, func() error {
role.Rules = []rbacv1.PolicyRule{
// TODO: define exact permission claims required by the provider. ManagedProvider.Spec.PermissionClaims?
{ // Until we figure this out. 🤩
APIGroups: []string{"*"},
Resources: []string{"*"},
Verbs: []string{"*"},
},
}
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably needs API change? We need to decide what exactly will that look like, and then follow up with more PRs.

Comment on lines +138 to +149
// Ensure a static long-lived SA token Secret.
tokenSecret := &corev1.Secret{ObjectMeta: metav1.ObjectMeta{Name: tokenSecretName, Namespace: providerSANamespace}}
if _, err := controllerutil.CreateOrUpdate(ctx, cl, tokenSecret, func() error {
tokenSecret.Type = corev1.SecretTypeServiceAccountToken
if tokenSecret.Annotations == nil {
tokenSecret.Annotations = map[string]string{}
}
tokenSecret.Annotations[corev1.ServiceAccountNameKey] = saName
return nil
}); err != nil {
return subroutines.OK(), gcerrors.Wrap(err, "create or update token Secret %s", tokenSecretName)
}
Copy link
Copy Markdown
Author

@gman0 gman0 May 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We aim for OIDC, as per RFC. Will follow up in future PRs.

Comment thread Taskfile.yml
Comment on lines +136 to +149
- cmd: |
# Prepare manifests for apigen.
mkdir -p {{.CRD_DIRECTORY}}/apigen/{crd,out}
cp {{.CRD_DIRECTORY}}/providers.platform-mesh.io_providers.yaml {{.CRD_DIRECTORY}}/apigen/crd
# Run apigen and move the output files to their respective dirs.
{{.LOCAL_BIN}}/apigen --input-dir {{.CRD_DIRECTORY}}/apigen/crd --output-dir {{.CRD_DIRECTORY}}/apigen/out
mv {{.CRD_DIRECTORY}}/apigen/out/apiexport-providers.platform-mesh.io.yaml ./manifests/features/feature-enable-provider-manager/01-platform-mesh-system
mv {{.CRD_DIRECTORY}}/apigen/out/apiresourceschema-providers.providers.platform-mesh.io.yaml ./manifests/features/feature-enable-provider-manager/01-platform-mesh-system
# Merge permission claims into the generated Providers APIExport.
yq -i '. *= load("./manifests/features/feature-enable-provider-manager/permission-claims-patch.yamlpatch")' \
./manifests/features/feature-enable-provider-manager/01-platform-mesh-system/apiexport-providers.platform-mesh.io.yaml
# Cleanup.
[ -d {{.CRD_DIRECTORY}} ] && rm -rf {{.CRD_DIRECTORY}}/apigen || exit 1
ignore_error: false
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Poor man's way to generate the APIExport + perm claims. Is there some established pattern across PM org to do this? Should apigen support that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant