Skip to content

Commit 15baffa

Browse files
committed
make assetconfig a top level type
1 parent 13add52 commit 15baffa

File tree

5 files changed

+21
-6
lines changed

5 files changed

+21
-6
lines changed

pkg/cmd/server/api/install/install.go

+11-6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"fmt"
55

66
"k8s.io/apimachinery/pkg/api/meta"
7+
"k8s.io/apimachinery/pkg/runtime"
78
"k8s.io/apimachinery/pkg/runtime/schema"
89
"k8s.io/apiserver/pkg/apis/apiserver"
910
apiserverv1alpha1 "k8s.io/apiserver/pkg/apis/apiserver/v1alpha1"
@@ -29,14 +30,18 @@ var accessor = meta.NewAccessor()
2930
var availableVersions = []schema.GroupVersion{configapiv1.SchemeGroupVersion}
3031

3132
func init() {
32-
configapi.AddToScheme(configapi.Scheme)
33-
configapiv1.AddToScheme(configapi.Scheme)
33+
AddToScheme(configapi.Scheme)
34+
}
35+
36+
func AddToScheme(scheme *runtime.Scheme) {
37+
configapi.AddToScheme(scheme)
38+
configapiv1.AddToScheme(scheme)
3439
// we additionally need to enable audit versions, since we embed the audit
3540
// policy file inside master-config.yaml
36-
audit.AddToScheme(configapi.Scheme)
37-
auditv1alpha1.AddToScheme(configapi.Scheme)
38-
apiserver.AddToScheme(configapi.Scheme)
39-
apiserverv1alpha1.AddToScheme(configapi.Scheme)
41+
audit.AddToScheme(scheme)
42+
auditv1alpha1.AddToScheme(scheme)
43+
apiserver.AddToScheme(scheme)
44+
apiserverv1alpha1.AddToScheme(scheme)
4045
}
4146

4247
func interfacesFor(version schema.GroupVersion) (*meta.VersionInterfaces, error) {

pkg/cmd/server/api/register.go

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ func addKnownTypes(scheme *runtime.Scheme) error {
3939
scheme.AddKnownTypes(SchemeGroupVersion,
4040
&MasterConfig{},
4141
&NodeConfig{},
42+
&AssetConfig{},
4243
&SessionSecrets{},
4344

4445
&BasicAuthPasswordIdentityProvider{},

pkg/cmd/server/api/types.go

+4
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,11 @@ type DNSConfig struct {
823823
AllowRecursiveQueries bool
824824
}
825825

826+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
827+
826828
type AssetConfig struct {
829+
metav1.TypeMeta
830+
827831
ServingInfo HTTPServingInfo
828832

829833
// PublicURL is where you can find the asset server (TODO do we really need this?)

pkg/cmd/server/api/v1/register.go

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ func addKnownTypes(scheme *runtime.Scheme) error {
2020
scheme.AddKnownTypes(SchemeGroupVersion,
2121
&MasterConfig{},
2222
&NodeConfig{},
23+
&AssetConfig{},
2324
&SessionSecrets{},
2425

2526
&BasicAuthPasswordIdentityProvider{},

pkg/cmd/server/api/v1/types.go

+4
Original file line numberDiff line numberDiff line change
@@ -713,8 +713,12 @@ type DNSConfig struct {
713713
AllowRecursiveQueries bool `json:"allowRecursiveQueries"`
714714
}
715715

716+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
717+
716718
// AssetConfig holds the necessary configuration options for serving assets
717719
type AssetConfig struct {
720+
metav1.TypeMeta `json:",inline"`
721+
718722
// ServingInfo is the HTTP serving information for these assets
719723
ServingInfo HTTPServingInfo `json:"servingInfo"`
720724

0 commit comments

Comments
 (0)