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

code-gen: provide types and generator scripts #1

Merged
merged 6 commits into from
Aug 31, 2023

Conversation

maiqueb
Copy link
Collaborator

@maiqueb maiqueb commented Aug 25, 2023

Also provide a minimal github workflow to build the code.

At this stage, what I'm most looking for is:

  • do we need the status sub-resource ?
  • what do we want to name the CRD ?... PersistentIP / PersistentIPs / PersistentIPAMAllocation / IPAMAllocation w/ a persistent flag ? ....

@maiqueb maiqueb force-pushed the add-crd-clients-listers-informers branch 14 times, most recently from fc09fdf to a5b62a2 Compare August 28, 2023 12:01
@@ -0,0 +1,55 @@
module github.com/maiqueb/persistentips
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

my plan is to keep this in a personal repo, then "donate" the CRD to the k8snetworkplumbingwg.

Plus push an update proposal to the kubernetes multi network de-facto standard.

@maiqueb
Copy link
Collaborator Author

maiqueb commented Aug 28, 2023

/cc @oshoval @qinqon @phoracek

Copy link
Member

@qinqon qinqon left a comment

Choose a reason for hiding this comment

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

Nit on singular vs plural name

pkg/crd/persistentip/v1alpha1/types.go Outdated Show resolved Hide resolved
pkg/crd/persistentip/v1alpha1/types.go Outdated Show resolved Hide resolved
@maiqueb maiqueb added the WaitingReview Waiting review label Aug 28, 2023
@oshoval
Copy link
Member

oshoval commented Aug 29, 2023

Can you amend please the commits with the commands used to generate stuff ?
it might be as easy as running the relevant script or some tool i guess,
but it can help for future ref if someone need to do the same
Thanks

@maiqueb maiqueb force-pushed the add-crd-clients-listers-informers branch 3 times, most recently from 86750e0 to 59900fd Compare August 30, 2023 14:58
@maiqueb maiqueb requested a review from qinqon August 30, 2023 15:01
pkg/crd/persistentip/v1alpha1/types.go Outdated Show resolved Hide resolved
pkg/crd/persistentip/v1alpha1/types.go Outdated Show resolved Hide resolved
@maiqueb maiqueb force-pushed the add-crd-clients-listers-informers branch from 59900fd to 4dea445 Compare August 31, 2023 07:56
@maiqueb maiqueb requested review from qinqon and phoracek August 31, 2023 09:30
@maiqueb maiqueb force-pushed the add-crd-clients-listers-informers branch from 4dea445 to 7f98396 Compare August 31, 2023 10:49
Also provide a minimal github workflow to build the code.

Signed-off-by: Miguel Duarte Barroso <[email protected]>
To run the code generators, the user should execute the
`hack/update-codegen.sh` script.

The generated code will be located in
`pkg/crd/persistentip/v1alpha1/github.com`.

Then, it must be copied to the correct place:
```
cp -r \
  pkg/crd/persistentip/v1alpha1/github.com/maiqueb/persistentips/pkg/crd/persistentip/v1alpha1/apis/* \
  pkg/crd/persistentip/v1alpha1/
```

Signed-off-by: Miguel Duarte Barroso <[email protected]>
Keeping the vendor commit isolated helps during code review, since there
are a lot less files - meaning the github web UI will have less to
render. Please review commit by commit.

Signed-off-by: Miguel Duarte Barroso <[email protected]>
The binary should be compiled using the following command:
```
go build -o _out/persistentips_dummy_client cmd/example/main.go
```

Then executed via:
```
_out/persistentips_dummy_client --kubeconfig ~/.kube/config
```

Signed-off-by: Miguel Duarte Barroso <[email protected]>
Signed-off-by: Miguel Duarte Barroso <[email protected]>
@maiqueb maiqueb force-pushed the add-crd-clients-listers-informers branch from 7f98396 to 5b2946c Compare August 31, 2023 11:11
@maiqueb maiqueb merged commit d744077 into main Aug 31, 2023
@maiqueb maiqueb deleted the add-crd-clients-listers-informers branch August 31, 2023 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WaitingReview Waiting review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants