harness / harness/harness-cli

"harness-apply" command asks for user input with values already present on YAML.

Open
#31 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Go
Stars
25
Forks
25
PR merge metrics
No merged PRs in 30d

Description

Summary

harness Cli is asking for text input for the delegate-name for creating kubernetes connector as show below, even when the delegateSelectors: had delegate name mentioned

Trying to create or update connector using the yaml= harnesscd-example-apps/guestbook/harnesscd-pipeline/kubernetes-connector.yml
? Enter valid delegate name: delegate-deba-demo

Environment

Harness Cli Version: v0.0.10-alpha
OS: Mac M1 Pro

Steps To Reproduce

  1. Use the connector YAML with pre-filled delegate name under delegateSelectors: as follows:
connector:
  name: harness_k8sconnecto
  identifier: harnessk8sconnecto
  description: ""
  orgIdentifier: default
  projectIdentifier: communityeng
  type: K8sCluster
  spec:
    credential:
      type: InheritFromDelegate
    delegateSelectors:
      - Delegate_Name

  1. Use apply command to create the connector as follows:
harness connector --file <file-path of the connector yaml> apply

Expected Results

deba@Debabrata Panigrahi harness-cli %  harness connector --file harnesscd-example-apps/guestbook/harnesscd-pipeline/kubernetes-connector.yml apply     
Trying to create or update connector using the yaml= harnesscd-example-apps/guestbook/harnesscd-pipeline/kubernetes-connector.yml
ERRO[2023-07-25T15:27:35+05:30] Connector with identifier [harnessk8sconnecto] not found in project [communityeng] and org [default]. 
Creating connector with id:  harnessk8sconnecto
Successfully created connector with id= harnessk8sconnecto

Actual Results

deba@Debabrata Panigrahi harness-cli %  harness connector --file harnesscd-example-apps/guestbook/harnesscd-pipeline/kubernetes-connector.yml apply                         
Trying to create or update connector using the yaml= harnesscd-example-apps/guestbook/harnesscd-pipeline/kubernetes-connector.yml
? Enter valid delegate name: delegate-deba-demo
ERRO[2023-07-25T15:27:35+05:30] Connector with identifier [harnessk8sconnecto] not found in project [communityeng] and org [default]. 
Creating connector with id:  harnessk8sconnecto
Successfully created connector with id= harnessk8sconnecto

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the harness connector --file ... apply command and the connector YAML at harnesscd-example-apps/guestbook/harnesscd-pipeline/kubernetes-connector.yml. Reproduce the prompt with delegateSelectors already populated, then trace how the apply path reads that value. Done means the command creates or updates the connector without asking for the delegate name when the YAML already provides it.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.