Skip to content

Feat: add an example about the global-variables policy#95

Draft
barnettZQG wants to merge 1 commit into
kubevela:masterfrom
barnettZQG:master
Draft

Feat: add an example about the global-variables policy#95
barnettZQG wants to merge 1 commit into
kubevela:masterfrom
barnettZQG:master

Conversation

@barnettZQG
Copy link
Copy Markdown
Contributor

Signed-off-by: barnettZQG barnett.zqg@gmail.com

Signed-off-by: barnettZQG <barnett.zqg@gmail.com>
@barnettZQG barnettZQG changed the title Feat: add a example about the global-variables policy Feat: add an example about the global-variables policy Jul 7, 2022
port: context.variables.DB_PORT
user: context.variables.DB_USER
password: context.variables.DB_PASSWORD
database: context.variables.DB_DATABASE
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

这个方案的核心问题是会把我们从 IaD 变成 IaC。 每个 value 都加入了 magic,需要计算一下,再render。

现在我们的 Application 是 IaD 的,每个数据都是固定的 data,不需要计算。 唯一需要计算的可能就是 output 里加入了一个 valueFrom

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

如果要保留之前的机制,那就是通过 valueFrom 来设置参数获取和赋值。但是感觉写起来有点多余。因为不得不为 每个字段先写一个默认值。

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants