-
Notifications
You must be signed in to change notification settings - Fork 917
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: changzhen <[email protected]>
- Loading branch information
1 parent
c5afa2f
commit e070ad7
Showing
4 changed files
with
368 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package scheme | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
"k8s.io/apimachinery/pkg/runtime" | ||
"k8s.io/apimachinery/pkg/runtime/schema" | ||
"k8s.io/apimachinery/pkg/runtime/serializer" | ||
|
||
clusterinstall "github.com/karmada-io/karmada/pkg/apis/cluster/install" | ||
) | ||
|
||
var ( | ||
// Scheme defines methods for serializing and deserializing API objects. | ||
Scheme = runtime.NewScheme() | ||
// Codecs provides methods for retrieving codecs and serializers for specific | ||
// versions and content types. | ||
Codecs = serializer.NewCodecFactory(Scheme) | ||
// ParameterCodec handles versioning of objects that are converted to query parameters. | ||
ParameterCodec = runtime.NewParameterCodec(Scheme) | ||
) | ||
|
||
func init() { | ||
clusterinstall.Install(Scheme) | ||
|
||
// we need to add the options to empty v1 | ||
// TODO fix the server code to avoid this | ||
metav1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) | ||
|
||
// TODO: keep the generic API server from wanting this | ||
unversioned := schema.GroupVersion{Group: "", Version: "v1"} | ||
Scheme.AddUnversionedTypes(unversioned, | ||
&metav1.Status{}, | ||
&metav1.APIVersions{}, | ||
&metav1.APIGroupList{}, | ||
&metav1.APIGroup{}, | ||
&metav1.APIResourceList{}, | ||
) | ||
} |
Oops, something went wrong.