diff --git a/README.md b/README.md index 040da39..db21322 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ The Engineering Platform package can be customized via a `values.yml` file. ```yaml platform: platform: - profile: serving + profile: run ingress: domain: thomasvitale.com ``` @@ -98,7 +98,7 @@ The Engineering Platform package has the following configurable properties. | Config | Default | Description | |-------|-------------------|-------------| -| `platform.profile` | `full` | The platform profile to install. Options: `full`, `serving`. | +| `platform.profile` | `run` | The platform profile to install. Options: `full`, `dev`, `build`, `run`. | | `platform.supply_chain` | `basic` | The type of supply chain to deploy. Options: `basic`, `advanced`. | | `platform.namespace` | `kadras-packages` | The namespace where to install the platform. | | `platform.excluded_packages` | `[]` | A list of packages to exclude from being installed. | diff --git a/package/config/components/buildpacks-catalog.yml b/package/config/components/buildpacks-catalog.yml index 7137347..1f3e9a1 100644 --- a/package/config/components/buildpacks-catalog.yml +++ b/package/config/components/buildpacks-catalog.yml @@ -3,7 +3,7 @@ #@ load("@ytt:yaml", "yaml") #@ load("/helpers.star", "is_any_profile_enabled", "is_package_enabled", "profiles") -#@ if is_package_enabled("buildpacks-catalog") and is_any_profile_enabled([profiles.full]): +#@ if is_package_enabled("buildpacks-catalog") and is_any_profile_enabled([profiles.full, profiles.dev, profiles.build]): #@ def compute_package_values(): #@ values = struct.decode(data.values.buildpacks.catalog) diff --git a/package/config/components/cartographer-blueprints.yml b/package/config/components/cartographer-blueprints.yml index 8074fc0..cb59dd9 100644 --- a/package/config/components/cartographer-blueprints.yml +++ b/package/config/components/cartographer-blueprints.yml @@ -3,7 +3,7 @@ #@ load("@ytt:yaml", "yaml") #@ load("/helpers.star", "is_any_profile_enabled", "is_package_enabled", "profiles") -#@ if is_package_enabled("cartographer-blueprints") and is_any_profile_enabled([profiles.full]): +#@ if is_package_enabled("cartographer-blueprints") and is_any_profile_enabled([profiles.full, profiles.dev, profiles.build, profiles.run]): #@ def compute_package_values(): #@ return data.values.cartographer.blueprints diff --git a/package/config/components/cartographer-delivery.yml b/package/config/components/cartographer-delivery.yml index e4ce303..a7e6a8f 100644 --- a/package/config/components/cartographer-delivery.yml +++ b/package/config/components/cartographer-delivery.yml @@ -3,7 +3,7 @@ #@ load("@ytt:yaml", "yaml") #@ load("/helpers.star", "is_any_profile_enabled", "is_package_enabled", "profiles") -#@ if is_package_enabled("cartographer-delivery") and is_any_profile_enabled([profiles.full]): +#@ if is_package_enabled("cartographer-delivery") and is_any_profile_enabled([profiles.full, profiles.run]): #@ def compute_package_values(): #@ values = struct.decode(data.values.cartographer.delivery) diff --git a/package/config/components/cartographer-supply-chains.yml b/package/config/components/cartographer-supply-chains.yml index 6ec3028..3454b41 100644 --- a/package/config/components/cartographer-supply-chains.yml +++ b/package/config/components/cartographer-supply-chains.yml @@ -3,7 +3,7 @@ #@ load("@ytt:yaml", "yaml") #@ load("/helpers.star", "is_any_profile_enabled", "is_package_enabled", "profiles") -#@ if is_package_enabled("cartographer-supply-chains") and is_any_profile_enabled([profiles.full]): +#@ if is_package_enabled("cartographer-supply-chains") and is_any_profile_enabled([profiles.full, profiles.dev, profiles.build]): #@ def compute_package_values(): #@ values = struct.decode(data.values.cartographer.supply_chains) diff --git a/package/config/components/cartographer.yml b/package/config/components/cartographer.yml index d0e9b7d..d814963 100644 --- a/package/config/components/cartographer.yml +++ b/package/config/components/cartographer.yml @@ -3,7 +3,7 @@ #@ load("@ytt:yaml", "yaml") #@ load("/helpers.star", "is_any_profile_enabled", "is_package_enabled", "profiles") -#@ if is_package_enabled("cartographer") and is_any_profile_enabled([profiles.full]): +#@ if is_package_enabled("cartographer") and is_any_profile_enabled([profiles.full, profiles.dev, profiles.build, profiles.run]): #@ def compute_package_values(): #@ values = struct.decode(data.values.cartographer.core) @@ -13,6 +13,14 @@ #@ values["ca_cert_data"] = values["ca_cert_data"] + data.values.platform.ca_cert_data #@ end #@ +#@ #! Disable Cartographer Conventions based on profile +#@ if is_any_profile_enabled([profiles.run]): +#@ if not hasattr(data.values.cartographer.core, "optional_components") or not data.values.cartographer.core.optional_components or not hasattr(data.values.cartographer.core.optional_components, "cartographer_conventions") or not data.values.cartographer.core.optional_components.cartographer_conventions: +#@ values["optional_components"] = {} +#@ values["optional_components"]["cartographer_conventions"] = "false" +#@ end +#@ end +#@ #@ return struct.encode(values) #@ end diff --git a/package/config/components/cert-manager-issuers.yml b/package/config/components/cert-manager-issuers.yml index 6cfc787..2b487e0 100644 --- a/package/config/components/cert-manager-issuers.yml +++ b/package/config/components/cert-manager-issuers.yml @@ -3,7 +3,7 @@ #@ load("@ytt:yaml", "yaml") #@ load("/helpers.star", "is_any_profile_enabled", "is_package_enabled", "profiles") -#@ if is_package_enabled("cert-manager-issuers") and is_any_profile_enabled([profiles.full, profiles.serving]): +#@ if is_package_enabled("cert-manager-issuers"): #@ def is_letsencrypt_issuer(issuer): #@ return issuer.type == "letsencrypt_staging" or issuer.type == "letsencrypt" diff --git a/package/config/components/cert-manager.yml b/package/config/components/cert-manager.yml index 4ffefb4..706934a 100644 --- a/package/config/components/cert-manager.yml +++ b/package/config/components/cert-manager.yml @@ -3,7 +3,7 @@ #@ load("@ytt:yaml", "yaml") #@ load("/helpers.star", "is_any_profile_enabled", "is_package_enabled", "profiles") -#@ if is_package_enabled("cert-manager") and is_any_profile_enabled([profiles.full, profiles.serving]): +#@ if is_package_enabled("cert-manager"): #@ def compute_package_values(): #@ return data.values.cert_manager.core diff --git a/package/config/components/contour.yml b/package/config/components/contour.yml index 9dab085..1434b2b 100644 --- a/package/config/components/contour.yml +++ b/package/config/components/contour.yml @@ -3,7 +3,7 @@ #@ load("@ytt:yaml", "yaml") #@ load("/helpers.star", "is_any_profile_enabled", "is_package_enabled", "profiles") -#@ if is_package_enabled("contour") and is_any_profile_enabled([profiles.full, profiles.serving]): +#@ if is_package_enabled("contour"): #@ def compute_package_values(): #@ values = struct.decode(data.values.contour) diff --git a/package/config/components/flux.yml b/package/config/components/flux.yml index d4878e9..2e8222d 100644 --- a/package/config/components/flux.yml +++ b/package/config/components/flux.yml @@ -3,7 +3,7 @@ #@ load("@ytt:yaml", "yaml") #@ load("/helpers.star", "is_any_profile_enabled", "is_package_enabled", "profiles") -#@ if is_package_enabled("flux") and is_any_profile_enabled([profiles.full, profiles.serving]): +#@ if is_package_enabled("flux"): #@ def compute_package_values(): #@ return data.values.flux diff --git a/package/config/components/knative-serving.yml b/package/config/components/knative-serving.yml index d920e28..205a61c 100644 --- a/package/config/components/knative-serving.yml +++ b/package/config/components/knative-serving.yml @@ -3,7 +3,7 @@ #@ load("@ytt:yaml", "yaml") #@ load("/helpers.star", "get_issuer_name", "is_any_profile_enabled", "is_package_enabled", "profiles") -#@ if is_package_enabled("knative-serving") and is_any_profile_enabled([profiles.full, profiles.serving]): +#@ if is_package_enabled("knative-serving") and is_any_profile_enabled([profiles.full, profiles.dev, profiles.run]): #@ def compute_package_values(): #@ values = struct.decode(data.values.knative.serving) diff --git a/package/config/components/kpack.yml b/package/config/components/kpack.yml index fbd56df..4b9cd88 100644 --- a/package/config/components/kpack.yml +++ b/package/config/components/kpack.yml @@ -3,7 +3,7 @@ #@ load("@ytt:yaml", "yaml") #@ load("/helpers.star", "is_any_profile_enabled", "is_package_enabled", "profiles") -#@ if is_package_enabled("kpack") and is_any_profile_enabled([profiles.full]): +#@ if is_package_enabled("kpack") and is_any_profile_enabled([profiles.full, profiles.dev, profiles.build]): #@ def compute_package_values(): #@ values = { diff --git a/package/config/components/metrics-server.yml b/package/config/components/metrics-server.yml index ae87bb1..70d25f1 100644 --- a/package/config/components/metrics-server.yml +++ b/package/config/components/metrics-server.yml @@ -3,7 +3,7 @@ #@ load("@ytt:yaml", "yaml") #@ load("/helpers.star", "is_any_profile_enabled", "is_package_enabled", "profiles") -#@ if is_package_enabled("metrics-server") and is_any_profile_enabled([profiles.full, profiles.serving]): +#@ if is_package_enabled("metrics-server"): #@ def compute_package_values(): #@ return data.values.metrics_server diff --git a/package/config/components/secretgen-controller.yml b/package/config/components/secretgen-controller.yml index d2a6fef..509fb77 100644 --- a/package/config/components/secretgen-controller.yml +++ b/package/config/components/secretgen-controller.yml @@ -3,7 +3,7 @@ #@ load("@ytt:yaml", "yaml") #@ load("/helpers.star", "is_any_profile_enabled", "is_package_enabled", "profiles") -#@ if is_package_enabled("secretgen-controller") and is_any_profile_enabled([profiles.full, profiles.serving]): +#@ if is_package_enabled("secretgen-controller"): #@ def compute_package_values(): #@ return data.values.secretgen_controller diff --git a/package/config/components/spring-boot-conventions.yml b/package/config/components/spring-boot-conventions.yml index ddbd6cc..5b53bfe 100644 --- a/package/config/components/spring-boot-conventions.yml +++ b/package/config/components/spring-boot-conventions.yml @@ -3,7 +3,7 @@ #@ load("@ytt:yaml", "yaml") #@ load("/helpers.star", "is_any_profile_enabled", "is_package_enabled", "profiles") -#@ if is_package_enabled("spring-boot-conventions") and is_any_profile_enabled([profiles.full]): +#@ if is_package_enabled("spring-boot-conventions") and is_any_profile_enabled([profiles.full, profiles.dev, profiles.build]): #@ def compute_package_values(): #@ return data.values.conventions.spring_boot diff --git a/package/config/components/tekton-catalog.yml b/package/config/components/tekton-catalog.yml index a49fd64..2505ba1 100644 --- a/package/config/components/tekton-catalog.yml +++ b/package/config/components/tekton-catalog.yml @@ -3,7 +3,7 @@ #@ load("@ytt:yaml", "yaml") #@ load("/helpers.star", "is_any_profile_enabled", "is_package_enabled", "profiles") -#@ if is_package_enabled("tekton-catalog") and is_any_profile_enabled([profiles.full]): +#@ if is_package_enabled("tekton-catalog") and is_any_profile_enabled([profiles.full, profiles.dev, profiles.build]): #@ def compute_package_values(): #@ return data.values.tekton.catalog diff --git a/package/config/components/tekton-pipelines.yml b/package/config/components/tekton-pipelines.yml index af5d9a8..8e28972 100644 --- a/package/config/components/tekton-pipelines.yml +++ b/package/config/components/tekton-pipelines.yml @@ -3,7 +3,7 @@ #@ load("@ytt:yaml", "yaml") #@ load("/helpers.star", "is_any_profile_enabled", "is_package_enabled", "profiles") -#@ if is_package_enabled("tekton-pipelines") and is_any_profile_enabled([profiles.full]): +#@ if is_package_enabled("tekton-pipelines") and is_any_profile_enabled([profiles.full, profiles.dev, profiles.build]): #@ def compute_package_values(): #@ values = struct.decode(data.values.tekton.pipelines) diff --git a/package/config/components/workspace-provisioner.yml b/package/config/components/workspace-provisioner.yml index f980680..34a45de 100644 --- a/package/config/components/workspace-provisioner.yml +++ b/package/config/components/workspace-provisioner.yml @@ -3,7 +3,7 @@ #@ load("@ytt:yaml", "yaml") #@ load("/helpers.star", "is_any_profile_enabled", "is_package_enabled", "profiles") -#@ if is_package_enabled("workspace-provisioner") and is_any_profile_enabled([profiles.full, profiles.serving]): +#@ if is_package_enabled("workspace-provisioner"): #@ def compute_package_values(): #@ values = struct.decode(data.values.workspace_provisioner) diff --git a/package/config/helpers.star b/package/config/helpers.star index 3a4a01f..cb35235 100644 --- a/package/config/helpers.star +++ b/package/config/helpers.star @@ -3,7 +3,9 @@ load("@ytt:struct", "struct") profiles = struct.make( full="full", - serving="serving" + dev="dev", + build="build", + run="run" ) def is_package_enabled(name): diff --git a/package/config/profiles/platform-info.yml b/package/config/profiles/platform-info.yml new file mode 100644 index 0000000..967112d --- /dev/null +++ b/package/config/profiles/platform-info.yml @@ -0,0 +1,10 @@ +#@ load("@ytt:data", "data") + +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: platform-info + namespace: #@ data.values.platform.namespace +data: + profile: #@ data.values.platform.profile diff --git a/package/config/values-schema.yml b/package/config/values-schema.yml index 48ba003..d15c1d1 100644 --- a/package/config/values-schema.yml +++ b/package/config/values-schema.yml @@ -4,9 +4,9 @@ #@schema/desc "Configuration for the platform packages." platform: - #@schema/desc "The platform profile to install. Options: `full`, `serving`." - #@schema/validation one_of=["full", "serving"] - profile: full + #@schema/desc "The platform profile to install. Options: `full`, `dev`, `build`, `run`." + #@schema/validation one_of=["full", "dev", "build", "run"] + profile: run #@schema/desc "The type of supply chain to deploy. Options: `basic`, `advanced`." #@schema/validation one_of=["basic", "advanced"] supply_chain: basic diff --git a/test/integration/run/00-assert.yaml b/test/integration/run/00-assert.yaml new file mode 100644 index 0000000..c078865 --- /dev/null +++ b/test/integration/run/00-assert.yaml @@ -0,0 +1,8 @@ +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: platform-info + namespace: kadras-packages +data: + profile: run diff --git a/test/integration/serving/00-install.yaml b/test/integration/run/00-install.yaml similarity index 62% rename from test/integration/serving/00-install.yaml rename to test/integration/run/00-install.yaml index 3f1bb4e..818f0cf 100644 --- a/test/integration/serving/00-install.yaml +++ b/test/integration/run/00-install.yaml @@ -5,4 +5,4 @@ commands: - script: | cd ../../../package && \ kubectl config set-context --current --namespace=tests && \ - ytt -f ../test/integration/serving/config -f package-resources.yml | kctrl dev -f- --local -y + ytt -f ../test/integration/run/config -f package-resources.yml | kctrl dev -f- --local -y diff --git a/test/integration/serving/01-application.yaml b/test/integration/run/01-application.yaml similarity index 100% rename from test/integration/serving/01-application.yaml rename to test/integration/run/01-application.yaml diff --git a/test/integration/serving/01-assert.yaml b/test/integration/run/01-assert.yaml similarity index 100% rename from test/integration/serving/01-assert.yaml rename to test/integration/run/01-assert.yaml diff --git a/test/integration/serving/02-uninstall.yaml b/test/integration/run/02-uninstall.yaml similarity index 60% rename from test/integration/serving/02-uninstall.yaml rename to test/integration/run/02-uninstall.yaml index 4fbb14e..8c64b63 100644 --- a/test/integration/serving/02-uninstall.yaml +++ b/test/integration/run/02-uninstall.yaml @@ -5,4 +5,4 @@ commands: - script: | cd ../../../package && \ kubectl config set-context --current --namespace=tests && \ - ytt -f ../test/integration/serving/config -f package-resources.yml | kctrl dev -f- --local --delete -y + ytt -f ../test/integration/run/config -f package-resources.yml | kctrl dev -f- --local --delete -y diff --git a/test/integration/serving/config/overlay.yml b/test/integration/run/config/overlay.yml similarity index 100% rename from test/integration/serving/config/overlay.yml rename to test/integration/run/config/overlay.yml diff --git a/test/integration/serving/config/values.yml b/test/integration/run/config/values.yml similarity index 72% rename from test/integration/serving/config/values.yml rename to test/integration/run/config/values.yml index af1d3f4..f55b76c 100644 --- a/test/integration/serving/config/values.yml +++ b/test/integration/run/config/values.yml @@ -7,10 +7,13 @@ metadata: stringData: values.yaml: | platform: - profile: serving + profile: run infrastructure_provider: local ingress: domain: 127.0.0.1.sslip.io excluded_packages: + - cartographer-blueprints + - cartographer-delivery + - cartographer - flux - kyverno