Skip to content

Approach to manage common configurations in CUE #910

Answered by cueckoo
cueckoo asked this question in Q&A
Discussion options

You must be logged in to vote

Original reply by @myitcv in cuelang/cue#910 (comment)

@selfuryon apologies for the delay in replying to your question.

Either will work, the embedding in approach 1 is "cleaner" in my opinion.

If metallb is indeed common to all sub-instances env1, env2 and env3, another approach is to move the definition of metallb to the parent directory. Here's a rough example:

exec cue eval ./env1
exec cue eval ./env2
exec cue eval ./env3

-- cue.mod/module.cue --
module: "metallb.com"
-- env1/env1.cue --
package kube

config: {
	env: "env1"
}
-- env2/env2.cue --
package kube

config: {
	env: "env2"
}
-- env3/env3.cue --
package kube

config: {
	env: "env3"
}
-- metallb.cue --
package kube

config: {
…

Replies: 1 comment

Comment options

cueckoo
Jul 3, 2021
Collaborator Author

You must be logged in to vote
0 replies
Answer selected by cueckoo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant