Skip to content

Hook spec validation only runs for hooks in clusters, not hooks in instancegroups #4766

@geekofalltrades

Description

@geekofalltrades

------------- BUG REPORT TEMPLATE --------------------

  1. What kops version are you running? The command kops version, will display
    this information.

    $ kops version
    Version 1.8.0 (git-5099bc5)
    
  2. What Kubernetes version are you running? kubectl version will print the
    version if a cluster is running or provide the Kubernetes version specified as
    a kops flag.

    N/A

  3. What cloud provider are you using?

    AWS

  4. What commands did you run? What is the simplest way to reproduce this issue?

    Add the following broken hook spec to both a cluster (e.g. with kops edit cluster) and an instancegroup (e.g. with kops edit instancegroup):

    hooks:
    - name: a-broken-hook
    
  5. What happened after the commands executed?

    When attempting to add this broken hook spec to a cluster, you get a validation failure:

    # error populating cluster spec: spec.hooks[0]: Required value: you must set either manifest or execContainer for a hook
    

    However, when adding it to an instancegroup, there is no validation failure.

  6. What did you expect to happen?

    Validation should fail when adding this hook spec to an instancegroup, as well as to a cluster.

  7. Please provide your cluster manifest. Execute
    kops get --name my.example.com -oyaml to display your cluster manifest.
    You may want to remove your cluster name and other sensitive information.

    N/A

  8. Please run the commands with most verbose logging by adding the -v 10 flag.
    Paste the logs into this report, or in a gist and provide the gist link here.

    N/A

  9. Anything else do we need to know?

    The problem appears to be that the validateHookSpec function which generates this error only runs during cluster validation, and not during instancegroup validation.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions