Skip to content
This repository has been archived by the owner on Jul 30, 2021. It is now read-only.

Get repo into usable shape #62

Merged
merged 1 commit into from
Aug 2, 2019

Conversation

chuckha
Copy link
Contributor

@chuckha chuckha commented Aug 2, 2019

What this PR does / why we need it:
This PR gets the bootstrap provider into a working state (but not yet generating the cloud init code). Some docker work allows for

Special notes for your reviewer:

The majority of this change set is pulling in cluster-api YAML.

/cc @amy
/assign @detiber @ncdc
Release note:

NONE

@k8s-ci-robot k8s-ci-robot requested a review from amy August 2, 2019 13:42
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 2, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chuckha

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

@k8s-ci-robot k8s-ci-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 Aug 2, 2019
@chuckha
Copy link
Contributor Author

chuckha commented Aug 2, 2019

/assign @fabriziopandini

@ncdc
Copy link
Contributor

ncdc commented Aug 2, 2019

What process are you using to get the CAPI CRD yaml in here?

@chuckha
Copy link
Contributor Author

chuckha commented Aug 2, 2019

@ncdc that copies the entire project where this only needs the CRDs. I don't think we need a vendor directory in this project

@chuckha
Copy link
Contributor Author

chuckha commented Aug 2, 2019

my other argument is if we start importing cluster-api in all providers like this then why aren't we working in a mono-repo in the first place?

(honestly, i'm kind of a fan of the monorepo idea anyway!)

@chuckha chuckha force-pushed the capdctl2 branch 2 times, most recently from 683f97e to 5d4eb19 Compare August 2, 2019 13:58
Makefile Show resolved Hide resolved
config-capi/crds/kustomization.yaml Show resolved Hide resolved
config/default/manager_image_patch.yaml Outdated Show resolved Hide resolved
controllers/kubeadmconfig_controller.go Show resolved Hide resolved
// Find the owner reference
var machineRef *v1.OwnerReference
for _, ref := range config.OwnerReferences {
if ref.Kind == machineKind {
if fmt.Sprintf("%s, Kind=%s", ref.APIVersion, ref.Kind) == machineKind {
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove the .String() call from machineKind and you can do a normal == comparison.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm, refs don't have a GroupVersionKind though, what am I comparing machineKind with? Wouldn't I have to build it up from the Ref parts anyway?

Copy link
Contributor

Choose a reason for hiding this comment

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

My bad (I'll blame it on being sick 😄). I think you can use CAPI's util.HasOwner(config.OwnerReferences, v1alpha2.SchemeGroupVersion.String(), "Machine") instead of this loop. Will that do what you need?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that seems like a heavy function for this when I just want to compare two strings, does
ref.Kind == machineKind.Kind && ref.APIVersion == machineKind.Version look ok to you? It passes the tests.

The only reason i'm a little hesitant on that function is that it doesn't make the code easier to read whereas i know what's going on quickly comparing a ref and a version.

controllers/kubeadmconfig_controller.go Show resolved Hide resolved
controllers/kubeadmconfig_controller.go Show resolved Hide resolved
controllers/kubeadmconfig_controller.go Show resolved Hide resolved
controllers/kubeadmconfig_controller.go Show resolved Hide resolved
@@ -0,0 +1,3 @@
# rerun-process-wrapper

Forked from https://github.com/windmilleng/rerun-process-wrapper
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you reach out to them to see about a LICENSE for this code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, already done. I suggested Apache 2.0 but we'll see. tilt-dev/rerun-process-wrapper#3

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you pull in their license file? Maybe also include the git commit that you copied from?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

💯

Makefile Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
config/default/manager_image_patch.yaml Outdated Show resolved Hide resolved
// Find the owner reference
var machineRef *v1.OwnerReference
for _, ref := range config.OwnerReferences {
if ref.Kind == machineKind {
if fmt.Sprintf("%s, Kind=%s", ref.APIVersion, ref.Kind) == machineKind {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd almost rather see two separate comparisons than string munging to a single comparison.

@detiber
Copy link
Contributor

detiber commented Aug 2, 2019

lgtm, will leave tagging for @ncdc, though

@chuckha
Copy link
Contributor Author

chuckha commented Aug 2, 2019

Commits squashed. Ready for take off! 🚀

@ncdc
Copy link
Contributor

ncdc commented Aug 2, 2019

Just 1 thing re third_party license file

List of the changes:

* Ignore the manager-image-patch backup file
* Set up dockerfile to allow restarts in non-docker environments
* Always use GOPROXY to build
* Clean up hacked install controller-runtime-tools
* Update cluster-api kustomize config
* Clean up rbac
* Update tests

Signed-off-by: Chuck Ha <chuckh@vmware.com>
@chuckha
Copy link
Contributor Author

chuckha commented Aug 2, 2019

@ncdc ok, all set, commit added, full repo cloned with README as well.

@ncdc
Copy link
Contributor

ncdc commented Aug 2, 2019

Thank you!!!
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 2, 2019
@k8s-ci-robot k8s-ci-robot merged commit 6e1a248 into kubernetes-retired:master Aug 2, 2019
@chuckha chuckha deleted the capdctl2 branch August 2, 2019 19:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. 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.

5 participants