Skip to content

Commit 6f3eb6e

Browse files
authored
Merge branch 'release/v15' into backport-2137-release-v15
2 parents 31659c2 + 84dc033 commit 6f3eb6e

12 files changed

Lines changed: 58 additions & 13 deletions

docs/data-sources/global_role_binding.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@ data "rancher2_global_role_binding" "foo" {
2525
* `id` - (Computed) The ID of the resource (string)
2626
* `group_principal_id` - (Computed) The group principal ID to assign global role binding. Rancher v2.4.0 or higher is required (string)
2727
* `user_id` - (Computed) The user ID to assign global role binding (string)
28+
* `user_principal_id` - (Computed) The user principal ID to assign global role binding (string)
2829
* `annotations` - (Computed) Annotations of the resource (map)
2930
* `labels` - (Computed) Labels of the resource (map)

docs/resources/cluster.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1368,7 +1368,7 @@ The following arguments are supported:
13681368
* `node_groups` - (Optional/Computed) The EKS cluster name to import. Required to create a new cluster (list)
13691369
* `private_access` - (Optional/Computed) The EKS cluster has private access (bool)
13701370
* `public_access` - (Optional/Computed) The EKS cluster has public access (bool)
1371-
* `public_access_sources` - (Optional/Computed) The EKS cluster public access sources (map)
1371+
* `public_access_sources` - (Optional/Computed) The EKS cluster public access sources (list)
13721372
* `region` - (Optional) The EKS cluster region. Default: `us-west-2` (string)
13731373
* `secrets_encryption` - (Optional/Computed) Enable EKS cluster secret encryption (bool)
13741374
* `security_groups` - (Optional/Computed) List of security groups to use for the cluster (list)

docs/resources/cluster_v2.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,11 @@ RANCHER_ACCESS_KEY="<RANCHER_ACCESS_KEY>"
300300
RANCHER_SECRET_KEY="<RANCHER_SECRET_KEY>"
301301
HARVESTER_CLUSTER_ID="<HARVESTER_CLUSTER_ID>"
302302
CLUSTER_NAME="foo-harvester-v2-cloud-provider"
303+
NAMESPACE="default"
303304
curl -k -X POST ${RANCHER_SERVER_URL}/k8s/clusters/${HARVESTER_CLUSTER_ID}/v1/harvester/kubeconfig \
304305
-H 'Content-Type: application/json' \
305306
-u ${RANCHER_ACCESS_KEY}:${RANCHER_SECRET_KEY} \
306-
-d '{"clusterRoleName": "harvesterhci.io:cloudprovider", "namespace": "default", "serviceAccountName": "'${CLUSTER_NAME}'"}' | xargs | sed 's/\\n/\n/g' > ${CLUSTER_NAME}-kubeconfig
307+
-d '{"clusterRoleName": "harvesterhci.io:cloudprovider", "namespace": "'${NAMESPACE}'", "serviceAccountName": "'${CLUSTER_NAME}'"}' | xargs | sed 's/\\n/\n/g' > ${CLUSTER_NAME}-kubeconfig
307308
```
308309

309310

docs/resources/global_role_binding.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,16 @@ resource "rancher2_global_role_binding" "foo" {
1515
global_role_id = "admin"
1616
user_id = "user-XXXXX"
1717
}
18-
# Create a new rancher2 Global Role Binding using group_principal_id
18+
# Create a new rancher2 Global Role Binding using user_principal_id
1919
resource "rancher2_global_role_binding" "foo2" {
2020
name = "foo2"
2121
global_role_id = "admin"
22+
user_principal_id = "local://user-XXXXX"
23+
}
24+
# Create a new rancher2 Global Role Binding using group_principal_id
25+
resource "rancher2_global_role_binding" "foo3" {
26+
name = "foo3"
27+
global_role_id = "admin"
2228
group_principal_id = "local://g-XXXXX"
2329
}
2430
```
@@ -30,11 +36,12 @@ The following arguments are supported:
3036
* `global_role_id` - (Required/ForceNew) The role id from create global role binding (string)
3137
* `group_principal_id` - (Optional/Computed/ForceNew) The group principal ID to assign global role binding (only works with external auth providers that support groups). Rancher v2.4.0 or higher is required (string)
3238
* `user_id` - (Optional/Computed/ForceNew) The user ID to assign global role binding (string)
39+
* `user_principal_id` - (Optional/Computed/ForceNew) The user principal ID to assign global role binding (string)
3340
* `name` - (Optional/Computed/ForceNew) The name of the global role binding (string)
3441
* `annotations` - (Optional/Computed) Annotations for global role binding (map)
3542
* `labels` - (Optional/Computed) Labels for global role binding (map)
3643

37-
**Note:** user `user_id` OR group `group_principal_id` must be defined
44+
**Note:** user `user_id` or `user_principal_id` OR group `group_principal_id` must be defined
3845

3946
## Attributes Reference
4047

docs/resources/machine_config_v2.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,8 @@ The following attributes are exported:
279279
* `password` - (Optional/Sensitive) OpenStack password. Mandatory on Rancher v2.0.x and v2.1.x. Use `rancher2_cloud_credential` from Rancher v2.2.x (string)
280280
* `private_key_file` - (Optional/Sensitive) Private key content to use for SSH (string)
281281
* `sec_groups` - (Optional) OpenStack comma separated security groups for the machine (string)
282+
* `server_group_id` - (Optional) OpenStack server group id to use for the instance (string)
283+
* `server_group_name` - (Optional) OpenStack server group name to use for the instance (string)
282284
* `ssh_port` - (Optional) OpenStack SSH port * Default `22` (string)
283285
* `ssh_user` - (Optional) OpenStack SSH user * Default: `root` (string)
284286
* `tenant_id` - (Required++) OpenStack tenant id. Conflicts with `tenant_name` (string)

docs/resources/node_template.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,8 @@ The following attributes are exported:
392392
* `password` - (Optional/Sensitive) OpenStack password. Mandatory on Rancher v2.0.x and v2.1.x. Use `rancher2_cloud_credential` from Rancher v2.2.x (string)
393393
* `private_key_file` - (Optional/Sensitive) Private key content to use for SSH (string)
394394
* `sec_groups` - (Optional) OpenStack comma separated security groups for the machine (string)
395+
* `server_group_id` - (Optional) OpenStack server group id to use for the instance (string)
396+
* `server_group_name` - (Optional) OpenStack server group name to use for the instance (string)
395397
* `ssh_port` - (Optional) OpenStack SSH port * Default `22` (string)
396398
* `ssh_user` - (Optional) OpenStack SSH user * Default: `root` (string)
397399
* `tenant_id` - (Required**) OpenStack tenant id. Conflicts with `tenant_name` (string)

rancher2/data_source_rancher2_global_role_binding.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ func dataSourceRancher2GlobalRoleBinding() *schema.Resource {
2424
Type: schema.TypeString,
2525
Computed: true,
2626
},
27+
"user_principal_id": {
28+
Type: schema.TypeString,
29+
Computed: true,
30+
},
2731
"group_principal_id": {
2832
Type: schema.TypeString,
2933
Computed: true,

rancher2/schema_global_role_binding.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
55
)
66

7-
// Shemas
7+
// Schemas
88

99
func globalRoleBindingFields() map[string]*schema.Schema {
1010
s := map[string]*schema.Schema{
@@ -19,6 +19,12 @@ func globalRoleBindingFields() map[string]*schema.Schema {
1919
Computed: true,
2020
ForceNew: true,
2121
},
22+
"user_principal_id": {
23+
Type: schema.TypeString,
24+
Optional: true,
25+
Computed: true,
26+
ForceNew: true,
27+
},
2228
"name": {
2329
Type: schema.TypeString,
2430
Optional: true,

rancher2/schema_machine_config_v2_openstack.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,14 @@ func machineConfigV2OpenstackFields() map[string]*schema.Schema {
111111
Type: schema.TypeString,
112112
Optional: true,
113113
},
114+
"server_group_id": {
115+
Type: schema.TypeString,
116+
Optional: true,
117+
},
118+
"server_group_name": {
119+
Type: schema.TypeString,
120+
Optional: true,
121+
},
114122
"ssh_port": {
115123
Type: schema.TypeString,
116124
Optional: true,

rancher2/structure_global_role_binding.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ func flattenGlobalRoleBinding(d *schema.ResourceData, in *managementClient.Globa
1515
d.SetId(in.ID)
1616
d.Set("global_role_id", in.GlobalRoleID)
1717
d.Set("user_id", in.UserID)
18+
d.Set("user_principal_id", in.UserPrincipalID)
1819
d.Set("name", in.Name)
1920

2021
if len(in.GroupPrincipalID) > 0 {
@@ -49,6 +50,7 @@ func expandGlobalRoleBinding(in *schema.ResourceData) *managementClient.GlobalRo
4950

5051
obj.GlobalRoleID = in.Get("global_role_id").(string)
5152
obj.UserID = in.Get("user_id").(string)
53+
obj.UserPrincipalID = in.Get("user_principal_id").(string)
5254
obj.Name = in.Get("name").(string)
5355

5456
if v, ok := in.Get("group_principal_id").(string); ok && len(v) > 0 {

0 commit comments

Comments
 (0)