Skip to content

Commit 72736bf

Browse files
authored
Revert "🌱Add check to disallow hcloud servers without ssh key (#1413)" (#1465)
* Revert "🌱Add check to disallow hcloud servers without ssh key (#1413)" This reverts commit 9a170a2. We revert this, because some users want to provision clusters without ssh key. * ... removed test, too.
1 parent 96820fa commit 72736bf

File tree

2 files changed

+0
-30
lines changed

2 files changed

+0
-30
lines changed

‎controllers/hcloudmachine_controller_test.go

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -593,25 +593,6 @@ var _ = Describe("HCloudMachineReconciler", func() {
593593
}, timeout).Should(BeTrue())
594594
})
595595
})
596-
Context("should show error when ssh key empty", func() {
597-
BeforeEach(func() {
598-
hetznerCluster.Spec.SSHKeys.HCloud = nil
599-
hcloudMachine.Spec.SSHKeys = nil
600-
hetznerCluster.Spec.HetznerSecret.Key.SSHKey = ""
601-
Expect(testEnv.Create(ctx, hetznerCluster)).To(Succeed())
602-
Expect(testEnv.Create(ctx, hcloudMachine)).To(Succeed())
603-
})
604-
605-
AfterEach(func() {
606-
Expect(testEnv.Cleanup(ctx, hetznerCluster, hcloudMachine)).To(Succeed())
607-
})
608-
609-
It("should show the expected reason for server not created", func() {
610-
Eventually(func() bool {
611-
return isPresentAndFalseWithReason(key, hcloudMachine, infrav1.ServerCreateSucceededCondition, infrav1.SSHKeyNotFoundReason)
612-
}, timeout).Should(BeTrue())
613-
})
614-
})
615596

616597
Context("with public network specs", func() {
617598
var hcloudClient hcloudclient.Client

‎pkg/services/hcloud/server/server.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -431,17 +431,6 @@ func (s *Service) createServer(ctx context.Context) (*hcloud.Server, error) {
431431
}
432432
}
433433

434-
if len(sshKeySpecs) == 0 {
435-
conditions.MarkFalse(
436-
s.scope.HCloudMachine,
437-
infrav1.ServerCreateSucceededCondition,
438-
infrav1.SSHKeyNotFoundReason,
439-
clusterv1.ConditionSeverityError,
440-
"No SSH key configured for the server. Please add an SSH key",
441-
)
442-
return nil, errServerCreateNotPossible
443-
}
444-
445434
// get all ssh keys that are stored in HCloud API
446435
sshKeysAPI, err := s.scope.HCloudClient.ListSSHKeys(ctx, hcloud.SSHKeyListOpts{})
447436
if err != nil {

0 commit comments

Comments
 (0)