UNCLASSIFIED - NO CUI

Skip to content

Fix: Upgrading go version and dependencies

brandt keller requested to merge bbctl_update into main

General MR

Summary

Update go version Update dependencies

Fix tests

Validate go build . and go test -v ./... both return without errors.

brandts-MacBook-Pro:bbctl brandtkeller$ go build .
brandts-MacBook-Pro:bbctl brandtkeller$ ./bbctl 
BigBang command-line tool allows you to run commands against Kubernetes clusters to simplify development, deployment, auditing, and troubleshooting of BigBang.

Usage:
  bbctl [command]

Examples:
  # Get help
  bbctl help

Available Commands:
  completion      Generate completion script.
  help            Help about any command
  list            List all the helm releases deployed by BigBang.
  policy          Describe policy implemented by Gatekeeper or Kyverno.
  preflight-check Check cluster for expected configuration before installing bigbang.
  status          Show status of BigBang deployment.
  values          Get all the values for a given release deployed by BigBang.
  version         Print BigBang Deployment and BigBang CLI version.
  violations      List policy violations.

Flags:
      --as string                      Username to impersonate for the operation. User could be a regular user or a service account in a namespace.
      --as-group stringArray           Group to impersonate for the operation, this flag can be repeated to specify multiple groups.
      --as-uid string                  UID to impersonate for the operation.
      --cache-dir string               Default cache directory (default "/Users/brandtkeller/.kube/cache")
      --certificate-authority string   Path to a cert file for the certificate authority
      --client-certificate string      Path to a client certificate file for TLS
      --client-key string              Path to a client key file for TLS
      --cluster string                 The name of the kubeconfig cluster to use
      --context string                 The name of the kubeconfig context to use
      --disable-compression            If true, opt-out of response compression for all requests to the server
  -f, --filename strings               identifying the resource.
  -h, --help                           help for bbctl
      --insecure-skip-tls-verify       If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure
      --kubeconfig string              Path to the kubeconfig file to use for CLI requests.
  -n, --namespace string               If present, the namespace scope for this CLI request
  -R, --recursive                      Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory. (default true)
      --request-timeout string         The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. (default "0")
  -s, --server string                  The address and port of the Kubernetes API server
      --tls-server-name string         Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used
      --token string                   Bearer token for authentication to the API server
      --user string                    The name of the kubeconfig user to use

Use "bbctl [command] --help" for more information about a command.
brandts-MacBook-Pro:bbctl brandtkeller$ go clean --testcache && go test -v ./...
?       repo1.dso.mil/platform-one/big-bang/apps/product-tools/bbctl    [no test files]
?       repo1.dso.mil/platform-one/big-bang/apps/product-tools/bbctl/util/test  [no test files]
?       repo1.dso.mil/platform-one/big-bang/apps/product-tools/bbctl/util/test/helm     [no test files]
=== RUN   TestBashCompletion
--- PASS: TestBashCompletion (0.00s)
=== RUN   TestZshCompletion
--- PASS: TestZshCompletion (0.00s)
=== RUN   TestFishCompletion
--- PASS: TestFishCompletion (0.00s)
=== RUN   TestFooCompletion
--- PASS: TestFooCompletion (0.00s)
=== RUN   TestGetList
--- PASS: TestGetList (0.00s)
=== RUN   TestGatekeeperPolicies
=== RUN   TestGatekeeperPolicies/list_all_policies
=== RUN   TestGatekeeperPolicies/list_policy_with_given_name
=== RUN   TestGatekeeperPolicies/list_non_existent_policy
--- PASS: TestGatekeeperPolicies (0.00s)
    --- PASS: TestGatekeeperPolicies/list_all_policies (0.00s)
    --- PASS: TestGatekeeperPolicies/list_policy_with_given_name (0.00s)
    --- PASS: TestGatekeeperPolicies/list_non_existent_policy (0.00s)
=== RUN   TestKyvernoPolicies
=== RUN   TestKyvernoPolicies/list_all_policies
=== RUN   TestKyvernoPolicies/list_policy_with_given_name
=== RUN   TestKyvernoPolicies/list_non_existent_policy
--- PASS: TestKyvernoPolicies (0.00s)
    --- PASS: TestKyvernoPolicies/list_all_policies (0.00s)
    --- PASS: TestKyvernoPolicies/list_policy_with_given_name (0.00s)
    --- PASS: TestKyvernoPolicies/list_non_existent_policy (0.00s)
