Skip to content

Commit

Permalink
Blocking project wide ssh keys while creating machine class (#506)
Browse files Browse the repository at this point in the history
* hardcoded blocking project wide ssh keys while creating machine class

* updating machine class in worker tests
  • Loading branch information
rishabh-11 authored Oct 17, 2022
1 parent 3db08ee commit debd61e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
3 changes: 3 additions & 0 deletions charts/internal/machineclass/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ machineClasses:
# count: 1
labels:
name: mcm
metadata:
- key: "block-project-ssh-keys"
value: "TRUE"
machineType: n1-standard-4
nodeTemplate:
capacity:
Expand Down
9 changes: 8 additions & 1 deletion pkg/controller/worker/machines.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,14 @@ func (w *workerDelegate) generateMachineConfig(_ context.Context) error {
"description": fmt.Sprintf("Machine of Shoot %s created by machine-controller-manager.", w.worker.Name),
"disks": disks,
"labels": gceInstanceLabels,
"machineType": pool.MachineType,
// TODO: make this configurable for the user
"metadata": []map[string]string{
{
"key": "block-project-ssh-keys",
"value": "TRUE",
},
},
"machineType": pool.MachineType,
"networkInterfaces": []map[string]interface{}{
{
"subnetwork": nodesSubnet.Name,
Expand Down
8 changes: 7 additions & 1 deletion pkg/controller/worker/machines_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,13 @@ var _ = Describe("Machines", func() {
},
},
},
"labels": gceInstanceLabels,
"labels": gceInstanceLabels,
"metadata": []map[string]string{
{
"key": "block-project-ssh-keys",
"value": "TRUE",
},
},
"machineType": machineType,
"networkInterfaces": []map[string]interface{}{
{
Expand Down

0 comments on commit debd61e

Please sign in to comment.