Skip to content

Commit

Permalink
feat(deployments) Linter fixes (#808)
Browse files Browse the repository at this point in the history
  • Loading branch information
gciezkowski-acc committed Jan 20, 2025
1 parent e119c0b commit 2ed8027
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/internal/local/setup/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const (
// modifies cert job (charts/manager/templates/kube-webhook-certgen.yaml) to include host.docker.internal
// if devMode is enabled, modifies mutating and validating webhook configurations to use host.docker.internal URL and removes service from clientConfig
// extracts the webhook certs from the secret and writes them to tmp/k8s-webhook-server/serving-certs directory
func (m *Manifest) setupWebhookManifest(resources []map[string]interface{}, clusterName string, resourceSuffix string) ([]map[string]interface{}, error) {
func (m *Manifest) setupWebhookManifest(resources []map[string]interface{}, clusterName, resourceSuffix string) ([]map[string]interface{}, error) {
webhookManifests := make([]map[string]interface{}, 0)
releaseName := m.ReleaseName
managerDeployment, err := extractResourceByNameKind(resources, releaseName+resourceSuffix, DeploymentKind)
Expand Down Expand Up @@ -324,7 +324,7 @@ func extractResourceByKind(resources []map[string]interface{}, kind string) map[
return nil
}

func (m *Manifest) waitUntilDeploymentReady(ctx context.Context, clusterName, namespace string, nameSuffix string) error {
func (m *Manifest) waitUntilDeploymentReady(ctx context.Context, clusterName, namespace, nameSuffix string) error {
deploymentName := m.ReleaseName + nameSuffix
cl, err := getKubeClient(clusterName)
if err != nil {
Expand All @@ -342,7 +342,7 @@ func (m *Manifest) waitUntilDeploymentReady(ctx context.Context, clusterName, na
return err
}
if deployment.Status.Conditions == nil {
return errors.New(fmt.Sprintf("deployment %s is not yet ready", deploymentName))
return fmt.Errorf("deployment %s is not yet ready", deploymentName)
}
available := false
for _, condition := range deployment.Status.Conditions {
Expand All @@ -352,7 +352,7 @@ func (m *Manifest) waitUntilDeploymentReady(ctx context.Context, clusterName, na
}
}
if !available {
return errors.New(fmt.Sprintf("deployment %s is not yet ready", deploymentName))
return fmt.Errorf("deployment %s is not yet ready", deploymentName)
}
return nil
}, b)
Expand Down

0 comments on commit 2ed8027

Please sign in to comment.