diff --git a/Makefile b/Makefile index 516193f07..06f361ada 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION=v0.1.1 +VERSION=v0.1.2 OUT_DIR=dist YEAR?=$(shell date +"%Y") diff --git a/cmd/commands/runtime.go b/cmd/commands/runtime.go index 5821a3d09..a591d9548 100644 --- a/cmd/commands/runtime.go +++ b/cmd/commands/runtime.go @@ -900,14 +900,6 @@ func runRuntimeUpgrade(ctx context.Context, opts *RuntimeUpgradeOptions) error { return fmt.Errorf("failed to load current runtime definition: %w", err) } - if !newRt.Spec.Version.GreaterThan(curRt.Spec.Version) { - err = fmt.Errorf("current runtime version (%s) is greater than or equal to the specified version (%s)", curRt.Spec.Version, newRt.Spec.Version) - } - handleCliStep(reporter.UpgradeStepLoadRuntimeDefinition, "Comparing runtime versions", err, true, false) - if err != nil { - return err - } - log.G(ctx).Infof("Upgrading runtime \"%s\" to version: v%s", opts.RuntimeName, newRt.Spec.Version) newComponents, err := curRt.Upgrade(fs, newRt, opts.CommonConfig) handleCliStep(reporter.UpgradeStepUpgradeRuntime, "Upgrading runtime", err, false, false) diff --git a/cmd/commands/runtime_install.go b/cmd/commands/runtime_install.go index e9b08d4d5..2aa34f42e 100644 --- a/cmd/commands/runtime_install.go +++ b/cmd/commands/runtime_install.go @@ -2153,5 +2153,5 @@ func getRuntimeDef(runtimeDef, versionStr string) string { if strings.Contains(runtimeDef, "cli-v2") { return strings.Replace(runtimeDef, "/releases/latest/download", "/releases/download/v"+version.String(), 1) } - return runtimeDef + "?ref=v" + version.String() + return strings.Replace(runtimeDef, "stable", version.String(), 1) } diff --git a/docs/releases/release_notes.md b/docs/releases/release_notes.md index 2e04aeef0..b8d48c19e 100644 --- a/docs/releases/release_notes.md +++ b/docs/releases/release_notes.md @@ -23,7 +23,7 @@ cf version ```bash # download and extract the binary -curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.1.1/cf-linux-amd64.tar.gz | tar zx +curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.1.2/cf-linux-amd64.tar.gz | tar zx # move the binary to your $PATH mv ./cf-linux-amd64 /usr/local/bin/cf @@ -36,7 +36,7 @@ cf version ```bash # download and extract the binary -curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.1.1/cf-darwin-amd64.tar.gz | tar zx +curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/v0.1.2/cf-darwin-amd64.tar.gz | tar zx # move the binary to your $PATH mv ./cf-darwin-amd64 /usr/local/bin/cf diff --git a/hack/get-manifests-location.sh b/hack/get-manifests-location.sh index 15b3b0b1f..bb6c385c0 100755 --- a/hack/get-manifests-location.sh +++ b/hack/get-manifests-location.sh @@ -5,15 +5,16 @@ BRANCH="$1" DEFAULT_MANIFESTS_LOCATION="https://raw.githubusercontent.com/codefresh-io/csdp-official/stable/csdp/hybrid/basic/runtime.yaml" RUNTIME_DEFINITION_URL="https://raw.githubusercontent.com/codefresh-io/csdp-official/$BRANCH/csdp/hybrid/basic/runtime.yaml" +RUNTIME_DEFINITION_FILE="/codefresh/volume/runtime.yaml" git ls-remote --heads ${REPO} ${BRANCH} | grep ${BRANCH} >/dev/null if [ "$?" == "1" ]; then # No matching branch was found in csdp-official - echo "$DEFAULT_MANIFESTS_LOCATION" + curl --silent "$DEFAULT_MANIFESTS_LOCATION" > $RUNTIME_DEFINITION_FILE + echo $RUNTIME_DEFINITION_FILE exit 0 fi -RUNTIME_DEFINITION_FILE="/codefresh/volume/runtime.yaml" -curl --silent "$RUNTIME_DEFINITION_URL" | yq "(.spec.components[] | select(.type == \"kustomize\") | .url) += \"?ref=$BRANCH\"" | yq ".spec.bootstrapSpecifier += \"?ref=$BRANCH\"" >$RUNTIME_DEFINITION_FILE +curl --silent "$RUNTIME_DEFINITION_URL" | yq "(.spec.components[] | select(.type == \"kustomize\") | .url) += \"?ref=$BRANCH\"" | yq ".spec.bootstrapSpecifier += \"?ref=$BRANCH\"" > $RUNTIME_DEFINITION_FILE echo $RUNTIME_DEFINITION_FILE diff --git a/pkg/runtime/runtime.go b/pkg/runtime/runtime.go index 2924655e6..549a09fd9 100644 --- a/pkg/runtime/runtime.go +++ b/pkg/runtime/runtime.go @@ -504,7 +504,7 @@ func GetRuntimeDefURL(versionStr string) string { version := semver.MustParse(versionStr) if version.Compare(store.Get().LastRuntimeVersionInCLI) <= 0 { - runtimeDefURL = store.Get().RuntimeDefURL + runtimeDefURL = store.Get().OldRuntimeDefURL } return runtimeDefURL diff --git a/pkg/util/kube/kube.go b/pkg/util/kube/kube.go index 725808b55..c4c9ed1f0 100644 --- a/pkg/util/kube/kube.go +++ b/pkg/util/kube/kube.go @@ -625,6 +625,9 @@ func DeleteSecretWithFinalizer(ctx context.Context, kubeFactory kube.Factory, se } err = client.CoreV1().Secrets(secret.Namespace).Delete(ctx, secret.Name, metav1.DeleteOptions{}) + if errors.IsNotFound(err) { + return nil + } return err }