Skip to content

Commit

Permalink
Increase mh and clean code (kubernetes-sigs#274)
Browse files Browse the repository at this point in the history
  • Loading branch information
kahun authored Sep 8, 2023
1 parent 708cab8 commit 4b98549
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions pkg/cluster/internal/create/actions/createworker/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ func (p *Provider) getAllowCAPXEgressIMDSGNetPol() (string, error) {
func deployClusterOperator(n nodes.Node, keosCluster commons.KeosCluster, clusterCredentials commons.ClusterCredentials, keosRegistry keosRegistry, kubeconfigPath string) error {
var c string
var err error
var jsonDockerRegistriesCredentials []byte
var helmRepository helmRepository

if kubeconfigPath == "" {
Expand All @@ -252,13 +251,6 @@ func deployClusterOperator(n nodes.Node, keosCluster commons.KeosCluster, cluste
if err != nil {
return errors.Wrap(err, "failed to write the keoscluster file")
}
// Prepare docker registries credentials
if clusterCredentials.DockerRegistriesCredentials != nil {
jsonDockerRegistriesCredentials, err = json.Marshal(clusterCredentials.DockerRegistriesCredentials)
if err != nil {
return errors.Wrap(err, "failed to marshal docker registries credentials")
}
}
// Add helm repository
helmRepository.url = keosCluster.Spec.HelmRepository.URL
if keosCluster.Spec.HelmRepository.AuthRequired {
Expand Down Expand Up @@ -288,7 +280,7 @@ func deployClusterOperator(n nodes.Node, keosCluster commons.KeosCluster, cluste

// Create the docker registries credentials secret for keoscluster-controller-manager
if clusterCredentials.DockerRegistriesCredentials != nil {
jsonDockerRegistriesCredentials, err = json.Marshal(clusterCredentials.DockerRegistriesCredentials)
jsonDockerRegistriesCredentials, err := json.Marshal(clusterCredentials.DockerRegistriesCredentials)
if err != nil {
return errors.Wrap(err, "failed to marshal docker registries credentials")
}
Expand Down Expand Up @@ -570,10 +562,10 @@ spec:
unhealthyConditions:
- type: Ready
status: Unknown
timeout: 60s
timeout: 180s
- type: Ready
status: 'False'
timeout: 60s`
timeout: 180s`

c = "echo \"" + machineHealthCheck + "\" > " + manifestPath
_, err = commons.ExecuteCommand(n, c)
Expand Down

0 comments on commit 4b98549

Please sign in to comment.