Skip to content
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

Create a skeleton controller #18

Merged
merged 1 commit into from
Jul 18, 2019
Merged

Conversation

ncskier
Copy link
Member

@ncskier ncskier commented Jul 8, 2019

Changes

Create the skeleton controller described in issue #8.

  • Add skeleton reconciler files for the eventlistener, triggertemplate, and triggerbinding
  • Add config files for the controller to get a deployment going with ko apply -f config/.
  • Add an e2e test with ko apply -f config/
  • Add the hack/update-deps.sh script and a ton of vendor/ dependencies

#### WIP:

  • I ran into some issues with dep, discussed on Slack here. The code in this PR builds correctly right now, but I would like to get some feedback about this issue.
    I've added extra constraints to the Gopkg.toml file to solve this issue.
  • There is placeholder code commented out right now that depends on the generated clientset & informer code that is being added under PR Create new types and add initial generated code #17.
    The PR has been merged, and I created a reconciler for the EventListener.
  • The triggers controller Deployment uses the tekton-pipelines-controller ServiceAccount. Under issue Make instructions in DEVELOPMENT guide work #7, this can be changed to a triggers ServiceAccount if we do not want to depend on pipelines being installed.
    With PR Add config yaml files #23 we use our own triggers Service Account.

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide for more details.

@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ncskier

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:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jul 8, 2019
@ncskier ncskier force-pushed the issue8 branch 2 times, most recently from c027e54 to c4dd758 Compare July 10, 2019 14:01
@ncskier ncskier marked this pull request as ready for review July 10, 2019 14:11
@vdemeester
Copy link
Member

@ncskier might be worth exploring injection-based controllers (see tektoncd/pipeline#1015 as a reference)

@bobcatfish
Copy link
Collaborator

might as well switch to the injection based controller right at the outset if we can! (sorry @ncskier 😅 )

@ncskier
Copy link
Member Author

ncskier commented Jul 10, 2019

I'll take a look 😅

Copy link
Collaborator

@bobcatfish bobcatfish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looking good to me! +1 to what @vdemeester said about using the injection based controller tho if we can (might as well start off on the right foot)
(thanks @vdemeester !!)

config/controller-service.yaml Show resolved Hide resolved
pkg/reconciler/reconciler.go Show resolved Hide resolved
test/e2e-tests.sh Outdated Show resolved Hide resolved
@bobcatfish bobcatfish mentioned this pull request Jul 10, 2019
3 tasks
@ncskier ncskier mentioned this pull request Jul 15, 2019
3 tasks
@ncskier ncskier force-pushed the issue8 branch 8 times, most recently from 325cc3c to 459f938 Compare July 16, 2019 20:42
@ncskier
Copy link
Member Author

ncskier commented Jul 16, 2019

@bobcatfish @vdemeester I've updated the controller to use the knative/pkg injection infrastructure. Please take another look at reviewing this PR when you get the chance 🙂

I only added a reconciler for the EventListener at the moment, because I'm not sure if we'll need reconcilers for the other types (and if we need a reconciler we can easily add one); let me know if you have an opinion about this.

I also changed the bash scripts to use tektoncd/plumbing instead of test-infra.

@ncskier ncskier force-pushed the issue8 branch 2 times, most recently from 931e2fd to 6adc2ee Compare July 17, 2019 13:30
Copy link
Collaborator

@bobcatfish bobcatfish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call catching that test-infra vs. plumbing change! I never would have caught that haha XD

I put in a couple questions but nothing that should stop this from getting merged imo!

Thanks @ncskier :D

/lgtm
/meow space

- pkg/client/clientset/versioned/fake
linters-settings:
errcheck:
exclude: .errcheck.txt
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ooo what's this file for? ive never seen this before! :D

(question about both the .golangci.yaml and the .errcheck.txt!)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the config file for our linter golangci-lint (more info here). .errcheck.txt lists files to exclude from testing. However, I don't think we need .errcheck.txt anymore, because the linter error we were skipping was fixed the correct way in @vincent-pli's webhook PR 😅

I'm going to remove the .errcheck.txt file in a PR that I'm putting together, because I don't think we need it anymore.

name: config-logging-triggers
namespace: tekton-pipelines
data:
# Common configuration for all knative codebase
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment out of date haha


# Log level overrides
loglevel.controller: "info"
loglevel.webhook: "info"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like the level is already at "info", i wonder why these are explicitly also setting info 🤔

apiVersion: v1
kind: ConfigMap
metadata:
name: config-observability
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting, is this configuring functionality we get out of the box with knative/pkg?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so... @vdemeester do you know about the config-observability functionality? 😄

config/controller-service.yaml Show resolved Hide resolved
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

# Copyright 2018 The Knative Authors
# Copyright 2019 The Tekton Authors
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hee hee

@tekton-robot
Copy link

@bobcatfish: cat image

In response to this:

Good call catching that test-infra vs. plumbing change! I never would have caught that haha XD

I put in a couple questions but nothing that should stop this from getting merged imo!

Thanks @ncskier :D

/lgtm
/meow space

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.

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 18, 2019
@tekton-robot tekton-robot merged commit ee491da into tektoncd:master Jul 18, 2019
@ncskier ncskier deleted the issue8 branch July 22, 2019 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants