Uploaded image for project: 'BxMS Documentation'
  1. BxMS Documentation
  2. BXMSDOC-4694

git hook configuration on Openshift : example command does not work

    Details

    • Sprint:
      2019 Week 41-43 (from Okt 7)
    • Story Points:
      1

      Description

      In 3.3. (Optional) Providing the Git hooks directory of the document,

      the following command are documented in step3.

      oc create configmap git_hooks --from-file=<file_1>=<file_1> --from-file=<file_2>=<file_2> 
       oc create configmap git_hooks --from-file=post-commit=post-commit
      
      oc set volume dc/<myapp>-rhpamcentr --add --type configmap --configmap-name git_hooks  --mount-path=<git_hooks_dir> --name=git_hooks
      

      As above, 'git_hooks' is specified as configmap name.
      But configMap can't be created with this name.

      $ oc create configmap git_hooks  --from-file=post-commit=post-commit
      The ConfigMap "git_hooks" is invalid: metadata.name: Invalid value: "git_hooks": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')
      $ 
      

      As stated in the error, it seems that '_' is not allowed as configMap name.
      it should be, for example:

      oc create configmap git-hooks  --from-file=post-commit=post-commit
      

      i.e. specify 'git-hooks' instead of 'git_hooks'.

      I know this is just example, but it would be better to avoid an error like this.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                mramendi Mikhail Ramendik
                Reporter:
                hiroko Hiroko Miura
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: