Skip to content

Commit

Permalink
installer: make chart url configureble
Browse files Browse the repository at this point in the history
Signed-off-by: sallyom <[email protected]>
  • Loading branch information
sallyom committed Dec 11, 2023
1 parent bf16675 commit f023ec9
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Chart.lock
# Vim swap files
*.swp

*.tgz

*tas-env-variables*
keys-cert
./keys-cert/*.pem
Expand All @@ -12,4 +14,4 @@ keys-cert
.idea

tas-install
pull-secret.json
pull-secret.json
2 changes: 1 addition & 1 deletion charts/trusted-artifact-signer/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ sources:
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.28
version: 0.1.29
2 changes: 1 addition & 1 deletion charts/trusted-artifact-signer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

A Helm chart for deploying Sigstore scaffold chart that is opinionated for OpenShift

![Version: 0.1.28](https://img.shields.io/badge/Version-0.1.28-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
![Version: 0.1.29](https://img.shields.io/badge/Version-0.1.29-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

## Overview

Expand Down
6 changes: 4 additions & 2 deletions tas-installer/cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const (
)

var (
helmChartURL string
helmChartVersion string
helmValuesFile string
)
Expand Down Expand Up @@ -68,7 +69,7 @@ func installTas(tasNamespace string) error {
},
func() error {
log.Print("installing helm chart")
if err := install.HandleHelmChartInstall(kc, tasNamespace, tasReleaseName, helmValuesFile, helmChartVersion); err != nil {
if err := install.HandleHelmChartInstall(kc, tasNamespace, tasReleaseName, helmValuesFile, helmChartURL, helmChartVersion); err != nil {
return err
}
return nil
Expand All @@ -83,7 +84,8 @@ func installTas(tasNamespace string) error {
}

func init() {
installCmd.PersistentFlags().StringVar(&helmChartVersion, "chartVersion", "0.1.26", "Version of the Helm chart")
installCmd.PersistentFlags().StringVar(&helmChartVersion, "chartVersion", "0.1.29", "Version of the Helm chart")
installCmd.PersistentFlags().StringVar(&helmChartURL, "chartURL", "oci://quay.io/redhat-user-workloads/arewm-tenant/sigstore-ocp/trusted-artifact-signer", "Version of the Helm chart")
installCmd.PersistentFlags().StringVar(&helmValuesFile, "valuesFile", "", "Custom values file for chart configuration")
}

Expand Down
4 changes: 2 additions & 2 deletions tas-installer/internal/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"time"
)

func HandleHelmChartInstall(kc *kubernetes.KubernetesClient, tasNamespace, tasReleaseName, helmValuesFile, helmChartVersion string) error {
if err := helm.InstallTrustedArtifactSigner(kc, tasNamespace, tasReleaseName, helmValuesFile, helmChartVersion); err != nil {
func HandleHelmChartInstall(kc *kubernetes.KubernetesClient, tasNamespace, tasReleaseName, helmValuesFile, helmChartURL, helmChartVersion string) error {
if err := helm.InstallTrustedArtifactSigner(kc, tasNamespace, tasReleaseName, helmValuesFile, helmChartURL, helmChartVersion); err != nil {
return err
}
return nil
Expand Down
4 changes: 1 addition & 3 deletions tas-installer/pkg/helm/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ func UninstallTrustedArtifactSigner(tasNamespace, tasReleaseName string) (*relea
return action.NewUninstall(actionConfig).Run(tasReleaseName)
}

func InstallTrustedArtifactSigner(kc *kubernetes.KubernetesClient, tasNamespace, tasReleaseName, pathToValuesFile, chartVersion string) error {
chartUrl := "oci://quay.io/redhat-user-workloads/arewm-tenant/sigstore-ocp/trusted-artifact-signer"

func InstallTrustedArtifactSigner(kc *kubernetes.KubernetesClient, tasNamespace, tasReleaseName, pathToValuesFile, chartUrl, chartVersion string) error {
tv := templatedValues{
OpenShiftAppsSubdomain: kc.ClusterCommonName,
}
Expand Down

0 comments on commit f023ec9

Please sign in to comment.