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

crossplane: fix the controller template for attribute-based APIs #31

Merged
merged 1 commit into from
Jun 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions templates/crossplane/pkg/controller.go.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -180,22 +180,30 @@ func newExternal(kube client.Client, client svcsdkapi.{{ .SDKAPIInterfaceTypeNam
e := &external{
kube: kube,
client: client,
{{- if or .CRD.Ops.ReadOne .CRD.Ops.GetAttributes .CRD.Ops.ReadMany }}
{{- if .CRD.Ops.ReadOne }}
preObserve: nopPreObserve,
postObserve: nopPostObserve,
lateInitialize: nopLateInitialize,
isUpToDate: alwaysUpToDate,
{{- else if .CRD.Ops.GetAttributes }}
preObserve: nopPreObserve,
postObserve: nopPostObserve,
lateInitialize: nopLateInitialize,
isUpToDate: alwaysUpToDate,
{{- else if .CRD.Ops.ReadMany }}
preObserve: nopPreObserve,
postObserve: nopPostObserve,
lateInitialize: nopLateInitialize,
isUpToDate: alwaysUpToDate,
filterList: nopFilterList,
{{- else }}
observe: nopObserve,
{{- end }}
{{- if and .CRD.Ops.ReadMany (not .CRD.Ops.ReadOne) }}
filterList: nopFilterList,
{{- end}}
preCreate: nopPreCreate,
postCreate: nopPostCreate,
{{- if .CRD.Ops.Delete }}
preDelete: nopPreDelete,
postDelete: nopPostDelete,
postDelete: nopPostDelete,
{{- else }}
delete: nopDelete,
{{- end }}
Expand Down