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

fix ami-type flag #440

Merged
merged 1 commit into from
Apr 12, 2024
Merged

fix ami-type flag #440

merged 1 commit into from
Apr 12, 2024

Conversation

ndbaker1
Copy link
Contributor

@ndbaker1 ndbaker1 commented Apr 12, 2024

Issue #, if available:

Description of changes:

missed a test to validate this flag, and looks like it can only parse under the string primitive and not the ekstypes.AMITypes wrapper type

Before:

$ kubetest2 eksapi --ami-type=FOO
Error: unknown flag: --ami-type

Usage:
  kubetest2 eksapi [Flags] [DeployerFlags] -- [TesterArgs]

Flags:
      --artifacts string         top-level directory to put artifacts under for each kubetest2 run, defaulting to "${ARTIFACTS:-./_artifacts}". If using the ginkgo tester, this must be an absolute path. (default "/home/nbakerd/workspace/aws-k8s-tester/kubetest2/_artifacts")
      --build                    build kubernetes
      --down                     tear down the test cluster
  -h, --help                     display help
      --run-id string            unique identifier for a kubetest2 run (default "60358132-dc7f-467f-8d03-69da7996ed21")
      --rundir string            directory to put run related test binaries like e2e.test, ginkgo, kubectl for each kubetest2 run, defaulting to "${KUBETEST2_RUN_DIR:-./_rundir}". If using the ginkgo tester, this must be an absolute path.
      --rundir-in-artifacts      if true, the test binaries and run specific metadata will be in the ARTIFACTS
      --skip-test-junit-report   skip reporting the test step as a JUnit test case, should be set to true when solely relying on the tester binary to generate it's own junit.
      --test string              test type to run, if unset no tests will run
      --up                       provision the test cluster

DeployerFlags(eksapi):
      --add_dir_header                          If true, adds the file directory to the header
      --addons strings                          Managed addons (name:version pairs) to create in the cluster. Use 'latest' for the most recent version, or 'default' for the default version. (default [])
      --alsologtostderr                         log to standard error as well as files
      --ami string                              AMI for unmanaged nodes
      --cluster-role-service-principal string   Additional service principal that can assume the cluster role
      --efa                                     Create EFA interfaces on the node of an unmanaged nodegroup. Requires --unmanaged-nodes.
      --emit-metrics                            Record and emit metrics to CloudWatch
      --endpoint-url string                     Endpoint URL for the EKS API
      --expected-ami string                     Expected AMI of nodes. Up will fail if the actual nodes are not utilizing the expected AMI. Defaults to --ami if defined.
      --generate-ssh-key                        Generate an SSH key to use for tests. The generated key should not be used in production, as it will not have a passphrase.
      --instance-types strings                  Node instance types (default [])
      --ip-family string                        IP family for the cluster (ipv4 or ipv6)
      --kubeconfig string                       Path to kubeconfig
      --kubernetes-version string               cluster Kubernetes version
      --log_backtrace_at traceLocation          when logging hits line file:N, emit a stack trace (default :0)
      --log_dir string                          If non-empty, write log files in this directory
      --log_file string                         If non-empty, use this log file
      --log_file_max_size uint                  Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
      --logtostderr                             log to standard error instead of files (default true)
      --node-name-strategy string               Specifies the naming strategy for node. Allowed values: ['SessionName', 'EC2PrivateDNSName'], default to EC2PrivateDNSName
      --node-ready-timeout duration             Time to wait for all nodes to become ready (default 0s)
      --nodes int                               number of nodes to launch in cluster
      --region string                           AWS region for EKS cluster
      --skip_headers                            If true, avoid header prefixes in the log messages
      --skip_log_headers                        If true, avoid headers when opening log files
      --stderrthreshold severity                logs at or above this threshold go to stderr (default 2)
      --tune-vpc-cni                            Apply tuning parameters to the VPC CNI DaemonSet
      --unmanaged-nodes                         Use an AutoScalingGroup instead of an EKS-managed nodegroup. Requires --ami
      --up-cluster-header strings               Additional header to add to eks:CreateCluster requests. Specified in the same format as curl's -H flag. (default [])
      --user-data-format string                 Format of the node instance user data
  -v, --v Level                                 number for the log level verbosity
      --vmodule moduleSpec                      comma-separated list of pattern=N settings for file-filtered logging

After:

$ kubetest2 eksapi --ami-type=FOO
I0412 01:48:48.357699 1412239 app.go:61] The files in RunDir shall not be part of Artifacts
I0412 01:48:48.357738 1412239 app.go:62] pass rundir-in-artifacts flag True for RunDir to be part of Artifacts
I0412 01:48:48.357752 1412239 app.go:64] RunDir for this run: "/home/nbakerd/workspace/aws-k8s-tester/kubetest2/_rundir/a4371ae8-02d9-4947-8c33-ebb4170e5684"
I0412 01:48:48.360867 1412239 app.go:136] ID for this run: "a4371ae8-02d9-4947-8c33-ebb4170e5684"

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@cartermckinnon cartermckinnon merged commit 95c9a60 into aws:main Apr 12, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

3 participants