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
7 changes: 5 additions & 2 deletions api/v1/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"fmt"

"kmodules.xyz/client-go/policy/secomp"
app_api "kmodules.xyz/custom-resources/apis/appcatalog/v1alpha1"
appcatalog "kmodules.xyz/custom-resources/apis/appcatalog/v1alpha1"

"gomodules.xyz/pointer"
Expand Down Expand Up @@ -124,12 +125,14 @@ func (c *ConnectionSpec) ToAppBinding() (*appcatalog.AppBinding, error) {
},
}
if c.AuthSecret != nil {
app.Spec.Secret = &core.LocalObjectReference{
app.Spec.Secret = &app_api.TypedLocalObjectReference{
Kind: "Secret", // It will create circular dependency, If we use Kubedb Constant .
Name: c.AuthSecret.Name,
}
}
if c.TLSSecret != nil {
app.Spec.TLSSecret = &core.LocalObjectReference{
app.Spec.TLSSecret = &app_api.TypedLocalObjectReference{
Kind: "Secret",
Name: c.TLSSecret.Name,
}
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ require (
k8s.io/kube-openapi v0.0.0-20250304201544-e5f78fe3ede9
k8s.io/utils v0.0.0-20241210054802-24370beab758
kmodules.xyz/client-go v0.32.0
kmodules.xyz/custom-resources v0.32.0
kmodules.xyz/custom-resources v0.32.2
sigs.k8s.io/controller-runtime v0.20.3
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ kmodules.xyz/apiversion v0.2.0 h1:vAQYqZFm4xu4pbB1cAdHbFEPES6EQkcR4wc06xdTOWk=
kmodules.xyz/apiversion v0.2.0/go.mod h1:oPX8g8LvlPdPX3Yc5YvCzJHQnw3YF/X4/jdW0b1am80=
kmodules.xyz/client-go v0.32.0 h1:9KMvG9bKOTiKaDDUniCaxJTdnEwULxi8YLlHJP9spNQ=
kmodules.xyz/client-go v0.32.0/go.mod h1:tqe40/iDtO/RSNaDJs/a+rgnMPSOcK622HpOmOFvcds=
kmodules.xyz/custom-resources v0.32.0 h1:wzmJTtswO+OmvtqYc70pVoopZyt5UJHKTom4Jh6bfhM=
kmodules.xyz/custom-resources v0.32.0/go.mod h1:aLFrfbUKS+AkKtxFYWpPGzuLNarRtGlkHwC07APHba8=
kmodules.xyz/custom-resources v0.32.2 h1:NkRqL/4AWHiXdT5WKFcJlBcvRuoNdeYIrBGvQIRJRn4=
kmodules.xyz/custom-resources v0.32.2/go.mod h1:YKFNcsFQU7Z3AcPvYVCdFtgAdWiG1Wd1HQMOxCrAoWc=
sigs.k8s.io/controller-runtime v0.20.3 h1:I6Ln8JfQjHH7JbtCD2HCYHoIzajoRxPNuvhvcDbZgkI=
sigs.k8s.io/controller-runtime v0.20.3/go.mod h1:xg2XB0K5ShQzAgsoujxuKN4LNXR2LfwwHsPj7Iaw+XY=
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ type AppBindingSpec struct {

// Secret is the name of the secret to create in the AppBinding's
// namespace that will hold the credentials associated with the AppBinding.
Secret *core.LocalObjectReference `json:"secret,omitempty"`
Secret *TypedLocalObjectReference `json:"secret,omitempty"`

// List of transformations that should be applied to the credentials
// associated with the ServiceBinding before they are inserted into the Secret.
Expand All @@ -90,7 +90,7 @@ type AppBindingSpec struct {

// TLSSecret is the name of the secret that will hold
// the client certificate and private key associated with the AppBinding.
TLSSecret *core.LocalObjectReference `json:"tlsSecret,omitempty"`
TLSSecret *TypedLocalObjectReference `json:"tlsSecret,omitempty"`
}

type AppType string
Expand Down Expand Up @@ -175,6 +175,21 @@ type ServiceReference struct {
Query string `json:"query,omitempty"`
}

// +structType=atomic
type TypedLocalObjectReference struct {
// APIGroup is the group for the resource being referenced.
// If APIGroup is not specified, the specified Kind must be in the core API group.
// For any other third-party types, APIGroup is required.
// +optional
// +kubebuilder:default=""
APIGroup string `json:"apiGroup"`
// Kind is the type of resource being referenced
// +kubebuilder:default="Secret"
Kind string `json:"kind"`
// Name is the name of resource being referenced
Name string `json:"name"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// AppBindingList is a list of Apps
Expand Down

Large diffs are not rendered by default.

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

Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,23 @@ spec:
Secret is the name of the secret to create in the AppBinding's
namespace that will hold the credentials associated with the AppBinding.
properties:
name:
apiGroup:
default: ""
description: |-
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
APIGroup is the group for the resource being referenced.
If APIGroup is not specified, the specified Kind must be in the core API group.
For any other third-party types, APIGroup is required.
type: string
kind:
default: Secret
description: Kind is the type of resource being referenced
type: string
name:
description: Name is the name of resource being referenced
type: string
required:
- kind
- name
type: object
x-kubernetes-map-type: atomic
secretTransforms:
Expand Down Expand Up @@ -277,15 +285,23 @@ spec:
TLSSecret is the name of the secret that will hold
the client certificate and private key associated with the AppBinding.
properties:
name:
apiGroup:
default: ""
description: |-
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
APIGroup is the group for the resource being referenced.
If APIGroup is not specified, the specified Kind must be in the core API group.
For any other third-party types, APIGroup is required.
type: string
kind:
default: Secret
description: Kind is the type of resource being referenced
type: string
name:
description: Name is the name of resource being referenced
type: string
required:
- kind
- name
type: object
x-kubernetes-map-type: atomic
type:
Expand Down
2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ kmodules.xyz/client-go/core/v1
kmodules.xyz/client-go/discovery
kmodules.xyz/client-go/meta
kmodules.xyz/client-go/policy/secomp
# kmodules.xyz/custom-resources v0.32.0
# kmodules.xyz/custom-resources v0.32.2
## explicit; go 1.23.0
kmodules.xyz/custom-resources/apis/appcatalog
kmodules.xyz/custom-resources/apis/appcatalog/v1alpha1
Expand Down
Loading