小编Kie*_*ran的帖子

GitHub 查看直接请求我而不是我的团队请求的 PR

https://github.com/pulls/review-requested显示了我被请求的所有 PR 的列表,包括我的团队,它会自动标记在给定目录中的每个 PR 上。

有没有办法显示我的直接审核请求?

git github

7
推荐指数
1
解决办法
551
查看次数

如何在 Terraform Framework Plugin 复杂类型和 Golang 类型之间进行转换?

在官方的 Terraform Framework 插件示例中,目前只有涉及简单类型的 CRUD 资源的非常简单的示例。

如果我们使用像地图这样的复杂类型,代码就会变得非常冗长。这就是我目前正在做的事情,但感觉不对。

如果我有一个foo带有地图属性的资源bar

func (r *FooResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) {
    var data *ResourceModel

    // Read Terraform prior state data into the model
    resp.Diagnostics.Append(req.State.Get(ctx, &data)...)

    if resp.Diagnostics.HasError() {
        return
    }

    // call API to get "real" state

    foo, err := r.GetFoo(data.Id.ValueString())
    if err != nil {
        resp.Diagnostics.AddError(
            "Error reading foo",
            fmt.Sprintf("Error reading foo: %s", err),
        )
        return
    }

    // check to see if real data.Bar is actually different from …
Run Code Online (Sandbox Code Playgroud)

go terraform

5
推荐指数
0
解决办法
383
查看次数

标签 统计

git ×1

github ×1

go ×1

terraform ×1