fix(generate): registry generation, go:embed for typed examples, inverted methods#158
Merged
Conversation
…er seeded from merger
…od rename exposes them to parent module
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.
Summary
go:embedsilently skips subdirectories containing ago.mod(nested module rule) —09-hooks,10-constructor, and11-mixed-operator-patternwere missing fromork init --pack advancedon every machine. Fixed by renaminggo.mod/go.sum→.txtat embed time;ork initrestores them transparently on extraction, and the Makefiles restore them on the firstmake registryormake build.cmd/cli/generate.go:generateKatalogwas settingkat.Specbut never callingm.Enabled(), sokat.Enabled()always returned nil.generate.TypeRegistryiterated over nothing and silently exited — no registry was ever written.pkg/types/methods.go:CustomHooksEnabled()andConstructorEnabled()returned== nilinstead of!= nil— inverted for every call site. Safe for declarative CRDs (all call sites are guarded byDefaultReconcile()) but would have caused panics and wrong behavior for typed operators.pkg/generate/registry_generator.go:TypeRegistrynow returns(bool, error)so the caller knows whether anything was written.cmd/cli/generate_registry.go:ensureMainGois now only called when the registry was actually written. Output replaced withfmtusing→/✓/○style matching other CLI commands.Test plan
ork init --pack advancedincludes 09-hooks, 10-constructor, 11-mixed-operator-patternmake registryinside an extracted typed example restoresgo.modand generates the registryork generate registry -f komposer.yamlfrom11-mixed-operator-patternproduceszz_generated_typeregistry.gowith hook and constructor entriesork generate registryon a declarative-only katalog prints○ nothing to generateand does not writemain.goork runon a declarative katalog is unaffectedv0.7.0and verifyork init --pack advanceddelivers all 12 examples