Feat/crud crds#3019
Open
dcharles525 wants to merge 10 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
Summary
Fixes EPINIO-587
Adds full CRUD over the API for three CRD-backed resources that were previously read-only or seed-only:
AppChart,BuilderImage(renamed fromBuildpack), andCatalogService. Companion CRD rename inepinio/helm-chartsships in a paired PR.Occurred changes and/or fixed issues
POST/PATCH/DELETEadded for/appcharts/:name,/builderimages/:name, and/catalogservices/:name. Existing list/show/match endpoints unchanged.Buildpack→BuilderImageend-to-end (package, models, errors, routes, auth actions, CRDKind/plural/singular, default seed). The old name was a misnomer — these resources reference builder images, not Paketo buildpacks. Paketo references in stage scripts are untouched.BuilderImage.BuilderImagefield also renamed toImage(and JSON/spec keybuilderImage→image) to remove the awkward repetition introduced by the type rename.requestctx.Logger+Infowentry/return/steps) propagated to every new and existing handler in the touched packages.Technical notes summary
internal/builderimageandinternal/appchartnow takedynamic.NamespaceableResourceInterfacedirectly (instead of*kubernetes.Cluster) so they're cleanly unit-testable. Handlers resolve the client themselves viacluster.Client{AppChart,BuilderImage}(). Two thinLookupViaCluster/ExistsViaClusterwrappers preserve the legacy call sites ininternal/api/v1/application/without churn.internal/testfakes/k8sdynamic/k8sdynamicfakes/(counterfeiter, generated) is reused across the appchart/builderimage/services unit suites.service_writeaction group now also gates the catalog write routes; addedbuilderimage,builderimage_read,builderimage_writeaction groups for parity withservice/appchart.AppChartpartial-update behavior). ForSettingsandSecretTypes, nil leaves the field alone; non-nil replaces.Areas or cases that should be tested
POST /api/v1/builderimages: validate 201 on first create, 409 on duplicate, 400 whennameorimagemissing.PATCH /api/v1/builderimages/:name: confirm partial update doesn't overwrite untouched fields; 404 for unknown name.DELETE /api/v1/builderimages/:name: 200 on success, 404 if missing./appcharts/:nameand/catalogservices/:name.BuilderImageCRD must be installed (theBuildpackCRD never landed in any release, so no migration needed).postgresql-dev,mysql-dev, etc.) still list correctly viaGET /catalogservices.Areas which could experience regressions
appchartdomain function signatures changed (now take a dynamic client). All in-tree callers updated, but any out-of-tree consumer importing these packages directly will need to follow the same pattern.internal/services/catalog.gogained a publicCatalogServiceExists; verify nothing shadowed that name.