Skip to content

Commit

Permalink
Merge pull request #49 from janwillies/rename-project
Browse files Browse the repository at this point in the history
de-duplicate provider-gitlab resource names to match gitlab api
  • Loading branch information
janwillies authored Sep 20, 2021
2 parents 1e4c616 + f220e0a commit b820fa8
Show file tree
Hide file tree
Showing 35 changed files with 914 additions and 914 deletions.
50 changes: 25 additions & 25 deletions apis/groups/v1alpha1/groupmember_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ import (
xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
)

// GroupMemberSAMLIdentity represents the SAML Identity link for the group member.
// MemberSAMLIdentity represents the SAML Identity link for the group member.
//
// GitLab API docs: https://docs.gitlab.com/ce/api/members.html#list-all-members-of-a-group-or-project
// Gitlab MR for API change: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/20357
// Gitlab MR for API Doc change: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/25652
type GroupMemberSAMLIdentity struct {
type MemberSAMLIdentity struct {
ExternUID string `json:"externUID"`
Provider string `json:"provider"`
SAMLProviderID int `json:"samlProviderID"`
}

// A GroupMemberParameters defines the desired state of a Gitlab GroupMember.
type GroupMemberParameters struct {
// A MemberParameters defines the desired state of a Gitlab Group Member.
type MemberParameters struct {

// The ID of the group owned by the authenticated user.
// +optional
Expand Down Expand Up @@ -63,34 +63,34 @@ type GroupMemberParameters struct {
ExpiresAt *string `json:"expiresAt,omitempty"`
}

// GroupMemberObservation represents a group member.
// MemberObservation represents a group member.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/groups.html#list-group-members
type GroupMemberObservation struct {
Username string `json:"username,omitempty"`
Name string `json:"name,omitempty"`
State string `json:"state,omitempty"`
AvatarURL string `json:"avatarURL,omitempty"`
WebURL string `json:"webURL,omitempty"`
GroupSAMLIdentity *GroupMemberSAMLIdentity `json:"groupSamlIdentity,omitempty"`
type MemberObservation struct {
Username string `json:"username,omitempty"`
Name string `json:"name,omitempty"`
State string `json:"state,omitempty"`
AvatarURL string `json:"avatarURL,omitempty"`
WebURL string `json:"webURL,omitempty"`
GroupSAMLIdentity *MemberSAMLIdentity `json:"groupSamlIdentity,omitempty"`
}

// A GroupMemberSpec defines the desired state of a Gitlab GroupMember.
type GroupMemberSpec struct {
// A MemberSpec defines the desired state of a Gitlab Group Member.
type MemberSpec struct {
xpv1.ResourceSpec `json:",inline"`
ForProvider GroupMemberParameters `json:"forProvider"`
ForProvider MemberParameters `json:"forProvider"`
}

// A GroupMemberStatus represents the observed state of a Gitlab GroupMember.
type GroupMemberStatus struct {
// A MemberStatus represents the observed state of a Gitlab Group Member.
type MemberStatus struct {
xpv1.ResourceStatus `json:",inline"`
AtProvider GroupMemberObservation `json:"atProvider,omitempty"`
AtProvider MemberObservation `json:"atProvider,omitempty"`
}

// +kubebuilder:object:root=true

// A GroupMember is a managed resource that represents a Gitlab GroupMember
// A Member is a managed resource that represents a Gitlab Group Member
// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status"
// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status"
// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp"
Expand All @@ -99,19 +99,19 @@ type GroupMemberStatus struct {
// +kubebuilder:printcolumn:name="Acceess Level",type="integer",JSONPath=".spec.forProvider.accessLevel"
// +kubebuilder:subresource:status
// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,gitlab}
type GroupMember struct {
type Member struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec GroupMemberSpec `json:"spec"`
Status GroupMemberStatus `json:"status,omitempty"`
Spec MemberSpec `json:"spec"`
Status MemberStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true

// GroupMemberList contains a list of GroupMember items
type GroupMemberList struct {
// MemberList contains a list of Member items
type MemberList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []GroupMember `json:"items"`
Items []Member `json:"items"`
}
4 changes: 2 additions & 2 deletions apis/groups/v1alpha1/referencers.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ func (mg *Group) ResolveReferences(ctx context.Context, c client.Reader) error {
return nil
}

// ResolveReferences of this ProjectMember
func (mg *GroupMember) ResolveReferences(ctx context.Context, c client.Reader) error {
// ResolveReferences of this Member
func (mg *Member) ResolveReferences(ctx context.Context, c client.Reader) error {
r := reference.NewAPIResolver(c, mg)

// resolve spec.forProvider.projectIdRef
Expand Down
12 changes: 6 additions & 6 deletions apis/groups/v1alpha1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ var (
GroupKubernetesGroupVersionKind = SchemeGroupVersion.WithKind(GroupKind)
)

// GroupMemberGitLab type metadata
// MemberGitLab type metadata
var (
GroupMemberKind = reflect.TypeOf(GroupMember{}).Name()
GroupMemberKubernetesGroupKind = schema.GroupKind{Group: KubernetesGroup, Kind: GroupMemberKind}.String()
GroupMemberKindAPIVersion = GroupMemberKind + "." + SchemeGroupVersion.String()
GroupMemberKubernetesGroupVersionKind = SchemeGroupVersion.WithKind(GroupMemberKind)
MemberKind = reflect.TypeOf(Member{}).Name()
MemberKubernetesGroupKind = schema.GroupKind{Group: KubernetesGroup, Kind: MemberKind}.String()
MemberKindAPIVersion = MemberKind + "." + SchemeGroupVersion.String()
MemberKubernetesGroupVersionKind = SchemeGroupVersion.WithKind(MemberKind)
)

func init() {
SchemeBuilder.Register(&Group{}, &GroupList{})
SchemeBuilder.Register(&GroupMember{}, &GroupMemberList{})
SchemeBuilder.Register(&Member{}, &MemberList{})
}
Loading

0 comments on commit b820fa8

Please sign in to comment.