Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helm release lifecycle management endpoints #4580

Merged

Conversation

akashshinde
Copy link
Contributor

@akashshinde akashshinde commented Mar 2, 2020

This PR adds following endpoints

  1. Delete Helm release - DELETE /api/helm/release
  2. Rollback Helm Release - PATCH /api/helm/release
  3. Upgrade Helm Release - PUT /api/helm/release
  4. Get Release History - GET /api/helm/release/history

Release Details Response

{
  "name": "nodejs",
  "info": {
    "first_deployed": "2020-03-11T19:12:19.78045+05:30",
    "last_deployed": "2020-03-11T19:12:19.78045+05:30",
    "deleted": "",
    "description": "Install complete",
    "status": "deployed"
  },
  "chart": {
    "metadata": {
      "name": "nodejs-ex-k",
      "version": "0.1.0",
      "description": "A Helm chart for Kubernetes",
      "apiVersion": "v2",
      "appVersion": "1.16.0",
      "type": "application"
    },
    "lock": null,
    "templates": [
      {
        "name": "templates/_helpers.tpl",
        "data": "e3svKiB2aW06IHNldCBmaWxldHlwZT1tdXN0YWNoZTogKi99fQp7ey8qCkV4cGFuZCB0aGUgbmFtZSBvZiB0aGUgY2hhcnQuCiovfX0Ke3stIGRlZmluZSAibm9kZWpzLWV4LWsubmFtZSIgLX19Cnt7LSBkZWZhdWx0IC5DaGFydC5OYW1lIC5WYWx1ZXMubmFtZU92ZXJyaWRlIHwgdHJ1bmMgNjMgfCB0cmltU3VmZml4ICItIiAtfX0Ke3stIGVuZCAtfX0KCnt7LyoKQ3JlYXRlIGEgZGVmYXVsdCBmdWxseSBxdWFsaWZpZWQgYXBwIG5hbWUuCldlIHRydW5jYXRlIGF0IDYzIGNoYXJzIGJlY2F1c2Ugc29tZSBLdWJlcm5ldGVzIG5hbWUgZmllbGRzIGFyZSBsaW1pdGVkIHRvIHRoaXMgKGJ5IHRoZSBETlMgbmFtaW5nIHNwZWMpLgpJZiByZWxlYXNlIG5hbWUgY29udGFpbnMgY2hhcnQgbmFtZSBpdCB3aWxsIGJlIHVzZWQgYXMgYSBmdWxsIG5hbWUuCiovfX0Ke3stIGRlZmluZSAibm9kZWpzLWV4LWsuZnVsbG5hbWUiIC19fQp7ey0gaWYgLlZhbHVlcy5mdWxsbmFtZU92ZXJyaWRlIC19fQp7ey0gLlZhbHVlcy5mdWxsbmFtZU92ZXJyaWRlIHwgdHJ1bmMgNjMgfCB0cmltU3VmZml4ICItIiAtfX0Ke3stIGVsc2UgLX19Cnt7LSAkbmFtZSA6PSBkZWZhdWx0IC5DaGFydC5OYW1lIC5WYWx1ZXMubmFtZU92ZXJyaWRlIC19fQp7ey0gaWYgY29udGFpbnMgJG5hbWUgLlJlbGVhc2UuTmFtZSAtfX0Ke3stIC5SZWxlYXNlLk5hbWUgfCB0cnVuYyA2MyB8IHRyaW1TdWZmaXggIi0iIC19fQp7ey0gZWxzZSAtfX0Ke3stIHByaW50ZiAiJXMtJXMiIC5SZWxlYXNlLk5hbWUgJG5hbWUgfCB0cnVuYyA2MyB8IHRyaW1TdWZmaXggIi0iIC19fQp7ey0gZW5kIC19fQp7ey0gZW5kIC19fQp7ey0gZW5kIC19fQoKe3svKgpDcmVhdGUgY2hhcnQgbmFtZSBhbmQgdmVyc2lvbiBhcyB1c2VkIGJ5IHRoZSBjaGFydCBsYWJlbC4KKi99fQp7ey0gZGVmaW5lICJub2RlanMtZXgtay5jaGFydCIgLX19Cnt7LSBwcmludGYgIiVzLSVzIiAuQ2hhcnQuTmFtZSAuQ2hhcnQuVmVyc2lvbiB8IHJlcGxhY2UgIisiICJfIiB8IHRydW5jIDYzIHwgdHJpbVN1ZmZpeCAiLSIgLX19Cnt7LSBlbmQgLX19Cgp7ey8qCkNvbW1vbiBsYWJlbHMKKi99fQp7ey0gZGVmaW5lICJub2RlanMtZXgtay5sYWJlbHMiIC19fQphcHAua3ViZXJuZXRlcy5pby9uYW1lOiB7eyBpbmNsdWRlICJub2RlanMtZXgtay5uYW1lIiAuIH19CmhlbG0uc2gvY2hhcnQ6IHt7IGluY2x1ZGUgIm5vZGVqcy1leC1rLmNoYXJ0IiAuIH19CmFwcC5rdWJlcm5ldGVzLmlvL2luc3RhbmNlOiB7eyAuUmVsZWFzZS5OYW1lIH19Cnt7LSBpZiAuQ2hhcnQuQXBwVmVyc2lvbiB9fQphcHAua3ViZXJuZXRlcy5pby92ZXJzaW9uOiB7eyAuQ2hhcnQuQXBwVmVyc2lvbiB8IHF1b3RlIH19Cnt7LSBlbmQgfX0KYXBwLmt1YmVybmV0ZXMuaW8vbWFuYWdlZC1ieToge3sgLlJlbGVhc2UuU2VydmljZSB9fQp7ey0gZW5kIC19fQo="
      },
      {
        "name": "templates/buildconfig.yaml",
        "data": "a2luZDogQnVpbGRDb25maWcKYXBpVmVyc2lvbjogYnVpbGQub3BlbnNoaWZ0LmlvL3YxCm1ldGFkYXRhOgogIG5hbWU6ICJub2RlanMtZXhhbXBsZSIKICBhbm5vdGF0aW9uczoKICAgIGRlc2NyaXB0aW9uOiBEZWZpbmVzIGhvdyB0byBidWlsZCB0aGUgYXBwbGljYXRpb24Kc3BlYzoKICBzb3VyY2U6CiAgICB0eXBlOiBHaXQKICAgIGdpdDoKICAgICAgdXJpOiAiaHR0cHM6Ly9naXRodWIuY29tL3NjbG9yZy9ub2RlanMtZXguZ2l0IgogICAgICByZWY6CiAgICBjb250ZXh0RGlyOgogIHN0cmF0ZWd5OgogICAgdHlwZTogU291cmNlCiAgICBzb3VyY2VTdHJhdGVneToKICAgICAgZnJvbToKICAgICAgICBraW5kOiBJbWFnZVN0cmVhbVRhZwogICAgICAgIG5hbWVzcGFjZTogIm9wZW5zaGlmdCIKICAgICAgICBuYW1lOiBub2RlanM6MTAKICAgICAgZW52OgogICAgICAtIG5hbWU6IE5QTV9NSVJST1IKICAgICAgICB2YWx1ZToKICBvdXRwdXQ6CiAgICB0bzoKICAgICAga2luZDogSW1hZ2VTdHJlYW1UYWcKICAgICAgbmFtZTogIm5vZGVqcy1leGFtcGxlOmxhdGVzdCIKICB0cmlnZ2VyczoKICAtIHR5cGU6IEltYWdlQ2hhbmdlCiAgLSB0eXBlOiBDb25maWdDaGFuZ2UKICAtIHR5cGU6IEdpdEh1YgogICAgZ2l0aHViOgogICAgICBzZWNyZXQ6ICJjUzNBRnZwZDFETHo3QzBWVzVPVm1KaFRuWE0wcXd1T3k0SkZ0dWxWIgogIC0gdHlwZTogR2VuZXJpYwogICAgZ2VuZXJpYzoKICAgICAgc2VjcmV0OiAiZ1VFNVZiS3BBbURoejBkWU14NVZrWlVHSzMxalF4Z0UydU9mYXpOdiIKICBwb3N0Q29tbWl0OgogICAgc2NyaXB0OiBucG0gdGVzdAo="
      },
      {
        "name": "templates/deployment.yaml",
        "data": "a2luZDogRGVwbG95bWVudENvbmZpZwphcGlWZXJzaW9uOiBhcHBzLm9wZW5zaGlmdC5pby92MQptZXRhZGF0YToKICBuYW1lOiAibm9kZWpzLWV4YW1wbGUiCiAgYW5ub3RhdGlvbnM6CiAgICBkZXNjcmlwdGlvbjogRGVmaW5lcyBob3cgdG8gZGVwbG95IHRoZSBhcHBsaWNhdGlvbiBzZXJ2ZXIKICAgIHRlbXBsYXRlLmFscGhhLm9wZW5zaGlmdC5pby93YWl0LWZvci1yZWFkeTogJ3RydWUnCnNwZWM6CiAgc3RyYXRlZ3k6CiAgICB0eXBlOiBSb2xsaW5nCiAgdHJpZ2dlcnM6CiAgLSB0eXBlOiBJbWFnZUNoYW5nZQogICAgaW1hZ2VDaGFuZ2VQYXJhbXM6CiAgICAgIGF1dG9tYXRpYzogdHJ1ZQogICAgICBjb250YWluZXJOYW1lczoKICAgICAgLSBub2RlanMtZXhhbXBsZQogICAgICBmcm9tOgogICAgICAgIGtpbmQ6IEltYWdlU3RyZWFtVGFnCiAgICAgICAgbmFtZTogIm5vZGVqcy1leGFtcGxlOmxhdGVzdCIKICAtIHR5cGU6IENvbmZpZ0NoYW5nZQogIHJlcGxpY2FzOiAxCiAgc2VsZWN0b3I6CiAgICBuYW1lOiAibm9kZWpzLWV4YW1wbGUiCiAgdGVtcGxhdGU6CiAgICBtZXRhZGF0YToKICAgICAgbmFtZTogIm5vZGVqcy1leGFtcGxlIgogICAgICBsYWJlbHM6CiAgICAgICAgbmFtZTogIm5vZGVqcy1leGFtcGxlIgogICAgc3BlYzoKICAgICAgY29udGFpbmVyczoKICAgICAgLSBuYW1lOiBub2RlanMtZXhhbXBsZQogICAgICAgIGltYWdlOiAiICIKICAgICAgICBwb3J0czoKICAgICAgICAtIGNvbnRhaW5lclBvcnQ6IDgwODAKICAgICAgICByZWFkaW5lc3NQcm9iZToKICAgICAgICAgIHRpbWVvdXRTZWNvbmRzOiAzCiAgICAgICAgICBpbml0aWFsRGVsYXlTZWNvbmRzOiAzCiAgICAgICAgICBodHRwR2V0OgogICAgICAgICAgICBwYXRoOiAiLyIKICAgICAgICAgICAgcG9ydDogODA4MAogICAgICAgIGxpdmVuZXNzUHJvYmU6CiAgICAgICAgICB0aW1lb3V0U2Vjb25kczogMwogICAgICAgICAgaW5pdGlhbERlbGF5U2Vjb25kczogMzAKICAgICAgICAgIGh0dHBHZXQ6CiAgICAgICAgICAgIHBhdGg6ICIvIgogICAgICAgICAgICBwb3J0OiA4MDgwCiAgICAgICAgcmVzb3VyY2VzOgogICAgICAgICAgbGltaXRzOgogICAgICAgICAgICBtZW1vcnk6ICI1MTJNaSI="
      },
      {
        "name": "templates/imagestream.yaml",
        "data": "a2luZDogSW1hZ2VTdHJlYW0KYXBpVmVyc2lvbjogaW1hZ2Uub3BlbnNoaWZ0LmlvL3YxCm1ldGFkYXRhOgogIG5hbWU6ICJub2RlanMtZXhhbXBsZSIKICBhbm5vdGF0aW9uczoKICAgIGRlc2NyaXB0aW9uOiBLZWVwcyB0cmFjayBvZiBjaGFuZ2VzIGluIHRoZSBhcHBsaWNhdGlvbiBpbWFnZQ=="
      },
      {
        "name": "templates/route.yaml",
        "data": "a2luZDogUm91dGUKYXBpVmVyc2lvbjogcm91dGUub3BlbnNoaWZ0LmlvL3YxCm1ldGFkYXRhOgogIG5hbWU6ICJub2RlanMtZXhhbXBsZSIKc3BlYzoKICBob3N0OiAKICB0bzoKICAgIGtpbmQ6IFNlcnZpY2UKICAgIG5hbWU6ICJub2RlanMtZXhhbXBsZSI="
      },
      {
        "name": "templates/service.yaml",
        "data": "a2luZDogU2VydmljZQphcGlWZXJzaW9uOiB2MQptZXRhZGF0YToKICBuYW1lOiAibm9kZWpzLWV4YW1wbGUiCiAgYW5ub3RhdGlvbnM6CiAgICBkZXNjcmlwdGlvbjogRXhwb3NlcyBhbmQgbG9hZCBiYWxhbmNlcyB0aGUgYXBwbGljYXRpb24gcG9kcwpzcGVjOgogIHBvcnRzOgogIC0gbmFtZTogd2ViCiAgICBwb3J0OiA4MDgwCiAgICB0YXJnZXRQb3J0OiA4MDgwCiAgc2VsZWN0b3I6CiAgICBuYW1lOiAibm9kZWpzLWV4YW1wbGUi"
      }
    ],
    "values": {
      "affinity": {},
      "fullnameOverride": "",
      "image": {
        "pullPolicy": "IfNotPresent",
        "repository": "nginx"
      },
      "ingress": {
        "annotations": {},
        "enabled": false,
        "hosts": [
          {
            "host": "chart-example.local",
            "paths": []
          }
        ],
        "tls": []
      },
      "nameOverride": "",
      "replicaCount": 1,
      "resources": {},
      "service": {
        "port": 80,
        "type": "ClusterIP"
      },
      "tolerations": []
    },
    "schema": null,
    "files": [
      {
        "name": ".helmignore",
        "data": "IyBQYXR0ZXJucyB0byBpZ25vcmUgd2hlbiBidWlsZGluZyBwYWNrYWdlcy4KIyBUaGlzIHN1cHBvcnRzIHNoZWxsIGdsb2IgbWF0Y2hpbmcsIHJlbGF0aXZlIHBhdGggbWF0Y2hpbmcsIGFuZAojIG5lZ2F0aW9uIChwcmVmaXhlZCB3aXRoICEpLiBPbmx5IG9uZSBwYXR0ZXJuIHBlciBsaW5lLgouRFNfU3RvcmUKIyBDb21tb24gVkNTIGRpcnMKLmdpdC8KLmdpdGlnbm9yZQouYnpyLwouYnpyaWdub3JlCi5oZy8KLmhnaWdub3JlCi5zdm4vCiMgQ29tbW9uIGJhY2t1cCBmaWxlcwoqLnN3cAoqLmJhawoqLnRtcAoqfgojIFZhcmlvdXMgSURFcwoucHJvamVjdAouaWRlYS8KKi50bXByb2oK"
      },
      {
        "name": "kustomization.yaml",
        "data": "Y29tbW9uTGFiZWxzOgogIGFwcDogbm9kZWpzLWV4LWt1c3RvbWl6ZQoKcmVzb3VyY2VzOgogIC0gdGVtcGxhdGVzL3NlcnZpY2UueWFtbAogIC0gdGVtcGxhdGVzL2J1aWxkY29uZmlnLnlhbWw="
      }
    ]
  },
  "manifest": "---\n# Source: nodejs-ex-k/templates/service.yaml\nkind: Service\napiVersion: v1\nmetadata:\n  name: \"nodejs-example\"\n  annotations:\n    description: Exposes and load balances the application pods\nspec:\n  ports:\n  - name: web\n    port: 8080\n    targetPort: 8080\n  selector:\n    name: \"nodejs-example\"\n---\n# Source: nodejs-ex-k/templates/buildconfig.yaml\nkind: BuildConfig\napiVersion: build.openshift.io/v1\nmetadata:\n  name: \"nodejs-example\"\n  annotations:\n    description: Defines how to build the application\nspec:\n  source:\n    type: Git\n    git:\n      uri: \"https://github.com/sclorg/nodejs-ex.git\"\n      ref:\n    contextDir:\n  strategy:\n    type: Source\n    sourceStrategy:\n      from:\n        kind: ImageStreamTag\n        namespace: \"openshift\"\n        name: nodejs:10\n      env:\n      - name: NPM_MIRROR\n        value:\n  output:\n    to:\n      kind: ImageStreamTag\n      name: \"nodejs-example:latest\"\n  triggers:\n  - type: ImageChange\n  - type: ConfigChange\n  - type: GitHub\n    github:\n      secret: \"cS3AFvpd1DLz7C0VW5OVmJhTnXM0qwuOy4JFtulV\"\n  - type: Generic\n    generic:\n      secret: \"gUE5VbKpAmDhz0dYMx5VkZUGK31jQxgE2uOfazNv\"\n  postCommit:\n    script: npm test\n---\n# Source: nodejs-ex-k/templates/deployment.yaml\nkind: DeploymentConfig\napiVersion: apps.openshift.io/v1\nmetadata:\n  name: \"nodejs-example\"\n  annotations:\n    description: Defines how to deploy the application server\n    template.alpha.openshift.io/wait-for-ready: 'true'\nspec:\n  strategy:\n    type: Rolling\n  triggers:\n  - type: ImageChange\n    imageChangeParams:\n      automatic: true\n      containerNames:\n      - nodejs-example\n      from:\n        kind: ImageStreamTag\n        name: \"nodejs-example:latest\"\n  - type: ConfigChange\n  replicas: 1\n  selector:\n    name: \"nodejs-example\"\n  template:\n    metadata:\n      name: \"nodejs-example\"\n      labels:\n        name: \"nodejs-example\"\n    spec:\n      containers:\n      - name: nodejs-example\n        image: \" \"\n        ports:\n        - containerPort: 8080\n        readinessProbe:\n          timeoutSeconds: 3\n          initialDelaySeconds: 3\n          httpGet:\n            path: \"/\"\n            port: 8080\n        livenessProbe:\n          timeoutSeconds: 3\n          initialDelaySeconds: 30\n          httpGet:\n            path: \"/\"\n            port: 8080\n        resources:\n          limits:\n            memory: \"512Mi\"\n---\n# Source: nodejs-ex-k/templates/imagestream.yaml\nkind: ImageStream\napiVersion: image.openshift.io/v1\nmetadata:\n  name: \"nodejs-example\"\n  annotations:\n    description: Keeps track of changes in the application image\n---\n# Source: nodejs-ex-k/templates/route.yaml\nkind: Route\napiVersion: route.openshift.io/v1\nmetadata:\n  name: \"nodejs-example\"\nspec:\n  host: \n  to:\n    kind: Service\n    name: \"nodejs-example\"\n",
  "version": 1,
  "namespace": "akash-helm-server"
}

