Skip to content

Commit

Permalink
unfeat: dont set connectiondetails in status yet
Browse files Browse the repository at this point in the history
  • Loading branch information
tenstad committed Feb 20, 2025
1 parent 4794ae0 commit d470e35
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 9 deletions.
1 change: 0 additions & 1 deletion apis/user/v1alpha1/user_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ type UserParameters struct {

// UserObservation are the observable fields of a User.
type UserObservation struct {
CanonicalID string `json:"canonicalId,omitempty"`
}

// A UserSpec defines the desired state of a User.
Expand Down
3 changes: 1 addition & 2 deletions internal/controller/user/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func (c *external) Observe(ctx context.Context, mg resource.Managed) (managed.Ex
return managed.ExternalObservation{}, nil
}

user, err := c.cloudianService.GetUser(ctx, cloudian.UserID{
_, err := c.cloudianService.GetUser(ctx, cloudian.UserID{
GroupID: group,
UserID: externalName})
if errors.Is(err, cloudian.ErrNotFound) {
Expand All @@ -167,7 +167,6 @@ func (c *external) Observe(ctx context.Context, mg resource.Managed) (managed.Ex
return managed.ExternalObservation{}, errors.Wrap(err, errGetUser)
}

cr.Status.AtProvider.CanonicalID = user.CanonicalUserID
cr.SetConditions(xpv1.Available())

return managed.ExternalObservation{
Expand Down
1 change: 0 additions & 1 deletion internal/sdk/cloudian/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ type UserID struct {
type User struct {
UserID `json:",inline"`

Check failure on line 104 in internal/sdk/cloudian/sdk.go

View workflow job for this annotation

GitHub Actions / lint

File is not properly formatted (gofmt)
UserType UserType `json:"userType"`
CanonicalUserID string `json:"canonicalUserId,omitempty"`
}

// SecurityInfo is the Cloudian API's term for secure credentials
Expand Down
4 changes: 2 additions & 2 deletions internal/sdk/cloudian/sdk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ func TestClient_GetUser(t *testing.T) {
status int
wantErr error
}{
{name: "Exists", user: User{UserID: UserID{UserID: strconv.Itoa(http.StatusOK)}, CanonicalUserID: "123"}},
{name: "Not found", user: User{UserID: UserID{UserID: strconv.Itoa(http.StatusNoContent)}, CanonicalUserID: "456"}, wantErr: ErrNotFound},
{name: "Exists", user: User{UserID: UserID{UserID: strconv.Itoa(http.StatusOK)}}},
{name: "Not found", user: User{UserID: UserID{UserID: strconv.Itoa(http.StatusNoContent)}}, wantErr: ErrNotFound},
}

client, testServer := mockBy(func(w http.ResponseWriter, r *http.Request) {
Expand Down
3 changes: 0 additions & 3 deletions package/crds/user.cloudian.crossplane.io_users.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,6 @@ spec:
properties:
atProvider:
description: UserObservation are the observable fields of a User.
properties:
canonicalId:
type: string
type: object
conditions:
description: Conditions of the resource.
Expand Down

0 comments on commit d470e35

Please sign in to comment.