-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add odo pipelines comands which generate GitOps pipelines resources #3387
Add odo pipelines comands which generate GitOps pipelines resources #3387
Conversation
Co-authored-by: Ishita Sequelira <[email protected]>
Co-authored-by: Ishita Sequelira <[email protected]>
- Added functions and unit tests to generate eventlistener - Added functions and unit tests to generate route - Appended the generated eventlistener and route to outputs slice.
- Imported v1alpha1 using glide get --strip-vendor
- Used fmt.Sprintf() to replace the repo name in filter
Delete accidentally added binary
- Added functions and test cases to create 1) deploy-from-source-task 2) deploy-using-kubectl-task 3) github-status-task Co-Authored-By: Gagan Hegde <[email protected]>
Co-authored-by: gaganeggday <[email protected]>
Co-authored-by: Gagan Hegde <[email protected]>
- Removed stuttering function names in tasks,routes and eventlisteners package. - Objects in task_tests are replaced by functions to improve readability.
* added two flags github-token and quay-io-auth-json * made changes in the flag description quayIOAuthFileName * added logic to get the github token filename and auth.json file name * made the requested changes mentioned in the PR * made the requested changes mentioned in the PR and removed the unwanted comments * created 4 required-flags quay-username, github-token, dockerconfigjson,base-repository * Update test cases for creating opaque secret * made the required changes mentioned in the PR * added two flags github-token and quay-io-auth-json * Add functions to generate Tekton task objects - Added functions and test cases to create 1) deploy-from-source-task 2) deploy-using-kubectl-task 3) github-status-task Co-Authored-By: Gagan Hegde <[email protected]> * made changes in the flag description quayIOAuthFileName * added logic to get the github token filename and auth.json file name made the requested changes mentioned in the PR made the requested changes mentioned in the PR and removed the unwanted comments created 4 required-flags quay-username, github-token, dockerconfigjson,base-repository Update test cases for creating opaque secret made the required changes mentioned in the PR * Replace objects in task_tests with suitable assertive functions - Removed stuttering function names in tasks,routes and eventlisteners package. - Objects in task_tests are replaced by functions to improve readability. * Add secret name as parameter to Generate function * pass ServiceAccount as object to createRoleBinding * pass ServiceAccount as object to createRoleBinding * Rework the new code around the base branch. Explicitly marshal the yaml to os.Stdout for now. Co-Authored-By: ishitasequeira <[email protected]> * made the required changes mentioned in the PR * removed the functions which were not required from bootstrap.go * removed the unwanted test case from bootstrap.go * Added the test file < odo/pkg/pipelines/bootstrap_test.go> * Test case corrected and moved to < /pkg/odo/cli/pipelines/bootstrap_test.go> * made all the changes asked in PR * pass a signel struct to Bootstrap() Co-authored-by: Ishita Sequeira <[email protected]> Co-authored-by: Chetan Banavikalmutt <[email protected]> Co-authored-by: gaganeggday <[email protected]> Co-authored-by: Kevin McDermott <[email protected]>
This generates the names for the namespaces and provides them when generating the resources. Co-authored-by: William Tam <[email protected]>
* Add functions to generate buildah task - Added functions to generate buildah task object - Added test cases for the corresponding functions * Replaced steps object by steps assertive functions * Fix typo in tasks_tests file Co-authored-by: William Tam <[email protected]>
Hi DV!
In this case, |
@bigkevmcd I think that there is some misunderstanding on both sides. What might help is if you record a short end-to-end demo showcasing and explaining how |
@sbose78 What you are saying about |
Correct. This is not just associating a tekton pipeline with a component in the cluster, This does make it different from #1238 . |
Any reason for it being named |
Agreed with vincent and others, as a developer if I think about what to expect with "odo pipeline" i think about some default tasks associated to my project type (ie: python project => python unit test, flask, pep8 etc...) that get bootstraped to a pipeline for us, not necessary having a GitOps via pipeline env bootstraped.... PS: Cleaning up this PR, rebasing commits, separating deps in one commit, fixes in other commit and implementations in others would go a long way for reviewers to help them figure out what's going on with this PR... |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@wtam2018 , could we do the following to make the commits reviewable?
|
|
…tor (#135) Update glide to reference Triggers 0.5.0.
* renamed flags app-repo-url to service-repo-url and app-webhook-secret to service-webhook-secret * renamed the app and service name of the bootstrapped application and service
I don't really buy that 😝. I don't know if odo has a similar concept of TEP (Tekton Enhancement Proposal) or enhancements (like |
We actually have a similar process in place that we call Proposals. This work started in isolation from odo repository as a PoC, and then it went a little bit too far without creating Proposal and the result is this big PR. I definitely don't blame anyone here expect myself for not communicating this with gitops team sooner. |
Ah good to know 👍
Yeah, definitely not blaming anyone, just trying to see what we can do better in the future 😉 👼 |
@vdemeester Totally understand the concerns around naming ambiguity. We should address it ! @kadel I'm aware of the enhancement proposal process, we should absolutely put in one @bigkevmcd @wtam2018 @ishitasequeira @chetan-rns . As a background, we didn't start out thinking that we are going to have it all in We've iterated multiple times to find out the right solution to have tooling & guidance:
We eventually decided to have the outcome of the above experiments as an ( initially isolated ) command in Are we on the right path, we don't know! |
* Add new functionality to secrets to find the sealed-secrets controller. This allows configuration of the namespace for sealed-secrets to be provided on the command-line. This also simplifies the configuration of the options, and standardises the Init and Bootstrap via an embedded struct.
I'd love to organize commits into vendor/dep and new features changes but I am not sure it is possible with such a big rebase. However, the only real feature changes are added in two packages.
As far as vendor files updates, |
@wtam2018 Would be nice if all feature changes are collapsed into one commit. |
As scary as it may look, changes for the new features are in two packages:
|
|
* provide default (kube-system) for sealed-secret-ns flag * removed unintended/duplicated MarkFlagRequired()
* made gitops-webhook-secret flag optional * made sealed-secrets-ns flag optional and default to "kube-system"
@wtam2018: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
What type of PR is this?
/kind feature
Why
Summary
As a developer, after I'm happy trying out my code in inner-loop, I would want to manage deployments across multiple stages/environments from Git.
To do so, I would need tooling assitance to setup my environment and directories for Git-driven workflows in a standardized way.
As a developer ..
I want to be able to develop my application so that it can be CI/CD'ed by pipelines using the build/deploy guidance in devfile (devfile-awareness is not yet implemented).
I want to be able to review all Kubernetes resources with my team or organization before changes are applied to the cluster.
When no pipelines infrastructure currently exists, I want to be able to "bootstrap" my pipelines by generating basic CI/CD environment resources and my application deployment in that pipelines.
I do not need admin privileges to run pipelines commands. Administrators install all prerequisites on my cluster.
Prerequisites
Install the following as an admin :
Please follow guidance in https://github.com/rhd-gitops-example/docs/tree/master/journey/day1#prerequisites for installing these on an OpenShift cluster.
In the near future, we are considering having a single operator to configure your cluster with these.
How
odo pipelines
includes following sub-commands:odo pipelines init
This command sets up "Gitops'd" CI/CD environments for you. Note, it does not create your first application and other environments, unlike the boostrap command. It outputs resources yaml files, kustomization files, and Manifest to filesystem.
odo pipelines bootstrap
The following resources are written to the user's workspace in the local filesystem.
No changes are made to the cluster.
odo pipelines environment
This command creates a new environment in an existing GitOps setup.
It outputs resources yaml files, kustomization files, and updated Manifest to filesystem, without making any changes to the cluster.
odo pipelines service
This command adds a new service to an existing environment. Services are logically grouped by applications. This command will create an application for the new service if the target application does not exist. It outputs resources yaml files, kustomization files, and updates the Gitops manifest locally on the filesystem.
No changes are made to the cluster.
odo pipelines webhook
Webhook commands create/delete/list webhooks for the Gitops manage source code repository as well as the service source code repository.
More documentation can be found here.
https://github.com/rhd-gitops-example/docs/tree/master/commands#odo-pipelines-commands
The odo pipelines command is currently hidden under experimental mode.
Fixes #3383
Testing this end-to-end
Note, the above commands generate manifests but do not apply anything on the cluster. To setup the webhook on your cluster so that you Git webhooks can talk to the cluster, you could need to do a
In addition to Sealed Secrets, the following pre-reqs are required to set up for end-to-end testing:
Please follow guidance in https://github.com/rhd-gitops-example/docs/tree/master/journey/day1#prerequisites for installing these on an OpenShift cluster.