Following things are pending.

  • Negative Unit tests
  • Handler Unit tests
  • Add Docs

@openshift-ci-robot openshift-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 2, 2020
@openshift-ci-robot openshift-ci-robot added the component/backend Related to backend label Mar 2, 2020
pkg/helm/actions/rollback_release.go Outdated Show resolved Hide resolved
pkg/helm/actions/upgrade_release.go Outdated Show resolved Hide resolved
pkg/helm/actions/upgrade_release.go Outdated Show resolved Hide resolved
pkg/helm/handlers/handlers.go Outdated Show resolved Hide resolved
pkg/helm/handlers/handlers.go Outdated Show resolved Hide resolved
pkg/helm/handlers/handlers.go Outdated Show resolved Hide resolved
pkg/helm/handlers/handlers.go Outdated Show resolved Hide resolved
pkg/helm/handlers/handlers.go Outdated Show resolved Hide resolved
@akashshinde
Copy link
Contributor Author

/test analyze

@sbose78
Copy link

sbose78 commented Mar 3, 2020

helm upgrade UI requirements : from https://issues.redhat.com/browse/APPSVC-367

  1. User can click on upgrade and is presented with a list of chart versions available in the chart repo
  2. User selects the chart version to upgrade to
  3. User is presented with a YAML editor with the chart's default values.yaml
  4. User clicks on upgrade.