=== RUN   TestGatekeeperPoliciesCompletion
=== RUN   TestGatekeeperPoliciesCompletion/match_all_policies
=== RUN   TestGatekeeperPoliciesCompletion/match_policies_with_given_prefix
=== RUN   TestGatekeeperPoliciesCompletion/match_policy_with_given_prefix
=== RUN   TestGatekeeperPoliciesCompletion/match_no_policy
--- PASS: TestGatekeeperPoliciesCompletion (0.00s)
    --- PASS: TestGatekeeperPoliciesCompletion/match_all_policies (0.00s)
    --- PASS: TestGatekeeperPoliciesCompletion/match_policies_with_given_prefix (0.00s)
    --- PASS: TestGatekeeperPoliciesCompletion/match_policy_with_given_prefix (0.00s)
    --- PASS: TestGatekeeperPoliciesCompletion/match_no_policy (0.00s)
=== RUN   TestKyvernoPoliciesCompletion
=== RUN   TestKyvernoPoliciesCompletion/match_all_policies
=== RUN   TestKyvernoPoliciesCompletion/match_policies_with_given_prefix
=== RUN   TestKyvernoPoliciesCompletion/match_policy_with_given_prefix
=== RUN   TestKyvernoPoliciesCompletion/match_no_policy
--- PASS: TestKyvernoPoliciesCompletion (0.00s)
    --- PASS: TestKyvernoPoliciesCompletion/match_all_policies (0.00s)
    --- PASS: TestKyvernoPoliciesCompletion/match_policies_with_given_prefix (0.00s)
    --- PASS: TestKyvernoPoliciesCompletion/match_policy_with_given_prefix (0.00s)
    --- PASS: TestKyvernoPoliciesCompletion/match_no_policy (0.00s)
=== RUN   TestCheckMetricsServer
=== RUN   TestCheckMetricsServer/metrics_server_not_available
=== RUN   TestCheckMetricsServer/metrics_server_available
--- PASS: TestCheckMetricsServer (0.00s)
    --- PASS: TestCheckMetricsServer/metrics_server_not_available (0.00s)
    --- PASS: TestCheckMetricsServer/metrics_server_available (0.00s)
=== RUN   TestCheckDefaultStorageClass
=== RUN   TestCheckDefaultStorageClass/no_storage_class
=== RUN   TestCheckDefaultStorageClass/default_storage_class
=== RUN   TestCheckDefaultStorageClass/no_default_storage_class
--- PASS: TestCheckDefaultStorageClass (0.00s)
    --- PASS: TestCheckDefaultStorageClass/no_storage_class (0.00s)
    --- PASS: TestCheckDefaultStorageClass/default_storage_class (0.00s)
    --- PASS: TestCheckDefaultStorageClass/no_default_storage_class (0.00s)
=== RUN   TestCheckFluxController
=== RUN   TestCheckFluxController/no_helm_controller_pod
=== RUN   TestCheckFluxController/no_kustomize_controller_pod
=== RUN   TestCheckFluxController/failed_kustomize_controller_pod
=== RUN   TestCheckFluxController/flux_controller_running
--- PASS: TestCheckFluxController (0.00s)
    --- PASS: TestCheckFluxController/no_helm_controller_pod (0.00s)
    --- PASS: TestCheckFluxController/no_kustomize_controller_pod (0.00s)
    --- PASS: TestCheckFluxController/failed_kustomize_controller_pod (0.00s)
    --- PASS: TestCheckFluxController/flux_controller_running (0.00s)
