Skip to content

Commit

Permalink
Add connection between helmrepo and helmrelease.
Browse files Browse the repository at this point in the history
Signed-off-by: Rokibul Hasan <[email protected]>
  • Loading branch information
RokibulHasan7 committed Oct 28, 2023
1 parent d3e43e5 commit 5fe4714
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 13 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ require (
k8s.io/klog/v2 v2.80.1
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280
kmodules.xyz/apiversion v0.2.0
kmodules.xyz/client-go v0.25.39
kmodules.xyz/client-go v0.25.40-0.20231028030305-5ba2eeda8b3b
kmodules.xyz/crd-schema-fuzz v0.25.0
kmodules.xyz/resource-metrics v0.25.7
kmodules.xyz/schema-checker v0.4.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -731,8 +731,8 @@ k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2 h1:GfD9OzL11kvZN5iArC6oTS7RTj7oJ
k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
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.25.39 h1:5n0fXviJXd/Sioo8v2/f+Ria026oxTjpF9wBte9sBh8=
kmodules.xyz/client-go v0.25.39/go.mod h1:ijkpW+0nkrKf8zpK7V/UQQzjWMZpnMX887jfYLHBMIM=
kmodules.xyz/client-go v0.25.40-0.20231028030305-5ba2eeda8b3b h1:iMYcqDKeNMWNbt9+atDDXzjUM/FfrUyleSoRpebILys=
kmodules.xyz/client-go v0.25.40-0.20231028030305-5ba2eeda8b3b/go.mod h1:ijkpW+0nkrKf8zpK7V/UQQzjWMZpnMX887jfYLHBMIM=
kmodules.xyz/crd-schema-fuzz v0.25.0 h1:c5ZxNRqJak1bkGhECmyrKpzKGThFMB4088Kynyvngbc=
kmodules.xyz/crd-schema-fuzz v0.25.0/go.mod h1:VigFz19GwCxMGhb3YjCtlSXmfXb0J/g9du1So6rvqsk=
kmodules.xyz/offshoot-api v0.25.0 h1:Svq9da/+sg5afOjpgo9vx2J/Lu90Mo0aFxkdQmgKnGI=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,32 @@ spec:
kind: Connection
name: HelmRepository
query:
byLabel: offshoot
raw: |-
query Find($src: String!, $targetGroup: String!, $targetKind: String!) {
find(oid: $src) {
offshoot(group: "source.toolkit.fluxcd.io", kind: "HelmChart") {
refs: source(group: $targetGroup, kind: $targetKind) {
namespace
name
}
}
}
}
type: GraphQL
ref:
group: source.toolkit.fluxcd.io
kind: HelmRepository
- actions:
create: Never
displayMode: List
kind: Connection
name: HelmChart
query:
byLabel: offshoot
type: GraphQL
ref:
group: source.toolkit.fluxcd.io
kind: HelmChart
resource:
group: helm.toolkit.fluxcd.io
kind: HelmRelease
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,22 @@ spec:
kind: Connection
name: HelmRepository
query:
byLabel: offshoot
byLabel: source
type: GraphQL
ref:
group: source.toolkit.fluxcd.io
kind: HelmRepository
- actions:
create: Never
displayMode: List
kind: Connection
name: HelmRelease
query:
byLabel: offshoot
type: GraphQL
ref:
group: helm.toolkit.fluxcd.io
kind: HelmRelease
resource:
group: source.toolkit.fluxcd.io
kind: HelmChart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
kind: Connection
name: HelmCharts
query:
byLabel: offshoot
byLabel: source
type: GraphQL
ref:
group: source.toolkit.fluxcd.io
Expand All @@ -22,7 +22,17 @@ spec:
kind: Connection
name: HelmReleases
query:
byLabel: offshoot
raw: |-
query Find($src: String!, $targetGroup: String!, $targetKind: String!) {
find(oid: $src) {
source(group: "source.toolkit.fluxcd.io", kind: "HelmChart") {
refs: offshoot(group: $targetGroup, kind: $targetKind) {
namespace
name
}
}
}
}
type: GraphQL
ref:
group: helm.toolkit.fluxcd.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ spec:
- labels:
- offshoot
references:
- '{.spec.chart.spec.sourceRef.name}'
- '{.metadata.namespace}-{.spec.chart.spec.chart}'
target:
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
kind: HelmChart
type: MatchRef
resource:
group: helm.toolkit.fluxcd.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ metadata:
spec:
connections:
- labels:
- offshoot
- source
references:
- '{.spec.sourceRef.name}'
target:
Expand Down
4 changes: 2 additions & 2 deletions vendor/kmodules.xyz/client-go/api/v1/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ type ObjectInfo struct {
Ref ObjectReference `json:"ref" protobuf:"bytes,2,opt,name=ref"`
}

// +kubebuilder:validation:Enum=authn;authz;auth_secret;backup_via;catalog;cert_issuer;config;connect_via;exposed_by;event;located_on;monitored_by;ocm_bind;offshoot;ops;placed_into;policy;recommended_for;restore_into;scaled_by;storage;view
// ENUM(authn,authz,auth_secret,backup_via,catalog,cert_issuer,config,connect_via,exposed_by,event,located_on,monitored_by,ocm_bind,offshoot,ops,placed_into,policy,recommended_for,restore_into,scaled_by,storage,view)
// +kubebuilder:validation:Enum=authn;authz;auth_secret;backup_via;catalog;cert_issuer;config;connect_via;exposed_by;event;located_on;monitored_by;ocm_bind;offshoot;ops;placed_into;policy;recommended_for;restore_into;scaled_by;source;storage;view
// ENUM(authn,authz,auth_secret,backup_via,catalog,cert_issuer,config,connect_via,exposed_by,event,located_on,monitored_by,ocm_bind,offshoot,ops,placed_into,policy,recommended_for,restore_into,scaled_by,source,storage,view)
type EdgeLabel string

func (e EdgeLabel) Direct() bool {
Expand Down
5 changes: 5 additions & 0 deletions vendor/kmodules.xyz/client-go/api/v1/object_enum.go

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

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ k8s.io/utils/trace
# kmodules.xyz/apiversion v0.2.0
## explicit; go 1.14
kmodules.xyz/apiversion
# kmodules.xyz/client-go v0.25.39
# kmodules.xyz/client-go v0.25.40-0.20231028030305-5ba2eeda8b3b
## explicit; go 1.18
kmodules.xyz/client-go
kmodules.xyz/client-go/api/v1
Expand Down

0 comments on commit 5fe4714

Please sign in to comment.