So, Upgrade API should expect

  • The url of the new version of the chart, with the values dictionary, Or
  • The url of the existing version of the chart, with the different values dictionary.

helm rollback UI requirements : from https://issues.redhat.com/browse/APPSVC-367

  1. User clicks on rollback and is presented with the revisions in history of the helm release
  2. User selects a revision and clicks on rollback
  3. Helm release is rollbacked to the selected revision

So, in case of rollback, no communication with the chart repo is necessary.
The Rollback API would expect

  1. The release identifier, and
  2. The revision

Let's ensure the APIs are serving the needs of the UI. Please validate with @rohitkrai03 too.
cc @christianh814

@openshift-ci-robot openshift-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 5, 2020
@sbose78
Copy link

sbose78 commented Mar 5, 2020

/retitle APIs for modification of a helm release

@openshift-ci-robot openshift-ci-robot changed the title [WIP] Add Rest endpoints for Helm release operations. APIs for modification of a helm release Mar 5, 2020
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 5, 2020
@sbose78
Copy link

sbose78 commented Mar 5, 2020

/retitle [WIP] APIs for modification of a helm release

@openshift-ci-robot openshift-ci-robot changed the title APIs for modification of a helm release [WIP] APIs for modification of a helm release Mar 5, 2020
@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 5, 2020
pkg/helm/handlers/handlers.go Outdated Show resolved Hide resolved
pkg/helm/handlers/handlers.go Show resolved Hide resolved
pkg/helm/actions/release_history_test.go Outdated Show resolved Hide resolved
pkg/helm/actions/rollback_release.go Outdated Show resolved Hide resolved
pkg/helm/actions/rollback_release_test.go Outdated Show resolved Hide resolved
pkg/helm/actions/upgrade_release_test.go Outdated Show resolved Hide resolved
pkg/helm/handlers/handler_test.go Outdated Show resolved Hide resolved
pkg/helm/handlers/request.go Outdated Show resolved Hide resolved
pkg/helm/handlers/handler_test.go Outdated Show resolved Hide resolved
pkg/server/server.go Outdated Show resolved Hide resolved
@pedjak
Copy link
Contributor

