Do not hard code API version

Signed-off-by: Monis Khan <mok@vmware.com>
This commit is contained in:
Monis Khan 2020-07-18 23:57:00 -04:00
parent 9118869d04
commit 5fa5b9a9a9
No known key found for this signature in database
GPG Key ID: 52C90ADA01B269B8

View File

@ -31,7 +31,7 @@ import (
apiregistrationv1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1" apiregistrationv1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1"
aggregationv1client "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset" aggregationv1client "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset"
"github.com/suzerain-io/placeholder-name-api/pkg/apis/placeholder" placeholderv1alpha1 "github.com/suzerain-io/placeholder-name-api/pkg/apis/placeholder/v1alpha1"
"github.com/suzerain-io/placeholder-name/internal/autoregistration" "github.com/suzerain-io/placeholder-name/internal/autoregistration"
"github.com/suzerain-io/placeholder-name/internal/certauthority" "github.com/suzerain-io/placeholder-name/internal/certauthority"
"github.com/suzerain-io/placeholder-name/internal/downward" "github.com/suzerain-io/placeholder-name/internal/downward"
@ -182,11 +182,11 @@ func (a *App) serve(ctx context.Context, k8s corev1client.CoreV1Interface, aggre
} }
apiService := apiregistrationv1.APIService{ apiService := apiregistrationv1.APIService{
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: "v1alpha1." + placeholder.GroupName, Name: placeholderv1alpha1.SchemeGroupVersion.Version + "." + placeholderv1alpha1.GroupName,
}, },
Spec: apiregistrationv1.APIServiceSpec{ Spec: apiregistrationv1.APIServiceSpec{
Group: placeholder.GroupName, Group: placeholderv1alpha1.GroupName,
Version: "v1alpha1", Version: placeholderv1alpha1.SchemeGroupVersion.Version,
CABundle: caBundle, CABundle: caBundle,
GroupPriorityMinimum: 2500, GroupPriorityMinimum: 2500,
VersionPriority: 10, VersionPriority: 10,