=== RUN   TestCheckSystemParameters
=== RUN   TestCheckSystemParameters/check_failed_for_max_map_count_(ECK)
=== RUN   TestCheckSystemParameters/check_passed_for_max_map_count_(ECK)
=== RUN   TestCheckSystemParameters/check_failed_for_max_map_count_(Sonarqube)
=== RUN   TestCheckSystemParameters/check_passed_for_max_map_count_(Sonarqube)
=== RUN   TestCheckSystemParameters/check_failed_for_file-max_(Sonarqube)
=== RUN   TestCheckSystemParameters/check_passed_for_file-max_(Sonarqube)
=== RUN   TestCheckSystemParameters/check_failed_for_ulimit_-n_(Sonarqube)
=== RUN   TestCheckSystemParameters/check_passed_for_ulimit_-n_(Sonarqube)
=== RUN   TestCheckSystemParameters/check_failed_for_ulimit_-n_(Sonarqube)#01
--- PASS: TestCheckSystemParameters (0.00s)
    --- PASS: TestCheckSystemParameters/check_failed_for_max_map_count_(ECK) (0.00s)
    --- PASS: TestCheckSystemParameters/check_passed_for_max_map_count_(ECK) (0.00s)
    --- PASS: TestCheckSystemParameters/check_failed_for_max_map_count_(Sonarqube) (0.00s)
    --- PASS: TestCheckSystemParameters/check_passed_for_max_map_count_(Sonarqube) (0.00s)
    --- PASS: TestCheckSystemParameters/check_failed_for_file-max_(Sonarqube) (0.00s)
    --- PASS: TestCheckSystemParameters/check_passed_for_file-max_(Sonarqube) (0.00s)
    --- PASS: TestCheckSystemParameters/check_failed_for_ulimit_-n_(Sonarqube) (0.00s)
    --- PASS: TestCheckSystemParameters/check_passed_for_ulimit_-n_(Sonarqube) (0.00s)
    --- PASS: TestCheckSystemParameters/check_failed_for_ulimit_-n_(Sonarqube)#01 (0.00s)
=== RUN   TestPreflightCheckGetParameter
=== RUN   TestPreflightCheckGetParameter/Check_parameter
=== RUN   TestPreflightCheckGetParameter/Check_env_variable
=== RUN   TestPreflightCheckGetParameter/Check_missing_value
--- PASS: TestPreflightCheckGetParameter (0.00s)
    --- PASS: TestPreflightCheckGetParameter/Check_parameter (0.00s)
    --- PASS: TestPreflightCheckGetParameter/Check_env_variable (0.00s)
    --- PASS: TestPreflightCheckGetParameter/Check_missing_value (0.00s)
=== RUN   TestPreflightCheck
=== RUN   TestPreflightCheck/Check_Failure
=== RUN   TestPreflightCheck/Check_Success
=== RUN   TestPreflightCheck/Check_Error
--- PASS: TestPreflightCheck (0.00s)
    --- PASS: TestPreflightCheck/Check_Failure (0.00s)
    --- PASS: TestPreflightCheck/Check_Success (0.00s)
    --- PASS: TestPreflightCheck/Check_Error (0.00s)
=== RUN   TestPreflightCheckCmd
--- PASS: TestPreflightCheckCmd (0.00s)
=== RUN   TestGetStatus
No BigBang release was found.

All pods are ready.

No StatefulSets were found.

No Deployments were found.

No Daemonsets were found.

No Flux helmreleases were found.

No Flux gitrepositories were found.

No Flux kustomizations were found.

--- PASS: TestGetStatus (0.00s)
=== RUN   TestGetBigBangStatus
--- PASS: TestGetBigBangStatus (0.00s)
=== RUN   TestGetFluxKustomizations
--- PASS: TestGetFluxKustomizations (0.00s)
=== RUN   TestGetFluxGitRepositories
--- PASS: TestGetFluxGitRepositories (0.00s)
=== RUN   TestGetFluxHelmReleases
--- PASS: TestGetFluxHelmReleases (0.00s)
=== RUN   TestGetDmstStatus
--- PASS: TestGetDmstStatus (0.00s)
=== RUN   TestGetDpmtStatus
--- PASS: TestGetDpmtStatus (0.00s)
=== RUN   TestGetStsStatus
--- PASS: TestGetStsStatus (0.00s)
=== RUN   TestGetPodStatus
--- PASS: TestGetPodStatus (0.00s)
=== RUN   TestValues
--- PASS: TestValues (0.00s)
=== RUN   TestGetValuesCompletion
--- PASS: TestGetValuesCompletion (0.00s)
=== RUN   TestGetVersion
--- PASS: TestGetVersion (0.00s)
=== RUN   TestGetClientVersionOnly
--- PASS: TestGetClientVersionOnly (0.00s)
=== RUN   TestGatekeeperAuditViolations
=== RUN   TestGatekeeperAuditViolations/no_violations_in_given_namespace
=== RUN   TestGatekeeperAuditViolations/no_violations_in_any_namespace
=== RUN   TestGatekeeperAuditViolations/violations_in_given_namespace
=== RUN   TestGatekeeperAuditViolations/violations_in_any_namespace
--- PASS: TestGatekeeperAuditViolations (0.00s)
    --- PASS: TestGatekeeperAuditViolations/no_violations_in_given_namespace (0.00s)
    --- PASS: TestGatekeeperAuditViolations/no_violations_in_any_namespace (0.00s)
    --- PASS: TestGatekeeperAuditViolations/violations_in_given_namespace (0.00s)
    --- PASS: TestGatekeeperAuditViolations/violations_in_any_namespace (0.00s)
