redhat-developer / kam

GitOps Application Manager: An opinionated CLI that generates the Kubernetes resources for managing your Tekton-based CI manifests, ArgoCD-based CD manifests and Application manifests in Git.
Apache License 2.0
145 stars 83 forks source link

Adding kubectl binary in openshift CI test container #214

Closed varshab1210 closed 3 years ago

varshab1210 commented 3 years ago

What type of PR is this?

/kind enhancement

What does this PR do / why we need it:

To get the argocd admin password we need the kubectl command to execute command $ kubectl get secret argocd-cluster-cluster -n openshift-gitops -ojsonpath='{.data.admin\.password}' | base64 -d. So we need the kubectl binary available in openshift CI test container path.

Have you updated the necessary documentation?

Which issue(s) this PR fixes:

Fixes #?

N/A

How to test changes / Special notes to the reviewer:

In the CI test container kubectl binary should be downloaded to bin/ directory. For local verification you can execute the script install-kubectl.sh and check the kubectl binary should be downloaded to bin/ directory

amitkrout commented 3 years ago

To get the argocd admin password we need the kubectl command to execute command $ kubectl get secret argocd-cluster-cluster -n openshift-gitops -ojsonpath='{.data.admin.password}' | base64 -d. So we need the kubectl binary available in openshift CI test container path.

@varshab1210 Can you please try this scenario in the local feature file. For example

Scenario: Execute KAM bootstrap command with --output and --push-to-git=true flags
        When executing "kam bootstrap --service-repo-url $SERVICE_REPO_URL --gitops-repo-url $GITOPS_REPO_URL --git-host-access-token $GIT_ACCESS_TOKEN --push-to-git=true --output bootstrapresources" succeeds
        Then stderr should be empty
         When executing "oc apply -k bootstrapresources/config/argocd/" succeeds
         Then stderr should be empty
         And login "argocd-cluster-server"
varshab1210 commented 3 years ago

To get the argocd admin password we need the kubectl command to execute command $ kubectl get secret argocd-cluster-cluster -n openshift-gitops -ojsonpath='{.data.admin.password}' | base64 -d. So we need the kubectl binary available in openshift CI test container path.

@varshab1210 Can you please try this scenario in the local feature file. For example

Scenario: Execute KAM bootstrap command with --output and --push-to-git=true flags
        When executing "kam bootstrap --service-repo-url $SERVICE_REPO_URL --gitops-repo-url $GITOPS_REPO_URL --git-host-access-token $GIT_ACCESS_TOKEN --push-to-git=true --output bootstrapresources" succeeds
        Then stderr should be empty
         When executing "oc apply -k bootstrapresources/config/argocd/" succeeds
         Then stderr should be empty
         And login "argocd-cluster-server"

Sure, I will do it in a separate pr. Thanks @amitkrout for scenario step

amitkrout commented 3 years ago

Thanks @varshab1210 for addressing all review comments. /approve /lgtm

openshift-ci-robot commented 3 years ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: amitkrout

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/redhat-developer/kam/blob/master/OWNERS)~~ [amitkrout] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment