moooofly / harborctl

A CLI tool for the Docker Registry Harbor. This project offer a command-line interface to the Harbor API, you can use it to manager your users, projects, repositories, etc. (This project aims to refactor harbor-go-client based on Harbor v1.6.0)
MIT License
28 stars 6 forks source link

[NOTE] API "DELETE /chartrepo/{repo}/charts/{name}" not work as expect #43

Open moooofly opened 5 years ago

moooofly commented 5 years ago

make a test by swagger UI, and get

image

[#60#root@ubuntu-1604 /go/src/github.com/moooofly/harborctl]$./harborctl chartrepo chart get -c charts -n nginx-ldapauth-proxy
==> GET https://localhost/api/chartrepo/charts/charts/nginx-ldapauth-proxy
<==
<== Rsp Status: 200 OK
<== Rsp Body: [{"name":"nginx-ldapauth-proxy","sources":["https://github.com/dweomer/dockerfiles-nginx-auth-ldap","https://github.com/kvspb/nginx-auth-ldap"],"version":"0.1.2","description":"nginx proxy with ldapauth","maintainers":[{"name":"rendhalver","email":"pete.brown@powerhrg.com"},{"name":"jar361","email":"jrodgers@powerhrg.com"}],"icon":"https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Nginx_logo.svg/500px-Nginx_logo.svg.png","apiVersion":"v1","appVersion":"1.13.5","urls":["charts/nginx-ldapauth-proxy-0.1.2.tgz"],"created":"2019-02-03T13:28:44.794Z","digest":"454951c98af50cd81146baa4be64fa1e6dd5c52b389fe958248f69ead04441f0"}]
[#61#root@ubuntu-1604 /go/src/github.com/moooofly/harborctl]$
[#61#root@ubuntu-1604 /go/src/github.com/moooofly/harborctl]$
[#61#root@ubuntu-1604 /go/src/github.com/moooofly/harborctl]$
[#61#root@ubuntu-1604 /go/src/github.com/moooofly/harborctl]$./harborctl chartrepo chart get -c charts -n nginx-ldapauth-proxy -v 0.1.2
==> GET https://localhost/api/chartrepo/charts/charts/nginx-ldapauth-proxy/0.1.2
<==
<== Rsp Status: 200 OK
<== Rsp Body: {"metadata":{"name":"nginx-ldapauth-proxy","sources":["https://github.com/dweomer/dockerfiles-nginx-auth-ldap","https://github.com/kvspb/nginx-auth-ldap"],"version":"0.1.2","description":"nginx proxy with ldapauth","maintainers":[{"name":"rendhalver","email":"pete.brown@powerhrg.com"},{"name":"jar361","email":"jrodgers@powerhrg.com"}],"icon":"https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Nginx_logo.svg/500px-Nginx_logo.svg.png","apiVersion":"v1","appVersion":"1.13.5","urls":["charts/nginx-ldapauth-proxy-0.1.2.tgz"],"created":"2019-02-03T13:19:18.85Z","digest":"454951c98af50cd81146baa4be64fa1e6dd5c52b389fe958248f69ead04441f0"},"dependencies":[],"values":{"image.pullPolicy":"IfNotPresent","image.repository":"dweomer/nginx-auth-ldap","image.tag":"1.13.5-on-alpine-3.5","ingress.annotations":null,"ingress.enabled":false,"ingress.hosts":["ldapauth-service.local"],"ingress.tls":null,"proxy.authName":"Auth Required","proxy.host":"kubernetes.default.svc.cluster.local","proxy.ldapBindDN":"cn=auth,dc=example,dc=com","proxy.ldapDN":"dc=example,dc=com","proxy.ldapFilter":"objectClass=organizationalPerson","proxy.ldapGroup":"memberUid","proxy.ldapHost":"","proxy.ldapPort":389,"proxy.port":443,"proxy.requires":[{"filter":"cn=secret,ou=groups,dc=example,dc=com","name":"authGroup"}],"replicaCount":1,"secrets.ldapBindPassword":"","service.externalPort":443,"service.internalPort":80,"service.name":"nginx-ldapauth","service.type":"ClusterIP","tolerations":[]},"files":{"values.yaml":"# Default values for nginx-ldapauth-proxy.\n# This is a YAML-formatted file.\n# Declare variables to be passed into your templates.\nreplicaCount: 1\nimage:\n  repository: dweomer/nginx-auth-ldap\n  tag: 1.13.5-on-alpine-3.5\n  pullPolicy: IfNotPresent\n  # pullSecrets:\n   # - docker-secret\nservice:\n  name: nginx-ldapauth\n  type: ClusterIP\n  externalPort: 443\n  internalPort: 80\nproxy:\n  port: 443\n  host: \"kubernetes.default.svc.cluster.local\"\n  authName: \"Auth Required\"\n  ldapHost: \"\"\n  ldapPort: 389\n  ldapGroup: \"memberUid\"\n  ldapDN: \"dc=example,dc=com\"\n  ldapFilter: \"objectClass=organizationalPerson\"\n  ldapBindDN: \"cn=auth,dc=example,dc=com\"\n  requires:\n    - name: \"authGroup\"\n      filter: \"cn=secret,ou=groups,dc=example,dc=com\"\nsecrets:\n  ldapBindPassword: \"\"\n\ningress:\n  enabled: false\n  # Used to create an Ingress record.\n  hosts:\n    - ldapauth-service.local\n  annotations:\n    # kubernetes.io/ingress.class: nginx\n    # kubernetes.io/tls-acme: \"true\"\n  tls:\n    # Secrets must be manually created in the namespace.\n    # - secretName: chart-example-tls\n    #   hosts:\n    #     - chart-example.local\nresources: {}\n  # We usually recommend not to specify default resources and to leave this as a conscious\n  # choice for the user. This also increases chances charts run on environments with little\n  # resources, such as Minikube. If you do want to specify resources, uncomment the following\n  # lines, adjust them as necessary, and remove the curly braces after 'resources:'.\n  # limits:\n  #  cpu: 100m\n  #  memory: 128Mi\n  # requests:\n  #  cpu: 100m\n  #  memory: 128Mi\n\nnodeSelector: {}\n\ntolerations: []\n\naffinity: {}\n"},"security":{"signature":{"signed":false,"prov_file":""}}}
[#62#root@ubuntu-1604 /go/src/github.com/moooofly/harborctl]$

image

image

[#62#root@ubuntu-1604 /go/src/github.com/moooofly/harborctl]$./harborctl chartrepo chart delete -c charts -n nginx-ldapauth-proxy
==> DELETE https://localhost/api/chartrepo/charts/charts/nginx-ldapauth-proxy
<==
<== Rsp Status: 404 Not Found
<== Rsp Body: <!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>404 - Page Not Found</title>
<style>

*{
    maring: 0;
    padding: 0;
}

...
[#63#root@ubuntu-1604 /go/src/github.com/moooofly/harborctl]$./harborctl chartrepo chart delete -c charts -n nginx-ldapauth-proxy -v 0.1.2
==> DELETE https://localhost/api/chartrepo/charts/charts/nginx-ldapauth-proxy/0.1.2
<==
<== Rsp Status: 200 OK
<== Rsp Body: {"deleted":true}
[#64#root@ubuntu-1604 /go/src/github.com/moooofly/harborctl]$

Conclusions