-
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
Jordan Olshevski
committed
Nov 20, 2023
1 parent
0522e9e
commit beb67e0
Showing
7 changed files
with
378 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package reconciliation | ||
|
||
import ( | ||
"sync" | ||
|
||
"k8s.io/kubectl/pkg/util/openapi" | ||
) | ||
|
||
// TODO | ||
|
||
type discoveryCache struct { | ||
mut sync.Mutex | ||
current openapi.Resources | ||
} | ||
|
||
func (d *discoveryCache) Get() openapi.Resources { | ||
return nil | ||
} |
49 changes: 49 additions & 0 deletions
49
...nal/controllers/reconciliation/fixtures/v1/config/crd/enotest.azure.io_testresources.yaml
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,49 @@ | ||
--- | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.13.0 | ||
name: testresources.enotest.azure.io | ||
spec: | ||
group: enotest.azure.io | ||
names: | ||
kind: TestResource | ||
listKind: TestResourceList | ||
plural: testresources | ||
singular: testresource | ||
scope: Namespaced | ||
versions: | ||
- name: v1 | ||
schema: | ||
openAPIV3Schema: | ||
properties: | ||
apiVersion: | ||
description: 'APIVersion defines the versioned schema of this representation | ||
of an object. Servers should convert recognized schemas to the latest | ||
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' | ||
type: string | ||
kind: | ||
description: 'Kind is a string value representing the REST resource this | ||
object represents. Servers may infer this from the endpoint the client | ||
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
properties: | ||
values: | ||
items: | ||
properties: | ||
int: | ||
type: integer | ||
type: object | ||
type: array | ||
type: object | ||
status: | ||
type: object | ||
type: object | ||
served: true | ||
storage: true | ||
subresources: | ||
status: {} |
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,48 @@ | ||
// +kubebuilder:object:generate=true | ||
// +groupName=enotest.azure.io | ||
package v1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
"k8s.io/apimachinery/pkg/runtime/schema" | ||
"sigs.k8s.io/controller-runtime/pkg/scheme" | ||
) | ||
|
||
//go:generate controller-gen object crd rbac:roleName=resourceprovider paths=./... | ||
|
||
var ( | ||
SchemeGroupVersion = schema.GroupVersion{Group: "enotest.azure.io", Version: "v1"} | ||
SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} | ||
) | ||
|
||
func init() { | ||
SchemeBuilder.Register(&TestResourceList{}, &TestResource{}) | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
type TestResourceList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []TestResource `json:"items"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
// +kubebuilder:subresource:status | ||
type TestResource struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec TestResourceSpec `json:"spec,omitempty"` | ||
Status TestResourceStatus `json:"status,omitempty"` | ||
} | ||
|
||
type TestResourceSpec struct { | ||
Values []*TestValue `json:"values,omitempty"` | ||
} | ||
|
||
type TestValue struct { | ||
Int int `json:"int,omitempty"` | ||
} | ||
|
||
type TestResourceStatus struct { | ||
} |
124 changes: 124 additions & 0 deletions
124
internal/controllers/reconciliation/fixtures/v1/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.
Oops, something went wrong.