-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
1,579 additions
and
69 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/**/ | ||
|
||
// +k8s:deepcopy-gen=package | ||
// +groupName=transformation.zeng.dev | ||
|
||
package transformation |
16 changes: 16 additions & 0 deletions
16
api-aggregation-lib/pkg/api/transformation/install/install.go
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,16 @@ | ||
package install | ||
|
||
import ( | ||
"k8s.io/apimachinery/pkg/runtime" | ||
utilruntime "k8s.io/apimachinery/pkg/util/runtime" | ||
|
||
transformation "github.com/phosae/x-kubernetes/api-aggregation-lib/pkg/api/transformation" | ||
transformationv1beta1 "github.com/phosae/x-kubernetes/api-aggregation-lib/pkg/api/transformation/v1beta1" | ||
) | ||
|
||
// Install registers the API group and adds types to a scheme | ||
func Install(scheme *runtime.Scheme) { | ||
utilruntime.Must(transformationv1beta1.AddToScheme(scheme)) | ||
utilruntime.Must(transformation.AddToScheme(scheme)) | ||
utilruntime.Must(scheme.SetVersionPriority(transformationv1beta1.SchemeGroupVersion)) | ||
} |
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,36 @@ | ||
package transformation | ||
|
||
import ( | ||
"k8s.io/apimachinery/pkg/runtime" | ||
"k8s.io/apimachinery/pkg/runtime/schema" | ||
) | ||
|
||
// GroupName is the group name use in this package | ||
const GroupName = "transformation.zeng.dev" | ||
|
||
// SchemeGroupVersion is group version used to register these objects | ||
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal} | ||
|
||
// Kind takes an unqualified kind and returns a Group qualified GroupKind | ||
func Kind(kind string) schema.GroupKind { | ||
return SchemeGroupVersion.WithKind(kind).GroupKind() | ||
} | ||
|
||
// Resource takes an unqualified resource and returns a Group qualified GroupResource | ||
func Resource(resource string) schema.GroupResource { | ||
return SchemeGroupVersion.WithResource(resource).GroupResource() | ||
} | ||
|
||
var ( | ||
// SchemeBuilder points to a list of functions added to Scheme. | ||
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) | ||
// AddToScheme applies all the stored functions to the scheme. | ||
AddToScheme = SchemeBuilder.AddToScheme | ||
) | ||
|
||
func addKnownTypes(scheme *runtime.Scheme) error { | ||
scheme.AddKnownTypes(SchemeGroupVersion, | ||
&Base64{}, | ||
) | ||
return nil | ||
} |
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,28 @@ | ||
package transformation | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// Base64 generates a base64 encoding for a specified Kubernetes object. | ||
type Base64 struct { | ||
metav1.TypeMeta | ||
metav1.ObjectMeta | ||
|
||
Spec Base64Spec | ||
Status Base64Status | ||
} | ||
|
||
type Base64Spec struct { | ||
// Path of the field to select in the specified object. | ||
// defaults to . for the entire object | ||
FieldPath string | ||
} | ||
|
||
type Base64Status struct { | ||
// Output is the base64-encoded representation of | ||
// the specified Kubernetes object or its subfield, as defined by the fieldPath. | ||
Output string | ||
} |
5 changes: 5 additions & 0 deletions
5
api-aggregation-lib/pkg/api/transformation/v1beta1/defaults.go
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,5 @@ | ||
package v1beta1 | ||
|
||
func init() { | ||
localSchemeBuilder.Register(RegisterDefaults) | ||
} |
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,9 @@ | ||
/**/ | ||
|
||
// +k8s:conversion-gen=github.com/phosae/x-kubernetes/api-aggregation-lib/pkg/api/transformation | ||
// +k8s:conversion-gen-external-types=github.com/phosae/x-kubernetes/api/transformation/v1beta1 | ||
// +groupName=transformation.zeng.dev | ||
// +k8s:defaulter-gen=TypeMeta | ||
// +k8s:defaulter-gen-input=github.com/phosae/x-kubernetes/api/transformation/v1beta1 | ||
|
||
package v1beta1 |
22 changes: 22 additions & 0 deletions
22
api-aggregation-lib/pkg/api/transformation/v1beta1/register.go
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,22 @@ | ||
package v1beta1 | ||
|
||
import ( | ||
transformationv1beta1 "github.com/phosae/x-kubernetes/api/transformation/v1beta1" | ||
"k8s.io/apimachinery/pkg/runtime/schema" | ||
) | ||
|
||
// GroupName is the group name use in this package | ||
const GroupName = "transformation.zeng.dev" | ||
|
||
// SchemeGroupVersion is group version used to register these objects | ||
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta1"} | ||
|
||
// Resource takes an unqualified resource and returns a Group qualified GroupResource | ||
func Resource(resource string) schema.GroupResource { | ||
return SchemeGroupVersion.WithResource(resource).GroupResource() | ||
} | ||
|
||
var ( | ||
localSchemeBuilder = &transformationv1beta1.SchemeBuilder | ||
AddToScheme = localSchemeBuilder.AddToScheme | ||
) |
129 changes: 129 additions & 0 deletions
129
api-aggregation-lib/pkg/api/transformation/v1beta1/zz_generated.conversion.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
api-aggregation-lib/pkg/api/transformation/v1beta1/zz_generated.defaults.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
74 changes: 74 additions & 0 deletions
74
api-aggregation-lib/pkg/api/transformation/zz_generated.deepcopy.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.