-
Notifications
You must be signed in to change notification settings - Fork 38
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 controller scaffold #104
Conversation
✅ Deploy Preview for preliminary-kurator canceled.
|
08923bb
to
071ea69
Compare
Makefile
Outdated
@@ -152,3 +153,23 @@ gen-crd: init-codegen ## Generate WebhookConfiguration, ClusterRole and CustomRe | |||
.PHONY: generate | |||
generate: init-codegen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations. | |||
hack/update-codegen.sh | |||
|
|||
.PHONY: install-crd | |||
install-crd: gen-crd ## Install CRDs into the K8s cluster specified in ~/.kube/config. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think we need this; we use helm to install all stuffs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok,it has been removed
Makefile
Outdated
install-crd: gen-crd ## Install CRDs into the K8s cluster specified in ~/.kube/config. | ||
$(KUSTOMIZE) build manifests/charts | kubectl apply -f - | ||
|
||
.PHONY: uninstall-crd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
Makefile
Outdated
$(KUSTOMIZE) build manifests/charts | kubectl delete --ignore-not-found=$(ignore-not-found) -f - | ||
|
||
.PHONY: run-controller | ||
run-controller: gen-crd generate fmt vet ## Run a controller from your host. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
Makefile
Outdated
go run ./cmd/controller/main.go | ||
|
||
.PHONY: fmt | ||
fmt: ## Run go fmt against code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why need this?
Makefile
Outdated
go fmt ./... | ||
|
||
.PHONY: vet | ||
vet: ## Run go vet against code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same with fmt
cmd/controller/main.go
Outdated
@@ -0,0 +1,121 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be part of cluster-operator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -71,7 +71,7 @@ type Machine struct { | |||
HostName string `json:"hostName,omitempty"` | |||
// PrivateIP is the private ip address of the machine: | |||
// +optional | |||
PrivateIP string `json:"publicIP,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
split to a single commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch
b308bcd
to
197a279
Compare
limitations under the License. | ||
*/ | ||
|
||
// code in the package copied from: https://github.com/kubernetes-sigs/cluster-api-provider-aws/blob/v1.5.1/main.go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
???
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...... my mistake
Signed-off-by: Xieql <xieqianglong@huawei.com>
fe2ee59
to
77653ec
Compare
@@ -71,7 +71,7 @@ type Machine struct { | |||
HostName string `json:"hostName,omitempty"` | |||
// PrivateIP is the private ip address of the machine: | |||
// +optional | |||
PrivateIP string `json:"publicIP,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch
@@ -0,0 +1,48 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CustomResources seems very general. how about customcluster.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
) | ||
|
||
// CustomClusterReconciler reconciles a CustomCluster object | ||
type CustomClusterReconciler struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/CustomClusterReconciler/CustomClusterController
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
Signed-off-by: Xieql <xieqianglong@huawei.com>
) | ||
|
||
// CustomMachineReconciler reconciles a CustomMachine object | ||
type CustomMachineReconciler struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/CustomMachineReconciler/CustomMachineController
I think we still lack the clusterrolem but can be in a follow up |
Signed-off-by: Xieql <xieqianglong@huawei.com>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hzxuzhonghu 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 |
What type of PR is this?
/kind feature
What this PR does / why we need it:
part #96
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?