docker-archive / deploykit

A toolkit for creating and managing declarative, self-healing infrastructure.
Apache License 2.0
2.25k stars 262 forks source link

Remove stdin req on "infrakit manager change -c -v ..." #600

Closed kaufers closed 7 years ago

kaufers commented 7 years ago

This command requires confirmation, which makes it difficult to script. Can we add a --quiet or --force option that removes the confirmation attempt?

chungers commented 7 years ago

Doesn't -c already work like a forced commit? Maybe there's a bug but at least that was its intent.

kaufers commented 7 years ago

@chungers Even with -c you still need to verify: https://github.com/docker/infrakit/blob/master/cmd/infrakit/manager/manager.go#L248-L255

bash-4.3# infrakit manager change -v Groups/workers/Properties/Properties/Allocation/Size=3 -c
INFO[07-10|19:13:20] applying changes                         module=cli/manager fn=github.com/docker/infrakit/cmd/infrakit/manager.Command.func4
Proposed changes, hash=4f319943fa30a1da62cb54ad92ea7f05
Groups:
  workers:
    Plugin: group-stateless
    Properties:
      ID: workers
      Properties:
        Allocation:
          Size: 13
        Flavor:
          Plugin: flavor-swarm/worker
          Properties:
            Docker:
              Host: unix:///var/run/docker.sock
            DockerRestartCommand: service docker restart
            InitScriptTemplateURL: file:////infrakit_files/worker-init.sh
            SwarmJoinIP: 10.177.12.181
        Instance:
          Plugin: instance-terraform
          Properties:
            resource:
              ibm_compute_vm_instance:
                host:
                  '@hostname_prefix': kauf-wkr
                  cores: 1
                  datacenter: dal10
                  domain: ibmcloud.com
                  hourly_billing: true
                  image_id: 1658803
                  local_disk: true
                  memory: 2048
                  ssh_key_ids:
                  - "770393"

Commit? [y/n] n
Not committing. Bye.

Should we just remove the confirmation if -c is specified? If so, I can quickly create a PR for this.

chungers commented 7 years ago

yeah that looks like a bug.... -c should just force a commit without confirmation. thanks in advance for the PR!

kaufers commented 7 years ago

Fixed via https://github.com/docker/infrakit/pull/638