Skip to content

Commit

Permalink
New Arch almost done
Browse files Browse the repository at this point in the history
  • Loading branch information
SamMHD committed Jan 29, 2024
1 parent dfd8f31 commit 77ccb4d
Show file tree
Hide file tree
Showing 7 changed files with 443 additions and 184 deletions.
3 changes: 0 additions & 3 deletions api/v1alpha1/accesstoken_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
package v1alpha1

import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand All @@ -40,8 +39,6 @@ const (
SuspendedState AccessTokenState = "Suspended"
)

type WebserviceReference corev1.SecretReference

// AccessTokenSpec defines the desired state of AccessToken
type AccessTokenSpec struct {
// State shows the state of the token (whether you use token or it's just a draft)
Expand Down
20 changes: 19 additions & 1 deletion api/v1alpha1/webservice_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package v1alpha1

import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand Down Expand Up @@ -100,10 +101,27 @@ type WebServiceList struct {
Items []WebService `json:"items"`
}

func (w WebService) encodedName() string {
type LocalWebserviceReference corev1.LocalObjectReference
type WebserviceReference corev1.SecretReference

func (w WebserviceReference) LocalName() string {
return w.Namespace + "/" + w.Name
}

func (w LocalWebserviceReference) LocalName(ns string) string {
return WebserviceReference{
Name: w.Name,
Namespace: ns,
}.LocalName()
}

func (w WebService) LocalName() string {
return WebserviceReference{
Name: w.Name,
Namespace: w.Namespace,
}.LocalName()
}

func init() {
SchemeBuilder.Register(&WebService{}, &WebServiceList{})
}
2 changes: 1 addition & 1 deletion api/v1alpha1/webserviceaccessbinding_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type WebserviceAccessBindingSpec struct {
Subjects []string `json:"subjects,omitempty"`

// WebServices are the target service accesses
Webservices []string `json:"webservices,omitempty"`
Webservices []LocalWebserviceReference `json:"webservices,omitempty"`
}

// WebserviceAccessBindingStatus defines the observed state of WebserviceAccessBinding
Expand Down
17 changes: 16 additions & 1 deletion api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 77ccb4d

Please sign in to comment.