Skip to content

Commit

Permalink
Removing deprecated portal config
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgemoralespou committed Mar 13, 2024
1 parent 15e66ad commit f1ebba8
Show file tree
Hide file tree
Showing 7 changed files with 322 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,32 @@ spec:
#@ if hasattr(bundle.credentials, "secretRef") and hasattr(bundle.credentials.secretRef, "namespace"):
#@ if bundle.credentials.secretRef.namespace != None:
--- #@ secretcopier(bundle.credentials.secretRef.name, bundle.credentials.secretRef.namespace, "workshops-{}".format(bundle.name))
#@ else:
--- #@ secretcopier(bundle.credentials.secretRef.name, data.values.packages_installs_namespace, "workshops-{}".format(bundle.name))
#@ end
#@ end

#@ if hasattr(data.values.overlays.credentials, "secretRef") and hasattr(data.values.overlays.credentials.secretRef, "namespace"):
#@ if data.values.overlays.credentials.secretRef.namespace != None:
--- #@ secretcopier(data.values.overlays.credentials.secretRef.name, data.values.overlays.credentials.secretRef.namespace, "workshops-{}".format(bundle.name))
#@ else:
--- #@ secretcopier(data.values.overlays.credentials.secretRef.name, data.values.packages_installs_namespace, "workshops-{}".format(bundle.name))
#@ end
#@ end

#@ if hasattr(data.values.config.credentials, "secretRef") and hasattr(data.values.config.credentials.secretRef, "namespace"):
#@ if data.values.config.credentials.secretRef.namespace != None:
--- #@ secretcopier(data.values.config.credentials.secretRef.name, data.values.config.credentials.secretRef.namespace, "workshops-{}".format(bundle.name))
#@ else:
--- #@ secretcopier(data.values.config.credentials.secretRef.name, data.values.packages_installs_namespace, "workshops-{}".format(bundle.name))
#@ end
#@ end

#@ if hasattr(data.values.common_credentials, "secretRef") and hasattr(data.values.common_credentials.secretRef, "namespace"):
#@ if data.values.common_credentials.secretRef.namespace != None:
--- #@ secretcopier(data.values.common_credentials.secretRef.name, data.values.common_credentials.secretRef.namespace, "workshops-{}".format(bundle.name))
#@ else:
--- #@ secretcopier(data.values.common_credentials.secretRef.name, data.values.packages_installs_namespace, "workshops-{}".format(bundle.name))
#@ end
#@ end

Expand All @@ -57,6 +65,8 @@ spec:
#@ if hasattr(bundle.credentials, "secretRef") and hasattr(bundle.credentials.secretRef, "namespace"):
#@ if bundle.credentials.secretRef.namespace != None:
--- #@ secretcopier(bundle.credentials.secretRef.name, bundle.credentials.secretRef.namespace, "workshops-{}".format("global"))
#@ else:
--- #@ secretcopier(bundle.credentials.secretRef.name, data.values.packages_installs_namespace, "workshops-{}".format("global"))
#@ end
#@ end

Expand All @@ -65,18 +75,24 @@ spec:
#@ if hasattr(data.values.overlays.credentials, "secretRef") and hasattr(data.values.overlays.credentials.secretRef, "namespace"):
#@ if data.values.overlays.credentials.secretRef.namespace != None:
--- #@ secretcopier(data.values.overlays.credentials.secretRef.name, data.values.overlays.credentials.secretRef.namespace, "workshops-{}".format("global"))
#@ else:
--- #@ secretcopier(data.values.overlays.credentials.secretRef.name, data.values.packages_installs_namespace, "workshops-{}".format("global"))
#@ end
#@ end

#@ if hasattr(data.values.config.credentials, "secretRef") and hasattr(data.values.config.credentials.secretRef, "namespace"):
#@ if data.values.config.credentials.secretRef.namespace != None:
--- #@ secretcopier(data.values.config.credentials.secretRef.name, data.values.config.credentials.secretRef.namespace, "workshops-{}".format("global"))
#@ else:
--- #@ secretcopier(data.values.config.credentials.secretRef.name, data.values.packages_installs_namespace, "workshops-{}".format("global"))
#@ end
#@ end

#@ if hasattr(data.values.common_credentials, "secretRef") and hasattr(data.values.common_credentials.secretRef, "namespace"):
#@ if data.values.common_credentials.secretRef.namespace != None:
--- #@ secretcopier(data.values.common_credentials.secretRef.name, data.values.common_credentials.secretRef.namespace, "workshops-{}".format("global"))
#@ else:
--- #@ secretcopier(data.values.common_credentials.secretRef.name, data.values.packages_installs_namespace, "workshops-{}".format("global"))
#@ end
#@ end

Expand Down
4 changes: 4 additions & 0 deletions overlays/gitops-app/src/bundle/config/values-schema.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#@data/values-schema
---
#! This should be defined in the installing App as a downwardAPI to the current namespace
#@schema/validation min_len=1
packages_installs_namespace: "package-installs"
#@schema/validation one_of=["app_per_bundle", "one_app"]
mode: "app_per_bundle"
#! This should be defined in the installing App as a downwardAPI to the current environment
#@schema/validation min_len=1
environment: ""
#@schema/validation min_len=1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@ spec:
portal:
#@ if/end portal.title:
title: #@ portal.title
#@ if/end initial != -1:
initial: #@ initial
#@ if/end reserved != -1:
reserved: #@ reserved
#@ if/end portal.logo:
logo: #@ portal.logo
#@ if/end portal.labels:
labels: #@ portal.labels
#@ if/end portal.password:
password: #@ portal.password
#@ if/end max or registered or anonymous:
sessions:
#@ if/end max != -1:
maximum: #@ max
Expand Down
7 changes: 7 additions & 0 deletions overlays/portal-app/src/bundle/config/ytt/values-schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ portals:
name: ""
#@schema/nullable
title: ""
#@schema/nullable
logo: ""
#@schema/nullable
labels:
- ""
#@schema/nullable
password: ""
#@schema/validation min_len=1
workshops:
- capacity: -1
Expand Down
13 changes: 9 additions & 4 deletions test/portal-app/config/config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
portals:
- name: "workshop-bundle-animals"
title: "Animals workshops"
logo: "LOGO"
labels:
- "label1"
- "label2"
password: "password"
sessions:
max: 2
defaults:
Expand All @@ -20,10 +25,10 @@ portals:
expires: 60m
orphaned: 5m
reserved: 0
- name: workshop-fish
expires: 60m
orphaned: 5m
reserved: 0
# - name: workshop-fish
# expires: 60m
# orphaned: 5m
# reserved: 0
- name: workshop-giraffe
- name: "workshop-bundle-colours"
sessions:
Expand Down
Loading

0 comments on commit f1ebba8

Please sign in to comment.