pedjak commented Mar 6, 2020

Need to document the additional endpoints.

@pedjak
Copy link
Contributor

pedjak commented Mar 6, 2020

/retitle [WIP] Helm release lifecycle management endpoints

@openshift-ci-robot openshift-ci-robot changed the title [WIP] APIs for modification of a helm release [WIP] Helm release lifecycle management endpoints Mar 6, 2020
docs/helm/README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@pedjak pedjak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing handler uninstall tests.

pkg/helm/actions/release_history_test.go Outdated Show resolved Hide resolved
pkg/helm/actions/release_history_test.go Outdated Show resolved Hide resolved
pkg/helm/actions/rollback_release_test.go Outdated Show resolved Hide resolved
pkg/helm/actions/rollback_release_test.go Outdated Show resolved Hide resolved
pkg/helm/actions/release_history_test.go Outdated Show resolved Hide resolved
pkg/helm/actions/rollback_release_test.go Show resolved Hide resolved
pkg/helm/actions/upgrade_release_test.go Show resolved Hide resolved
pkg/helm/handlers/handler_test.go Show resolved Hide resolved
pkg/helm/handlers/handler_test.go Outdated Show resolved Hide resolved
pkg/helm/handlers/handler_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@pedjak pedjak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are still a dozen of remarks that were not addressed.

