rancher_environment: do not use a custom set function for members
This commit is contained in:
parent
b6c9b2dc7a
commit
4f521c74b0
|
@ -1,13 +1,11 @@
|
||||||
package rancher
|
package rancher
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/hashicorp/terraform/helper/hashcode"
|
|
||||||
"github.com/hashicorp/terraform/helper/resource"
|
"github.com/hashicorp/terraform/helper/resource"
|
||||||
"github.com/hashicorp/terraform/helper/schema"
|
"github.com/hashicorp/terraform/helper/schema"
|
||||||
"github.com/hashicorp/terraform/helper/validation"
|
"github.com/hashicorp/terraform/helper/validation"
|
||||||
|
@ -63,7 +61,6 @@ func resourceRancherEnvironment() *schema.Resource {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Set: memberHash,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -288,14 +285,6 @@ func makeProjectMembers(in []interface{}) (out []interface{}) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func memberHash(member interface{}) int {
|
|
||||||
var buf bytes.Buffer
|
|
||||||
m := member.(map[string]interface{})
|
|
||||||
buf.WriteString(fmt.Sprintf("%s-", m["external_id_type"]))
|
|
||||||
buf.WriteString(fmt.Sprintf("%s-", m["external_id"]))
|
|
||||||
return hashcode.String(buf.String())
|
|
||||||
}
|
|
||||||
|
|
||||||
// EnvironmentStateRefreshFunc returns a resource.StateRefreshFunc that is used to watch
|
// EnvironmentStateRefreshFunc returns a resource.StateRefreshFunc that is used to watch
|
||||||
// a Rancher Environment.
|
// a Rancher Environment.
|
||||||
func EnvironmentStateRefreshFunc(client *rancherClient.RancherClient, environmentID string) resource.StateRefreshFunc {
|
func EnvironmentStateRefreshFunc(client *rancherClient.RancherClient, environmentID string) resource.StateRefreshFunc {
|
||||||
|
|
Loading…
Reference in New Issue