Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adopt aggregated apiserver #1048

Merged
merged 15 commits into from
Oct 30, 2019
41 changes: 41 additions & 0 deletions pkg/apis/pingcap.com/v1alpha1/dataresource_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright 2019. PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.

package v1alpha1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

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

// +k8s:openapi-gen=false
// DataResource is a generic custom resource for storing custom data
type DataResource struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata"`

Data []byte `json:"data"`
aylei marked this conversation as resolved.
Show resolved Hide resolved
}

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

// +k8s:openapi-gen=false
// DataResourceList contains a list of DataResource
type DataResourceList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`

Items []DataResource `json:"items"`
}
2 changes: 2 additions & 0 deletions pkg/apis/pingcap.com/v1alpha1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&BackupScheduleList{},
&Restore{},
&RestoreList{},
&DataResource{},
&DataResourceList{},
)

metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
Expand Down
94 changes: 94 additions & 0 deletions pkg/client/listers/pingcap.com/v1alpha1/dataresource.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.