Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

Approach to manage common configurations in CUE #910

Answered by myitcv
selfuryon asked this question in Q&A
Discussion options

You must be logged in to vote

@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: {
	name: "metallb"
}

Gives the output:

> exec cue eval .…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by selfuryon
Comment options

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