From e6748d4413504c0c4e66754e53d8021fcb1a722a Mon Sep 17 00:00:00 2001 From: Adam Krpan Date: Tue, 8 Oct 2019 09:17:20 -0700 Subject: [PATCH 1/5] Added a line to delete the SSL secret in the uninstall step --- pkg/puctl/pure1unplugged/uninstall.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/puctl/pure1unplugged/uninstall.go b/pkg/puctl/pure1unplugged/uninstall.go index 03a36468..f6a029ed 100644 --- a/pkg/puctl/pure1unplugged/uninstall.go +++ b/pkg/puctl/pure1unplugged/uninstall.go @@ -17,6 +17,7 @@ package pure1unplugged import ( "errors" "fmt" + "github.com/PureStorage-OpenConnect/pure1-unplugged/pkg/puctl/kube" "github.com/PureStorage-OpenConnect/pure1-unplugged/pkg/util/cli" ) @@ -62,7 +63,13 @@ func helmDeleteWithPurge(ctx cli.Context) error { // We know that the helm delete will leave behind PVC's and the namespace (helm purposely won't delete them..) // this is our chance to remove them func deleteLeftovers(ctx cli.Context) error { - _, err := kube.RunKubeCTLWithNamespace(ctx.Exec, kube.Pure1UnpluggedNamespace, "delete", "pvc", "--all") + _, err := kube.RunKubeCTLWithNamespace(ctx.Exec, kube.Pure1UnpluggedNamespace, "delete", "secret", pure1unpluggedHTTPSCertSecretName, "--ignore-not-found", "true") + if err != nil { + err = fmt.Errorf("failed to delete SSL secret: %s", err.Error()) + return err + } + + _, err = kube.RunKubeCTLWithNamespace(ctx.Exec, kube.Pure1UnpluggedNamespace, "delete", "pvc", "--all") if err != nil { err = fmt.Errorf("failed to delete PVC's: %s", err.Error()) return err From e7de825f7c7df1dd445743aa35eb43ec3b0b3e4f Mon Sep 17 00:00:00 2001 From: Adam Krpan Date: Wed, 16 Oct 2019 09:26:24 -0700 Subject: [PATCH 2/5] Added cron to run pipeline at 6 AM every day --- Jenkinsfile | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b052c9c3..3414b47c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -22,18 +22,24 @@ def runStageWithTimeout(String stageName, int timeoutMinutes, Closure stageToRun } } -properties( - [ - [$class: 'BuildDiscarderProperty', - strategy: [ - $class: 'LogRotator', - artifactDaysToKeepStr: '', - artifactNumToKeepStr: '10', - daysToKeepStr: '', - numToKeepStr: '10'] +props = [ + [ + $class: 'BuildDiscarderProperty', + strategy: [ + $class: 'LogRotator', + artifactDaysToKeepStr: '2', + artifactNumToKeepStr: '', + daysToKeepStr: '2', + numToKeepStr: '' ] + ], ] -) + +if (env.BRANCH_NAME == "master") { + props.add(pipelineTriggers([cron('0 13 * * *')])) +} + +properties(props) node('pure1-unplugged') { try { From 0b5da1f8445a1fd0d996e5cc23cd633e5989bf2d Mon Sep 17 00:00:00 2001 From: Adam Krpan <39928371+Pure-AdamuKaapan@users.noreply.github.com> Date: Wed, 19 Feb 2020 12:43:07 -0800 Subject: [PATCH 3/5] Added kubernetes version flag to minikube --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 10ad522c..d0440386 100644 --- a/README.md +++ b/README.md @@ -27,8 +27,8 @@ _Example_: `make go-clean go-prep go-auth-server` runs the targets `clean prep a * Web content: `make test-web-content` ### Local deployment -1. Start minikube with at least 6GB memory and 40GB disk - * `minikube start --memory 6144 --disk-size 40g` +1. Start minikube with at least 6GB memory and 40GB disk, and with the proper Kubernetes version. + * `minikube start --memory 6144 --disk-size 40g --kubernetes-version v1.13.4` 2. Build with `make all-minikube` * Note that build output goes into `./build/*`, and this `minikube` build mode will *not* create the installer ISO 3. Deploy with `./scripts/deploy/helm_install.sh $(minikube ip)` From 4b29e2c485befe1f5a780657cf777722fda183eb Mon Sep 17 00:00:00 2001 From: Adam Krpan Date: Mon, 23 Nov 2020 10:47:58 -0800 Subject: [PATCH 4/5] Changed the default query size to 1000 if not specified This fixes a bug where fleets with >10 devices would only show the first 10 (filters would show the rest) --- pkg/clients/elastic/arrays.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/clients/elastic/arrays.go b/pkg/clients/elastic/arrays.go index 244b7247..9ac3d8e9 100644 --- a/pkg/clients/elastic/arrays.go +++ b/pkg/clients/elastic/arrays.go @@ -40,6 +40,10 @@ func (c *Client) FindArrays(query *resources.ArrayQuery) ([]*resources.Array, er searchService := c.esclient.Search(arraysIndexName).Type("_doc").Query(query.GenerateElasticQueryObject()).From(query.Offset).IgnoreUnavailable(true).AllowNoIndices(true) if query.Limit > 0 { searchService.Size(query.Limit) + } else { + // Default to 1000 results if not specified (should be bigger than any "practical" fleet size to ensure returning + // all results) + searchService.Size(1000) } if len(query.Sort) > 0 { sortParam, err := query.GetSortParameter() From c6dd8da24d916fc0f83c0c5c1163663358bab1b7 Mon Sep 17 00:00:00 2001 From: Adam Krpan Date: Mon, 23 Nov 2020 10:48:54 -0800 Subject: [PATCH 5/5] Fixes for build pipeline --- images/lorax-build/Dockerfile | 2 +- scripts/build/build_lorax_image.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/images/lorax-build/Dockerfile b/images/lorax-build/Dockerfile index 04a30023..eca3de10 100644 --- a/images/lorax-build/Dockerfile +++ b/images/lorax-build/Dockerfile @@ -32,7 +32,7 @@ RUN yum update -y && yum install -y \ # Note we install kubeadm only so we can snag a list of its required images with the config shipped # for this version of kubeadm (matches the one we install with our installer iso). -RUN gem install --no-ri --no-rdoc fpm +RUN gem install --no-ri --no-rdoc fpm -f COPY images/lorax-build/lorax.conf /etc/lorax/ diff --git a/scripts/build/build_lorax_image.sh b/scripts/build/build_lorax_image.sh index 04e23c55..7b522602 100755 --- a/scripts/build/build_lorax_image.sh +++ b/scripts/build/build_lorax_image.sh @@ -19,6 +19,7 @@ if [[ -z "${KUBEVERSION}" ]]; then fi docker build \ + --no-cache \ -t lorax-build:${VERSION} \ --build-arg "KUBERNETES_VERSION=${KUBEVERSION}" \ -f ${REPO_ROOT}/images/lorax-build/Dockerfile \