krisnova / naml

Convert Kubernetes YAML to Golang
Apache License 2.0
1.26k stars 38 forks source link

types.UID #57

Closed krisnova closed 2 years ago

krisnova commented 2 years ago

duffie was able to generate some code with undefined types

fkautz commented 2 years ago

I just did a poc with valast to get it to dynamically generate a map of imports when generating the AST. I integrated the poc with naml, and got this out of it:

map[:true
    github.com/hexops/valast:true
    k8s.io/api/apps/v1:true
    k8s.io/api/core/v1:true
    k8s.io/apimachinery/pkg/apis/meta/v1:true
    k8s.io/apimachinery/pkg/types:true
    k8s.io/apimachinery/pkg/util/intstr:true]

I can try to upstream the changes, or set up a fork if they don't accept them.

Would you be interested in this as a path to deal with imports?

fkautz commented 2 years ago

More specifically, I'm happy to do the work to wire it up. :)

krisnova commented 2 years ago

yes please! if you PR this i will merge it

fkautz commented 2 years ago

Expect a patch tonight.

fkautz commented 2 years ago

This should be resolved when #59 is merged.