Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ help: ## Display this help.

.PHONY: manifests
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
$(CONTROLLER_GEN) rbac:roleName=api7-ingress-manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases

.PHONY: generate
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
Expand Down
57 changes: 57 additions & 0 deletions api/v1alpha1/consumer_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package v1alpha1

import (
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
type Consumer struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec ConsumerSpec `json:"spec,omitempty"`
Status Status `json:"status,omitempty"`
}

type ConsumerSpec struct {
GatewayRef GatewayRef `json:"gatewayRef,omitempty"`
Credentials []CredentialSpec `json:"credentials,omitempty"`
}

type GatewayRef struct {
Name string `json:"name,omitempty"`
Kind string `json:"kind,omitempty"`
Group string `json:"group,omitempty"`
Namespace *string `json:"namespace,omitempty"`
}

// +kubebuilder:validation:XValidation:rule="has(self.config) != has(self.secretRef)"
type CredentialSpec struct {
// +kubebuilder:validation:Enum=jwt-auth;basic-auth;key-auth;hmac-auth;
Type string `json:"type"`
Config apiextensionsv1.JSON `json:"config,omitempty"`
SecretRef *SecretReference `json:"secretRef,omitempty"`
Name string `json:"name,omitempty"`
}

type SecretReference struct {
Name string `json:"name"`
Namespace string `json:"namespace,omitempty"`
}

type Status struct {
Conditions []metav1.Condition `json:"conditions,omitempty"`
}

// +kubebuilder:object:root=true
type ConsumerList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Consumer `json:"items"`
}

func init() {
SchemeBuilder.Register(&Consumer{}, &ConsumerList{})
}
10 changes: 5 additions & 5 deletions api/v1alpha1/pluginconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ import (
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

// PluginConfigSpec defines the desired state of PluginConfig
type PluginConfigSpec struct {
Plugins []Plugin `json:"plugins"`
}

// +kubebuilder:object:root=true

// PluginConfig is the Schema for the PluginConfigs API
Expand All @@ -23,6 +18,11 @@ type PluginConfig struct {
Spec PluginConfigSpec `json:"spec,omitempty"`
}

// PluginConfigSpec defines the desired state of PluginConfig
type PluginConfigSpec struct {
Plugins []Plugin `json:"plugins"`
}

// +kubebuilder:object:root=true

// PluginConfigList contains a list of PluginConfig
Expand Down
165 changes: 163 additions & 2 deletions api/v1alpha1/zz_generated.deepcopy.go

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

Loading
Loading