docs/helm/README.md Outdated Show resolved Hide resolved
docs/helm/README.md Outdated Show resolved Hide resolved
docs/helm/README.md Show resolved Hide resolved
pkg/helm/handlers/handlers.go Show resolved Hide resolved
@divyanshiGupta
Copy link
Contributor

Hey @akashshinde can you rebase your PR #4580 with master? It doesnt have the latest code for helm proxy and hence doesnt return the helm charts.

@akashshinde akashshinde changed the title [WIP] Helm release lifecycle management endpoints Helm release lifecycle management endpoints Mar 17, 2020
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 17, 2020
@akashshinde akashshinde force-pushed the helm_release_operations branch 2 times, most recently from 863db03 to e6ed240 Compare March 18, 2020 08:24
@rohitkrai03
Copy link
Contributor

/assign

Copy link
Contributor

@pedjak pedjak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please update the documentation as well.

pkg/helm/actions/upgrade_release_test.go Outdated Show resolved Hide resolved
@divyanshiGupta
Copy link
Contributor

/assign


`ns=[string]` - Namespace

`name=[string]` - Helm Release Name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

URL Param for release name is not consistent across all API endpoints. /api/helm/release endpoint needs URL param as release_name. Can you also update that endpoint to be consistent?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would like to create a separate PR that could go into the code quicker. @akashshinde

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rohitkrai03 the idea is to use name instead of release_name, that is the reason you would see name param in all endpoints implemented in this PR. Going forward we will be renaming other endpoints url param from release_name to name in separate PR.