=== RUN   TestGatekeeperDenyViolations
=== RUN   TestGatekeeperDenyViolations/no_violations_in_any_namespace
=== RUN   TestGatekeeperDenyViolations/no_violations_in_given_namespace
=== RUN   TestGatekeeperDenyViolations/violations_in_given_namespace
=== RUN   TestGatekeeperDenyViolations/violations_in_any_namespace
--- PASS: TestGatekeeperDenyViolations (0.00s)
    --- PASS: TestGatekeeperDenyViolations/no_violations_in_any_namespace (0.00s)
    --- PASS: TestGatekeeperDenyViolations/no_violations_in_given_namespace (0.00s)
    --- PASS: TestGatekeeperDenyViolations/violations_in_given_namespace (0.00s)
    --- PASS: TestGatekeeperDenyViolations/violations_in_any_namespace (0.00s)
=== RUN   TestKyvernoAuditViolations
=== RUN   TestKyvernoAuditViolations/no_violations_in_any_namespace
=== RUN   TestKyvernoAuditViolations/no_violations_in_given_namespace
=== RUN   TestKyvernoAuditViolations/violations_in_given_namespace
=== RUN   TestKyvernoAuditViolations/violations_in_any_namespace
--- PASS: TestKyvernoAuditViolations (0.00s)
    --- PASS: TestKyvernoAuditViolations/no_violations_in_any_namespace (0.00s)
    --- PASS: TestKyvernoAuditViolations/no_violations_in_given_namespace (0.00s)
    --- PASS: TestKyvernoAuditViolations/violations_in_given_namespace (0.00s)
    --- PASS: TestKyvernoAuditViolations/violations_in_any_namespace (0.00s)
=== RUN   TestKyvernoEnforceViolations
=== RUN   TestKyvernoEnforceViolations/no_violations_in_any_namespace
=== RUN   TestKyvernoEnforceViolations/no_violations_in_given_namespace
=== RUN   TestKyvernoEnforceViolations/violations_in_given_namespace
=== RUN   TestKyvernoEnforceViolations/violations_in_any_namespace
--- PASS: TestKyvernoEnforceViolations (0.00s)
    --- PASS: TestKyvernoEnforceViolations/no_violations_in_any_namespace (0.00s)
    --- PASS: TestKyvernoEnforceViolations/no_violations_in_given_namespace (0.00s)
    --- PASS: TestKyvernoEnforceViolations/violations_in_given_namespace (0.00s)
    --- PASS: TestKyvernoEnforceViolations/violations_in_any_namespace (0.00s)
