Skip to content

Commit b3c1b75

Browse files
committed
fix: r
Signed-off-by: ashing <[email protected]>
1 parent 24c42a2 commit b3c1b75

File tree

4 files changed

+33
-75
lines changed

4 files changed

+33
-75
lines changed

api/v1alpha1/gatewayproxy_types.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
package v1alpha1
1818

1919
import (
20+
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
2021
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2122
)
2223

@@ -28,8 +29,8 @@ type GatewayProxySpec struct {
2829
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
2930
// Important: Run "make" to regenerate code after modifying this file
3031

31-
Plugins []Plugin `json:"plugins,omitempty"`
32-
PluginMetadata []Plugin `json:"pluginMetadata,omitempty"`
32+
Plugins []GatewayProxyPlugin `json:"plugins,omitempty"`
33+
PluginMetadata map[string]Plugin `json:"pluginMetadata,omitempty"`
3334
}
3435

3536
//+kubebuilder:object:root=true
@@ -51,6 +52,12 @@ type GatewayProxyList struct {
5152
Items []GatewayProxy `json:"items"`
5253
}
5354

55+
type GatewayProxyPlugin struct {
56+
Name string `json:"name,omitempty"`
57+
Enabled bool `json:"enabled,omitempty"`
58+
Config apiextensionsv1.JSON `json:"config,omitempty"`
59+
}
60+
5461
func init() {
5562
SchemeBuilder.Register(&GatewayProxy{}, &GatewayProxyList{})
5663
}

api/v1alpha1/zz_generated.deepcopy.go

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

config/crd/bases/gateway.apisix.io_gatewayproxies.yaml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ spec:
4040
description: GatewayProxySpec defines the desired state of GatewayProxy
4141
properties:
4242
pluginMetadata:
43-
items:
43+
additionalProperties:
4444
properties:
4545
config:
4646
description: Plugin configuration.
@@ -52,19 +52,16 @@ spec:
5252
- config
5353
- name
5454
type: object
55-
type: array
55+
type: object
5656
plugins:
5757
items:
5858
properties:
5959
config:
60-
description: Plugin configuration.
6160
x-kubernetes-preserve-unknown-fields: true
61+
enabled:
62+
type: boolean
6263
name:
63-
description: The plugin name.
6464
type: string
65-
required:
66-
- config
67-
- name
6865
type: object
6966
type: array
7067
type: object

internal/controller/gatewayproxy_controller.go

Lines changed: 0 additions & 62 deletions
This file was deleted.

0 commit comments

Comments
 (0)