Skip to content

Commit

Permalink
make assetconfig a top level type
Browse files Browse the repository at this point in the history
  • Loading branch information
deads2k committed Nov 14, 2017
1 parent 13add52 commit 15baffa
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 6 deletions.
17 changes: 11 additions & 6 deletions pkg/cmd/server/api/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"

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

func init() {
configapi.AddToScheme(configapi.Scheme)
configapiv1.AddToScheme(configapi.Scheme)
AddToScheme(configapi.Scheme)
}

func AddToScheme(scheme *runtime.Scheme) {
configapi.AddToScheme(scheme)
configapiv1.AddToScheme(scheme)
// we additionally need to enable audit versions, since we embed the audit
// policy file inside master-config.yaml
audit.AddToScheme(configapi.Scheme)
auditv1alpha1.AddToScheme(configapi.Scheme)
apiserver.AddToScheme(configapi.Scheme)
apiserverv1alpha1.AddToScheme(configapi.Scheme)
audit.AddToScheme(scheme)
auditv1alpha1.AddToScheme(scheme)
apiserver.AddToScheme(scheme)
apiserverv1alpha1.AddToScheme(scheme)
}

func interfacesFor(version schema.GroupVersion) (*meta.VersionInterfaces, error) {
Expand Down
1 change: 1 addition & 0 deletions pkg/cmd/server/api/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&MasterConfig{},
&NodeConfig{},
&AssetConfig{},
&SessionSecrets{},

&BasicAuthPasswordIdentityProvider{},
Expand Down
4 changes: 4 additions & 0 deletions pkg/cmd/server/api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,11 @@ type DNSConfig struct {
AllowRecursiveQueries bool
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

type AssetConfig struct {
metav1.TypeMeta

ServingInfo HTTPServingInfo

// PublicURL is where you can find the asset server (TODO do we really need this?)
Expand Down
1 change: 1 addition & 0 deletions pkg/cmd/server/api/v1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&MasterConfig{},
&NodeConfig{},
&AssetConfig{},
&SessionSecrets{},

&BasicAuthPasswordIdentityProvider{},
Expand Down
4 changes: 4 additions & 0 deletions pkg/cmd/server/api/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -713,8 +713,12 @@ type DNSConfig struct {
AllowRecursiveQueries bool `json:"allowRecursiveQueries"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// AssetConfig holds the necessary configuration options for serving assets
type AssetConfig struct {
metav1.TypeMeta `json:",inline"`

// ServingInfo is the HTTP serving information for these assets
ServingInfo HTTPServingInfo `json:"servingInfo"`

Expand Down

0 comments on commit 15baffa

Please sign in to comment.