Skip to content

Commit ae115bc

Browse files
committed
Working User Controller:
- E2E tests included - API configured - Controller Note: Password functionality will be implemented in a future PR. Users can still be created and managed, just without password support. Signed-off-by: Daniel Lawton <dlawton@redhat.com>
1 parent b5f9d29 commit ae115bc

106 files changed

Lines changed: 2775 additions & 218 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

PROJECT

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,14 @@ resources:
160160
kind: Trunk
161161
path: github.com/k-orc/openstack-resource-controller/api/v1alpha1
162162
version: v1alpha1
163+
- api:
164+
crdVersion: v1
165+
namespaced: true
166+
domain: k-orc.cloud
167+
group: openstack
168+
kind: User
169+
path: github.com/k-orc/openstack-resource-controller/api/v1alpha1
170+
version: v1alpha1
163171
- api:
164172
crdVersion: v1
165173
namespaced: true

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ kubectl delete -f $ORC_RELEASE
8888
| service | |||
8989
| subnet | |||
9090
| trunk | |||
91+
| user | |||
9192
| volume | |||
9293
| volume type | |||
9394

api/v1alpha1/user_types.go

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,14 @@ type UserResourceSpec struct {
3434
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="domainRef is immutable"
3535
DomainRef *KubernetesNameRef `json:"domainRef,omitempty"`
3636

37-
// projectRef is a reference to the ORC Project which this resource is associated with.
37+
// defaultProjectRef is a reference to the Default Project which this resource is associated with.
3838
// +optional
39-
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="projectRef is immutable"
40-
ProjectRef *KubernetesNameRef `json:"projectRef,omitempty"`
41-
42-
// TODO(scaffolding): Add more types.
43-
// To see what is supported, you can take inspiration from the CreateOpts structure from
44-
// github.com/gophercloud/gophercloud/v2/openstack/identity/v3/users
45-
//
46-
// Until you have implemented mutability for the field, you must add a CEL validation
47-
// preventing the field being modified:
48-
// `// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="<fieldname> is immutable"`
39+
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="defaultProjectRef is immutable"
40+
DefaultProjectRef *KubernetesNameRef `json:"defaultProjectRef,omitempty"`
41+
42+
// enabled defines whether a user is enabled or disabled
43+
// +optional
44+
Enabled *bool `json:"enabled,omitempty"`
4945
}
5046

5147
// UserFilter defines an existing resource by its properties
@@ -55,19 +51,9 @@ type UserFilter struct {
5551
// +optional
5652
Name *OpenStackName `json:"name,omitempty"`
5753

58-
// description of the existing resource
59-
// +kubebuilder:validation:MinLength:=1
60-
// +kubebuilder:validation:MaxLength:=255
61-
// +optional
62-
Description *string `json:"description,omitempty"`
63-
6454
// domainRef is a reference to the ORC Domain which this resource is associated with.
6555
// +optional
6656
DomainRef *KubernetesNameRef `json:"domainRef,omitempty"`
67-
68-
// TODO(scaffolding): Add more types.
69-
// To see what is supported, you can take inspiration from the ListOpts structure from
70-
// github.com/gophercloud/gophercloud/v2/openstack/identity/v3/users
7157
}
7258

7359
// UserResourceStatus represents the observed state of the resource.
@@ -87,12 +73,12 @@ type UserResourceStatus struct {
8773
// +optional
8874
DomainID string `json:"domainID,omitempty"`
8975

90-
// projectID is the ID of the Project to which the resource is associated.
76+
// defaultProjectID is the ID of the Default Project to which the user is associated with.
9177
// +kubebuilder:validation:MaxLength=1024
9278
// +optional
93-
ProjectID string `json:"projectID,omitempty"`
79+
DefaultProjectID string `json:"defaultProjectID,omitempty"`
9480

95-
// TODO(scaffolding): Add more types.
96-
// To see what is supported, you can take inspiration from the User structure from
97-
// github.com/gophercloud/gophercloud/v2/openstack/identity/v3/users
81+
// enabled defines whether a user is enabled or disabled
82+
// +optional
83+
Enabled bool `json:"enabled,omitempty"`
9884
}

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 154 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)