@akashshinde
Copy link
Contributor Author

cc: @benjaminapetersen Please review this

@pedjak
Copy link
Contributor

pedjak commented Mar 31, 2020

/lgtm
/assign @benjaminapetersen

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 31, 2020
if err != nil {
// if there is no release exist then return generic error
if strings.Contains(err.Error(), "no revision for release") {
return nil, ErrReleaseRevisionNotFound
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not entirely sure this extra bit of logic helps?

no revision for release
revision not found for provided release

Pretty close to the same?


func RollbackRelease(releaseName string, revision int, conf *action.Configuration) (*release.Release, error) {
if revision <= 0 {
return nil, errors.New("Revision no. should be more than 0")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, but I would prob use number vs no.

rel, err := GetRelease(name, conf)
if err != nil {
// if there is no release exist then return generic error
if strings.Contains(err.Error(), "no revision for release") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious why a generic error, less information?

@benjaminapetersen
Copy link
Contributor

/approve

A few questions on the errors, but I won't hold on that.

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: akashshinde, benjaminapetersen, pedjak

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 31, 2020
@openshift-merge-robot openshift-merge-robot merged commit fc638a9 into openshift:master Mar 31, 2020
@spadgett spadgett added this to the v4.5 milestone Apr 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. component/backend Related to backend lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants