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

Add cert-manager extension support #2930

Merged
merged 1 commit into from Jun 8, 2021
Merged

Conversation

matthyx
Copy link
Contributor

@matthyx matthyx commented Mar 18, 2021

Description

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change
  • Chore (non-breaking change which doesn't affect codebase;
    test, version modification, documentation, etc.)

Checklist

  • Code contributed by me aligns with current project license: Apache 2.0
  • I Added CHANGELOG entry regarding this change
  • I have implemented unit tests to cover my changes
  • I have added/updated the javadocs and other documentation accordingly
  • No new bugs, code smells, etc. in SonarCloud report
  • I tested my code in Kubernetes
  • I tested my code in OpenShift

@centos-ci
Copy link

Can one of the admins verify this patch?

@matthyx
Copy link
Contributor Author

matthyx commented Mar 18, 2021

relates to #2565

@matthyx
Copy link
Contributor Author

matthyx commented Mar 18, 2021

@rohanKanojia here is where I am now:

  • go generator works
  • I have java files inside extensions/certmanager/model/target/generated-sources
  • unfortunately nothing ends up in any of the src folders

What am I doing wrong?

@rohanKanojia
Copy link
Member

let me try to clone your branch and check later tonight

@matthyx
Copy link
Contributor Author

matthyx commented Mar 18, 2021

let me try to clone your branch and check later tonight

sure, no rush... I am not the best Maven specialist, so it's probably down to my limited understanding of the whole mechanism.

@rohanKanojia rohanKanojia force-pushed the cert-manager branch 2 times, most recently from ddc33f2 to d35e958 Compare March 18, 2021 18:59
@matthyx
Copy link
Contributor Author

matthyx commented Mar 18, 2021

Wow, diff is epic and too much to check on the phone... I'll see later with the laptop while catching up on Netflix with my wife ;-)

@matthyx
Copy link
Contributor Author

matthyx commented Mar 18, 2021

So basically you started from an older version of master, still 5.2?
The change that was needed for the java files to appear was to delete an ant task, or did you copy by hand?

Copy link
Contributor Author

@matthyx matthyx left a comment

Choose a reason for hiding this comment

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

thanks for fixing my branch @rohanKanojia I just commented few places to understand the process
should I rebase on 5.3-SNAPSHOT?

reflect.TypeOf(v1.Time{}): "java.lang.String",
reflect.TypeOf(metav1.ObjectReference{}): "java.lang.String",
reflect.TypeOf(metav1.SecretKeySelector{}): "java.lang.String",
reflect.TypeOf(apiextensions.JSON{}): "com.fasterxml.jackson.databind.JsonNode",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not sure gofmt is happy with that...

// no other types need to be defined as they are auto discovered
crdLists := map[reflect.Type]schemagen.CrdScope{
reflect.TypeOf(certmanager.CertificateList{}): schemagen.Namespaced,
reflect.TypeOf(certmanager.CertificateRequestList{}): schemagen.Namespaced,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

how do you know which types to add? gut feeling?

Copy link
Member

Choose a reason for hiding this comment

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

I checked their provided CRDs: https://github.com/jetstack/cert-manager/tree/master/deploy/crds and added whatever I could

@rohanKanojia
Copy link
Member

I tested building project on jdk11 before pushing to your branch. Quite strange it's failing on jdk8 due to some files getting generated twice. Let me add antrun tasks to delete duplicates.

@rohanKanojia
Copy link
Member

So basically you started from an older version of master, still 5.2?
The change that was needed for the java files to appear was to delete an ant task, or did you copy by hand?

Umm, I think I did rebase your branch with master. I remember I replaced 5.2-SNAPSHOT with 5.3-SNAPSHOT. I had to copy ACMEChallengeSolverHTTP01Ingress to src/ since it has a field name Class which was causing build failures during sundrio generation

@matthyx
Copy link
Contributor Author

matthyx commented Mar 18, 2021

So basically you started from an older version of master, still 5.2?
The change that was needed for the java files to appear was to delete an ant task, or did you copy by hand?

Umm, I think I did rebase your branch with master. I remember I replaced 5.2-SNAPSHOT with 5.3-SNAPSHOT. I had to copy ACMEChallengeSolverHTTP01Ingress to src/ since it has a field name Class which was causing build failures during sundrio generation

thanks for the explanation, everyday learning!

@rohanKanojia rohanKanojia changed the title WIP add cert-manager support WIP add cert-manager extension support Mar 18, 2021
@rohanKanojia
Copy link
Member

rohanKanojia commented Mar 18, 2021

Bdw, cert-manager seems to have models for v1, v1alpha2, v1alpha3, v1beta1 . Shall we add those models too(right now we only have v1)? Do you know if cert-manager recently graduated it's api to v1 and whether it's going to stay there for long term?

@matthyx
Copy link
Contributor Author

matthyx commented Mar 18, 2021

Bdw, cert-manager seems to have models for v1, v1alpha2, v1alpha3, v1beta1 . Shall we add those models too(right now we only have v1)? Do you know if cert-manager recently graduated it's api to v1 and whether it's going to stay there for long term?

I have no idea... but I never saw anything else than v1 in the examples. I'll keep looking and worse case I ask them.

@matthyx
Copy link
Contributor Author

matthyx commented Mar 18, 2021

So, @munnerz replied on slack that v1 is supported since cert-manager 1.0.0 (released sept 2020) but older ones are still considered "valid".
If we want to help people on older installs (OpenShift 3.11 anyone?) we should support all of them...

Now that I see how you did it, I can work on that tomorrow if you want :-)

