Update group versions in genprotobuf
@@ -22,21 +22,25 @@ func init() {
filepath.Join("vendor", "k8s.io", "kubernetes", "third_party", "protobuf"),
}
g.OutputBase = sourceTree
- g.Packages = strings.Join([]string{
- `-k8s.io/kubernetes/pkg/util/intstr`,
- `-k8s.io/kubernetes/pkg/api/resource`,
- `-k8s.io/kubernetes/pkg/runtime`,
- `-k8s.io/kubernetes/pkg/watch/versioned`,
- `-k8s.io/kubernetes/pkg/api/unversioned`,
- `-k8s.io/kubernetes/pkg/api/v1`,
- `-k8s.io/kubernetes/pkg/apis/policy/v1alpha1`,
- `-k8s.io/kubernetes/pkg/apis/extensions/v1beta1`,
- `-k8s.io/kubernetes/pkg/apis/autoscaling/v1`,
- `-k8s.io/kubernetes/pkg/apis/batch/v1`,
- `-k8s.io/kubernetes/pkg/apis/batch/v2alpha1`,
- `-k8s.io/kubernetes/pkg/apis/apps/v1alpha1`,
- `-k8s.io/kubernetes/federation/apis/federation/v1beta1`,
+ var fullPackageList []string
+
+ if len(g.Packages) > 0 {
+ // start with the predefined package list from kube's command
+ kubePackages := strings.Split(g.Packages, ",")
+ fullPackageList = make([]string, 0, len(kubePackages))
+ for _, kubePackage := range kubePackages {
+ // strip off the leading + if it exists because we want all kube packages to be prefixed with -
+ // so they're not generated
+ if strings.HasPrefix(kubePackage, "+") {
+ kubePackage = kubePackage[1:]
+ }
+ fullPackageList = append(fullPackageList, "-"+kubePackage)
+ }
+ }
+
+ // add the origin packages
+ fullPackageList = append(fullPackageList,
`github.com/openshift/origin/pkg/authorization/api/v1`,
`github.com/openshift/origin/pkg/build/api/v1`,
`github.com/openshift/origin/pkg/deploy/api/v1`,
@@ -49,7 +53,8 @@ func init() {
`github.com/openshift/origin/pkg/security/api/v1`,
`github.com/openshift/origin/pkg/template/api/v1`,
`github.com/openshift/origin/pkg/user/api/v1`,
- }, ",")
+ )
+ g.Packages = strings.Join(fullPackageList, ",")
g.BindFlags(flag.CommandLine)
}