PASS
ok      repo1.dso.mil/platform-one/big-bang/apps/product-tools/bbctl/cmd        1.060s
=== RUN   TestGetHelmClient
--- PASS: TestGetHelmClient (0.00s)
=== RUN   TestGetHelmClientBadConfig
--- PASS: TestGetHelmClientBadConfig (0.00s)
=== RUN   TestGetK8sClientset
--- PASS: TestGetK8sClientset (0.00s)
=== RUN   TestGetK8sClientsetBadConfig
--- PASS: TestGetK8sClientsetBadConfig (0.00s)
=== RUN   TestGetK8sDynamicClient
--- PASS: TestGetK8sDynamicClient (0.00s)
=== RUN   TestGetK8sDynamicClientBadConfig
--- PASS: TestGetK8sDynamicClientBadConfig (0.00s)
=== RUN   TestGetRestConfig
--- PASS: TestGetRestConfig (0.00s)
=== RUN   TestGetRestConfigBadConfig
--- PASS: TestGetRestConfigBadConfig (0.00s)
=== RUN   TestGetCommandExecutor
--- PASS: TestGetCommandExecutor (0.00s)
=== RUN   TestGetCommandExecutorBadConfig
--- PASS: TestGetCommandExecutorBadConfig (0.00s)
PASS
ok      repo1.dso.mil/platform-one/big-bang/apps/product-tools/bbctl/util       1.680s
=== RUN   TestFetchGatekeeperCrds
--- PASS: TestFetchGatekeeperCrds (0.00s)
=== RUN   TestFetchGatekeeperConstraints
=== RUN   TestFetchGatekeeperConstraints/no_constraints_exist
=== RUN   TestFetchGatekeeperConstraints/constraints_exist
--- PASS: TestFetchGatekeeperConstraints (0.00s)
    --- PASS: TestFetchGatekeeperConstraints/no_constraints_exist (0.00s)
    --- PASS: TestFetchGatekeeperConstraints/constraints_exist (0.00s)
PASS
ok      repo1.dso.mil/platform-one/big-bang/apps/product-tools/bbctl/util/gatekeeper    0.466s
=== RUN   TestToRESTConfig
--- PASS: TestToRESTConfig (0.00s)
=== RUN   TestToDiscoveryClient
--- PASS: TestToDiscoveryClient (0.00s)
=== RUN   TestToRestMapper
--- PASS: TestToRestMapper (0.00s)
=== RUN   TestToRawKubeConfigLoader
--- PASS: TestToRawKubeConfigLoader (0.00s)
=== RUN   TestGetList
--- PASS: TestGetList (0.00s)
=== RUN   TestGetRelease
--- PASS: TestGetRelease (0.00s)
=== RUN   TestGetValues
--- PASS: TestGetValues (0.00s)
PASS
ok      repo1.dso.mil/platform-one/big-bang/apps/product-tools/bbctl/util/helm  0.667s
=== RUN   TestGetIOStreams
--- PASS: TestGetIOStreams (0.00s)
=== RUN   TestCreateJob
--- PASS: TestCreateJob (0.00s)
=== RUN   TestBuildKubeConfigFromFlags
--- PASS: TestBuildKubeConfigFromFlags (0.00s)
=== RUN   TestBuildDynamicClientFromFlags
--- PASS: TestBuildDynamicClientFromFlags (0.00s)
=== RUN   TestGetKubeConfigFromPathList
--- PASS: TestGetKubeConfigFromPathList (0.00s)
=== RUN   TestCreateNamespace
--- PASS: TestCreateNamespace (0.00s)
=== RUN   TestDeleteNamespace
--- PASS: TestDeleteNamespace (0.00s)
=== RUN   TestCreateRegistrySecret
--- PASS: TestCreateRegistrySecret (0.00s)
=== RUN   TestDeleteRegistrySecret
--- PASS: TestDeleteRegistrySecret (0.00s)
PASS
ok      repo1.dso.mil/platform-one/big-bang/apps/product-tools/bbctl/util/k8s   1.327s
=== RUN   TestFetchKyvernoCrds
=== RUN   TestFetchKyvernoCrds/no_crd_exist
=== RUN   TestFetchKyvernoCrds/crds_exist
--- PASS: TestFetchKyvernoCrds (0.00s)
    --- PASS: TestFetchKyvernoCrds/no_crd_exist (0.00s)
    --- PASS: TestFetchKyvernoCrds/crds_exist (0.00s)
=== RUN   TestFetchKyvernoPolicies
=== RUN   TestFetchKyvernoPolicies/no_policies_exist
=== RUN   TestFetchKyvernoPolicies/policies_exist
--- PASS: TestFetchKyvernoPolicies (0.00s)
    --- PASS: TestFetchKyvernoPolicies/no_policies_exist (0.00s)
    --- PASS: TestFetchKyvernoPolicies/policies_exist (0.00s)
PASS
ok      repo1.dso.mil/platform-one/big-bang/apps/product-tools/bbctl/util/kyverno       0.241s

Merge request reports