@matthyx
Copy link
Contributor Author

matthyx commented Mar 19, 2021

@rohanKanojia I don't know about the CI errors here, but I think it only remains to add some examples and tests...

@matthyx matthyx force-pushed the cert-manager branch 2 times, most recently from af24f83 to 0fa0504 Compare March 22, 2021 15:16
@matthyx
Copy link
Contributor Author

matthyx commented Mar 25, 2021

@rohanKanojia I need your help here... impossible to understand how the generated sources are supposed to move from target/ to somewhere in src/
I think I have all good regarding the generators, but somehow missing some parts on the Maven side. Do you have some time to help me on that, please?

@rohanKanojia
Copy link
Member

@matthyx : Sorry for the late reply. I don't think you need to worry about moving sources from target/ to src/ folder. In Kubernetes Model, most of our sources are being generated at compile time and they are not persisted into version control.

@rohanKanojia rohanKanojia removed the wip label Apr 5, 2021
@rohanKanojia
Copy link
Member

@matthyx : Hi, Are you still working on this? If you think it's ready could you please remove WIP from the PR title? I can request people for review then

@matthyx
Copy link
Contributor Author

matthyx commented Apr 16, 2021

Hi Rohan, sorry it's not ready. I will work on this next week I promise :-)

@rohanKanojia
Copy link
Member

rohanKanojia commented Apr 16, 2021

No worries, no need to rush. Take your time. I just wanted to check this PR's status

@vsevel
Copy link

vsevel commented Apr 30, 2021

good job @matthyx

@matthyx
Copy link
Contributor Author

matthyx commented May 25, 2021

@manusa do you know for which release this is planned, please?

@manusa
Copy link
Member

manusa commented May 25, 2021

@manusa do you know for which release this is planned, please?

Next minor release should be fine.

I tried to rebase your changes, but it required some additional work. I'm not sure if you can take care of this. If not, I'll try to do that next week.

@matthyx
Copy link
Contributor Author

matthyx commented May 25, 2021

I tried to rebase your changes, but it required some additional work. I'm not sure if you can take care of this. If not, I'll try to do that next week.

Let me have a try...

@irbekrm
Copy link

irbekrm commented Jun 7, 2021

Bdw, cert-manager seems to have models for v1, v1alpha2, v1alpha3, v1beta1 . Shall we add those models too(right now we only have v1)? Do you know if cert-manager recently graduated it's api to v1 and whether it's going to stay there for long term?

Hi folks 👋🏼 A drive-by comment that might or might not be relevant for you- the alpha and beta APIs are getting deprecated in the next release of cert-manager (v1.4) and will be removed in v1.6 cert-manager#4021](cert-manager/cert-manager#4021). (Also the v1 API is considered stable and long-term).

@matthyx
Copy link
Contributor Author

matthyx commented Jun 7, 2021

awesome, maybe it will help me make my tests pass :-)

@manusa I am still failing to fix them, as for some reason my IntelliJ fails to compile the current project at master

@manusa
Copy link
Member

manusa commented Jun 7, 2021

@manusa I am still failing to fix them, as for some reason my IntelliJ fails to compile the current project at master

Could you provide more details about you failure?
Have you tried delegating the IntelliJ build to Maven?

@matthyx
Copy link
Contributor Author

matthyx commented Jun 7, 2021

again those dreadful:

java: java.lang.NoClassDefFoundError: io/fabric8/kubernetes/client/extended/run/RunConfig
io.fabric8.kubernetes.client.extended.run.RunConfig

@manusa
Copy link
Member

manusa commented Jun 7, 2021

What about the Maven build delegation?
image

@matthyx
Copy link
Contributor Author

matthyx commented Jun 7, 2021

What about the Maven build delegation?
image

Thanks, trying... (I swear I didn't need it in the past)

@matthyx
Copy link
Contributor Author

matthyx commented Jun 7, 2021

@manusa could you check why the Karaf test failed? I swear I didn't touch it!

@sonarcloud
Copy link

sonarcloud bot commented Jun 7, 2021

@manusa
Copy link
Member

manusa commented Jun 7, 2021

@manusa could you check why the Karaf test failed? I swear I didn't touch it!

Those are flaky. We'll need to look into them, but for some reason there are timeouts when starting the platform.

@matthyx
Copy link
Contributor Author

matthyx commented Jun 7, 2021

@manusa could you check why the Karaf test failed? I swear I didn't touch it!

Those are flaky. We'll need to look into them, but for some reason there are timeouts when starting the platform.

So I think we should merge this PR quickly until we need another headache rebase...

Copy link
Member

@manusa manusa left a comment

Choose a reason for hiding this comment

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

LGTM, thx!

@manusa manusa merged commit f64554c into fabric8io:master Jun 8, 2021
@matthyx matthyx deleted the cert-manager branch June 8, 2021 05:09
@manusa manusa added this to the 5.5.0 milestone Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants