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

Error "flag provided but not defined: -header-config-path" when using :latest tag #44

Closed
llech opened this issue Jun 15, 2021 · 2 comments

Comments

@llech
Copy link

llech commented Jun 15, 2021

I was trying to try out the new headerConfig feature. But when I've created configMap with the file under /config/, there was no effect and no error message. So I've tried to use '-header-config-path' parameter:

apiVersion: apps/v1
kind: Deployment
spec:
  template:
    spec:
      containers:
      - args:
        - -header-config-path
        - /config/headers/headerConfig.json
        image: pierrezemb/gostatic:latest
        imagePullPolicy: IfNotPresent
        name: static-cms
        ports:
        - containerPort: 8043
          name: http
          protocol: TCP
        volumeMounts:
        - mountPath: /srv/http/cms/api/public
          name: cmsfiles
        - mountPath: /config/headers
          name: headers
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      volumes:
      - configMap:
          defaultMode: 420
          name: static-cmsfiles
        name: cmsfiles
      - configMap:
          defaultMode: 420
          name: static-headers
        name: headers

where the static-headers configmap is:

apiVersion: v1
data:
  headerConfig.json: |-
    {
     "configs": [{"fileExtension":"*","headers":[{"key":"Content-Type","value":"application/json;charset=UTF-8"},{"key":"Cache-Control","value":"public, max-age=0, must-revalidate"}],"path":"*"}]
    }
kind: ConfigMap

However, I get the error message:

flag provided but not defined: -header-config-path 
Usage of /goStatic: 
  -append-header HeaderName:Value 
    	HTTP response header, specified as HeaderName:Value that should be added to all responses. 
  -context string 
    	The 'context' path on which files are served, e.g. 'doc' will serve the files at 'https://localhost:<port>/doc/' 
  -default-user-basic-auth string 
    	Define the user (default "gopher") 
  -enable-basic-auth 
    	Enable basic auth. By default, password are randomly generated. Use --set-basic-auth to set it. 
  -enable-health 
    	Enable health check endpoint. You can call /health to get a 200 response. Useful for Kubernetes, OpenFaas, etc. 
  -fallback string 
    	Default fallback file. Either absolute for a specific asset (/index.html), or relative to recursively resolve (index.html) 
  -password-length int 
    	Size of the randomized password (default 16) 
  -path string 
    	The path for the static files (default "/srv/http") 
  -port int 
    	The listening port (default 8043) 
  -set-basic-auth string 
    	Define the basic auth. Form must be user:password 

The new parameter is not in the list.
Could you please check if the :latest tag in docker-hub contains really the actual version of the code, or if it was overwriten by old version?

@PierreZ
Copy link
Owner

PierreZ commented Jun 19, 2021

Hi,
Thanks for the issue, I'm always forgetting that there is no CI, doing 🚀

@PierreZ
Copy link
Owner

PierreZ commented Jun 19, 2021

pierrezemb/gostatic:latest Digest:sha256:5431140b9ed260e815d65e6b7f5cf85008136e547f8f976866b9ee11a7b61511 should now be up-to-date 🎉

I also added multi-arch images using buildx, I think @antoniofagardo should update the target when pulling the image 😄

phred pushed a commit to phred/smolboi that referenced this issue Nov 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants