Code Monkey home page Code Monkey logo

osdctl's Introduction

osdctl

A toolbox for OSD!

Overview

osdctl is a cli tool intended to eliminate toils for SREs when managing OSD related work.

Currently, it mainly supports related work for AWS, especially aws-account-operator.

Installation

Build from source

Requirements

  • Go >= 1.21
  • make (gmake if on macOS)
  • goreleaser
  • GOPROXY contains proxy.golang.org as highest priority
    # Google`s default proxy can be added globally:
    go env -w GOPROXY="https://proxy.golang.org,$(go env GOPROXY)"
# Goreleaser is required for builds,
# but can be downloaded with the `make download-goreleaser` target

git clone https://github.com/openshift/osdctl.git
cd osdctl
make download-goreleaser # only needs to be done once
make build

Then you can find the osdctl binary file in the ./dist subdirectory matching your architecture.

Download from release

Release are available on Github

Creating a release

Repository owners can create a new osdctl release with the make release target. An API token with repo permissions is required. See: https://goreleaser.com/environment/#api-tokens

The goreleaser config (.goreleaser.yaml) will look for the token in ~/.config/goreleaser/token.

Goreleaser uses the latest Git tag from the repository to create a release. To make a new release, create a new Git tag:

# Creating a new osdctl Github release

# Create a git tag to be the basis of the release
git tag -a vX.Y.Z -m "new release message"
git push origin vX.Y.Z

# Create the release
make release

Run tests

make test

Config File

A config file is created at ~/.config/osdctl if it does not already exist when running any command. The config file is yaml formatted. As an example:

key1: value1
key2: value2

AWS Account CR reset

reset command resets the Account CR status and cleans up related secrets.

osdctl account reset test-cr
Reset account test-cr? (Y/N) y

Deleting secret test-cr-secret
Deleting secret test-cr-sre-cli-credentials
Deleting secret test-cr-sre-console-url

You can skip the prompt by adding a flag -y, but it is not recommended.

osdctl account reset test-cr -y

AWS Account CR status patch

set command enables you to patch Account CR status directly.

There are two ways of status patching:

  1. Using flags.
osdctl account set test-cr --state=Creating -r=true
  1. Using raw data. For patch strategy, only merge and json are supported. The default is merge.
osdctl account set test-cr --patch='{"status":{"state": "Failed", "claimed": false}}'

AWS Account CR list

list account command lists the Account CRs in the cluster. You can use flags to filter the status.

osdctl account list account --state=Creating

Name                State               AWS ACCOUNT ID      Last Probe Time                 Last Transition Time            Message
test-cr             Creating            181787396432        2020-06-18 10:38:40 -0400 EDT   2020-06-18 10:38:40 -0400 EDT   AWS account already created

# filter accounts by reused or claimed status
osdctl account list --reuse=true --claim=false

# custom output using jsonpath
osdctl account list -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.awsAccountID}{"\t"}{.status.state}{"\n"}{end}'
test-cr             Creating            111111111111        2020-06-18 10:38:40 -0400 EDT   2020-06-18 10:38:40 -0400 EDT   AWS account already created

AWS Account Claim CR list

list account-claim command lists the Account Claim CRs in the cluster. You can use flags to filter the status.

osdctl account list account-claim --state=Ready

AWS Account Mgmt Assign

assign command assigns a developer account to a user

osdctl account mgmt assign -u <LDAP username> -p <profile name>

AWS Account Mgmt list

list command lists the owner of an AWS account given an account id, or the account id(s) given an LDAP username. If neither an account id or username is provided, it lists all the accounts from the developers OU

# list LDAP username
osdctl account mgmt list -i 111111111111 -p <profile name>

# list account(s) from user
osdctl account mgmt list -u <LDAP username> -p <profile name>

# list all accounts in the developer OU
osdctl account mgmt list -p <profile name>

AWS Account Mgmt Unassign

unassign command takes either an LDAP username or account ID and removes any IAM users, Roles, and Policies

# unassigns all accounts from user
osdctl account mgmt unassign -u <LDAP username> -p <profile name>

# cleans up specified account along with its user
osdctl account mgmt unassign -i <account ID> -p <profile name>

AWS Account Console URL generate

console command generates an AWS console URL for the specified Account CR or AWS Account ID.

# generate console URL via Account CR name
osdctl account console -a test-cr

# generate console URL via AWS Account ID
osdctl account console -i 1111111111

# The --launch flag will open the url in the browser
osdctl account console -i 1111111111 --launch

Cleanup Velero managed snapshots

clean-velero-snapshots command cleans up the Velero managed buckets for the specified Account.

# clean up by providing the credentials via flags
osdctl account clean-velero-snapshots -a <AWS ACCESS KEY ID> -x <AWS SECRET ACCESS KEY>

# if flags are not provided, it will get credentials from credentials file,
# we also support specifying profile and config file path
osdctl account clean-velero-snapshots -p <profile name> -c <config file path>

AWS Account IAM User Credentials validation

verify-secrets command verifies the IAM User Secret associated with Account Account CR.

# no argument, verify all account secrets
osdctl account verify-secrets

# specify the Account CR name, then only verify the IAM User Secret for that Account.
osdctl account verify-secrets <Account CR Name>

Match AWS Account with AWS Account Operator related resources

  1. Get AWS Account Operator related resources
# Get Account Name by AWS Account ID, output to json
osdctl account get account -i <Account ID> -o json

# Get Account Claim CR by Account CR Name
osdctl account get account-claim -a <Account CR Name>

# Get Account Claim CR by AWS Account ID, output to yaml
osdctl account get account-claim -i <Account ID> -o yaml

# Get Legal Entity information by AWS Account ID
osdctl account get legal-entity -i <Account ID>

# Get Secrets information by AWS Account ID
osdctl account get secrets -i <Account ID>

test-cr-secret
  1. Get AWS Account ID
# Get AWS Account ID by Account CR Name
osdctl get aws-account -a <Account CR Name>

# Get AWS Account ID by Account Claim CR Name and Namespace
osdctl get aws-account -c <Claim Name> -n <Claim Namespace>

Rotate AWS IAM Credentials

rotate-secret command rotates the credentials for one IAM User, it will print out the generated secret by default.

# specify by Account ID
osdctl account rotate-secret <IAM Username> -i 1111111111

# specify by Account CR Name
osdctl account rotate-secret <IAM Username> -a test-cr

# output the new secret to a path
osdctl account rotate-secret <IAM Username> -a test-cr --output=/test/secret --secret-name=secret

AWS Account Operator metrics display

osdctl metrics

aws_account_operator_pool_size_vs_unclaimed{name="aws-account-operator"} => 893.000000
aws_account_operator_total_account_crs{name="aws-account-operator"} => 2173.000000
aws_account_operator_total_accounts_crs_claimed{name="aws-account-operator"} => 436.000000
......

Get cluster policy and policy-diff

policy command saves the crs files in /tmp/crs- directory for given x.y.z release version. policy-diff command, in addition, compares the files of directories and outputs the diff.

osdctl sts policy <OCP version>
osdctl sts policy-diff <old version> <new version>

Hive ClusterDeployment CR list

# Login into the hive cluster
osdctl hive clusterdeployment list

Hive ClusterSync Failures list

# Login into the hive cluster
osdctl hive clustersync-failures

AWS Account Federated Role Apply

# apply via URL
osdctl federatedrole apply -u <URL>

# apply via local file
osdctl federatedrole apply -f <yaml file>

Cluster break-glass access

Access cluster

# Login to the cluster's hive shard
osdctl cluster break-glass <cluster identifier> --reason <ticket ref>

Drop cluster access

osdctl cluster break-glass cleanup <cluster identifier>
# Non-PrivateLink - remove any Kubeconfig files saved locally in /tmp/

Send a servicelog to a cluster

List servicelogs

# list current servicelogs
CLUSTERID= # can be internal/external/name, but should be unique enough
osdctl servicelog list ${CLUSTERID}

# show all servicelogs (not only ones sent by SREP)
CLUSTERID= # can be internal/external/name, but should be unique enough
osdctl servicelog list ${CLUSTERID} --all-messages

Post servicelogs

CLUSTER_ID= # the unique cluster name, or internal, external id for a cluster
TEMPLATE= # file or url in which the template exists in
osdctl servicelog post ${CLUSTER_ID} --template=${TEMPLATE} --dry-run

QUERIES_HERE= # queries that can be run on ocm's `clusters` resource
TEMPLATE= # file or url in which the template exists in
osdctl servicelog post --template=${TEMPLATE} --query=${QUERIES_HERE} --dry-run

QUERIES_HERE= # queries that can be run on ocm's `clusters` resource
# to test the queries you can run:
# ocm list clusters --parameter search="${QUERIES_HERE}"
cat << EOF > query_file.txt
${QUERIES_HERE}
EOF
TEMPLATE= # file or url in which the template exists in
osdctl servicelog post --template=${TEMPLATE} --query-file=query_file.txt --dry-run

CLUSTER_ID= # the unique cluster name, or internal, external id for a cluster
ANOTHER_CLUSTER_ID= # similar, but shows how to  have multiple clusters as input
# clusters_list.json will have the custom list of clusters to iterate on
cat << EOF > clusters_list.json
{
  "clusters": [
    "${CLUSTER_ID}",
    "${ANOTHER_CLUSTER_ID}"
  ]
}
EOF
# post servicelog to a custom set of clusters
# EXTERNAL_ID is inferred here from the `--clusters-file`
TEMPLATE= # file or url in which the template exists in
osdctl servicelog post --clusters-file=clusters_list.json --template=${TEMPLATE} --dry-run

Cluster environments

osdctl env can be used to log in to several OpenShift clusters at the same time. Each cluster is referred to by a user-defined alias. osdctl env creates a directory in ~/ocenv/ for each cluster named by the alias. It contains an .ocenv that will set $KUBECONFIG and $OCM_CONFIG when the environment is started.

You can run osdctl env my-cluster to create a new environment or switch between environments. Each environment will use a separate $KUBECONFIG so you can easily switch between them. my-cluster in this case is an alias that you can use to identify you cluster later.

Optionally, you can run osdctl env -c my-cluster-id my-cluster to set the $CLUSTERID variable in the environment. This is useful to log in to OSD clusters. When using ocm you can use the shorthands ocl to log in to the cluster, oct to create a tunnel when inside the environment, and ocb to log in with the backplane plugin.

You can leave an environment by pressing ctrl+D.

OCM Environment Auto-detection

You can let osdctl detect the OCM environment and select a login script based on the environment you're currently logged in. This will spare you from having to pass a script with the -l argument each time you log in. To use this feature, provide your login scripts in the config file ~/.osdctl.yaml like in the following example:

loginScripts:
  https://api.stage.openshift.com: ocm-stage-login
  https://api.openshift.com: ocm-prod-login
  https://api.integration.openshift.com: ocm-int-login

Example workflows

Use backplane to log in to OSD cluster and come back later
$ osdctl env -l prod-login.sh -c hf203489-23fsdf-23rsdf my-cluster
$ ocb # login to the cluster
$ exit # tunnel and login loop will be closed on exit
...
$ osdctl env my-cluster # no need to setup and remember everything again
$ ocb # login to the cluster
$ exit
Create a temporary environment for a quick investigation
$ osdctl env -l prod-login.sh -t -c hf203489-23fsdf-23rsdf
$ ocb # login to the cluster
$ oc get pods .... # investigate
$ exit # tunnel and login loop will be closed on exit, environment will be cleaned up.
Use KUBECONFIG outside of the env
$ osdctl env -l prod-login.sh -t -c hf203489-23fsdf-23rsdf my-cluster
$ ocb # login to the cluster
... in some other shell ...
$ `osdctl env -k my-cluster` # use KUBECONFIG from environment
$ oc get pods ...
Logging in to Individual Clusters

osdctl env supports creating environments for non-ocm-managed clusters as well. You can either provide an API URL or an existing KUBECONFIG.

With Username and Password

Set username, API url, and (optionally) password

$ osdctl env -u myuser -p topsecret -a https://api.mycluster.com:6443 mycluster

Careful: The password will be stored in clear text if you pass it. In most cases it will be better to read it from STDIN on login.

log in with ocl

$ ocl
With existing KUBECONFIG

Log in with a kubeconfig that exists in the filesystem:

$ osdctl env --kubeconfig ~/kube/config mycluster

Log in with a kubeconfig from clipboard (linux with xclip):

$ osdctl env --kubeconfig <(xclip -o) mycluster

Log in with a kubeconfig from clipboard (Mac):

$ osdctl env --kubeconfig <(pbpaste) mycluster

Network Utilities

OSD network verifier

  1. Egress test - SOP
osdctl network verify-egress --cluster-id "${CLUSTER_ID}"

Organizations

Get the current organization

$ osdctl org current

Search organizations

Get an organization by username

$ osdctl org get --user=<search-user-name>

Get organizations by part-matching username

$ osdctl org get --user=<search-user-name-like> --part-match

Get an organization by ebs account id

$ osdctl org get --ebs-id=<ebs-account-id>

Describe an organization

$ osdctl org describe  <orgid>

List users in the organization

$ osdctl org users <orgid>

List labels in the organization

$ osdctl org labels <orgid>

List clusters in the organization

Get all clusters in the organization

$ osdctl org clusters <orgid>

Get active clusters in the organization

$ osdctl org clusters <orgid> --active

Get organization clusters from AWS profile and account id

$ osdctl org clusters --aws-profile="<aws-profile>"  --aws-account-id="<aws-account-id>"

List paying and non-paying organization

paying customers list

$ osdctl org customers

non-paying customers list

$ osdctl org customers --paying=false

List AWS accounts for the given organization unit id

$ osdctl org aws-accounts --aws-profile="<aws-profile>" ou-id="<ou-id>"

Run etcd health check for a cluster

osdctl cluster etcd-health-check <internal-cluster-id>

Run etcd member replacement for a cluster

osdctl cluster etcd-member-replace <internal-cluster-id> --node <node-id>

Note : Here node-id refers to the node that has the unhealthy etcd member. This can be found out from etcd-health-check

osdctl's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

osdctl's Issues

Authetication error, run the 'ocm login' command

I'm getting a login error with osdctl version 0.5.0, GitCommit: e5b4ae

[~ {production} ]$ ocm whoami | grep username
  "username": "***"
[~ {production} ]$ osdctl servicelog list 3cbf516c-d432-4ad3-9c5c-596365e3d7c3
FATA[0000] Failed to create OCM connection: Authetication error, run the 'ocm login' command first.

The error went away after I've cp ~/.config/ocm/ocm.json ~/.ocm.json
To fix this please bump ocm sdk version for osdctl

osdctl should complain if it's too old

There are changes happening that make it not great if people aren't using the more recent versions.

Not sure how to go about implementing it, though. One idea: if the version release timestamp is older than N months (2? 3?) have it check the github repo for newer releases (every N runs?) and write a warning mentioning it.

`account cli` should have a --shell argument

We have a script (aws-get-creds.sh) that does this:

osdctl account cli -C $intid -p ${AWS_PROFILE} > $tmpd/creds

akid=$(awk -F'"' '$1 ~ /^ *AccessKeyId: */ {print $2}' $tmpd/creds)
sak=$(awk -F'"' '$1 ~ /^ *SecretAccessKey: */ {print $2}' $tmpd/creds)
st=$(awk -F'"' '$1 ~ /^ *SessionToken: */ {print $2}' $tmpd/creds)

cat <<EOF
export AWS_ACCESS_KEY_ID="$akid"
export AWS_SECRET_ACCESS_KEY="$sak"
export AWS_SESSION_TOKEN="$st"
export AWS_DEFAULT_REGION="$region"
EOF

I should be able to get this type of output by just using an argument in osdctl account cli. Maybe --shell, maybe something better.

`osdctl account cli -o json` in 0.9.6 does not produce valid json

This in turn breaks our internal scripts (chgm and provdelay).

Update:
osdctl appears to produce a running the command info line, which breaks outputs. Example:

$ ./osdctl account cli -p rhcontrol -C 1tgqiqb6asdfasdfasdfasdfasdfasdf -o json
running the command: 'ocm list clusters --parameter=search="((id like '1tgqiqb6asdfasdfasdfasdfasdfasdf' or external_id like '1tgqiqb6asdfasdfasdfasdfasdfasdf' or display_name like '1tgqiqb6asdfasdfasdfasdfasdfasdf))"'
{
"AccessKeyId":

I suspect this might be a universal issue for all output formats and all commands.

Extract client libraries to enable faster command development

Currently I tried to run #189 and found that it was conplex for me to add the ocm client in.

I would like that the

  • ocm
  • AWS
  • k8s
    Libraries will have a package each and I could run in the command code
a, err:= aws.NewAwsClient()
if err !=nil {
  return err
}

It's important that the func won't require any args as this will make pulling the client much faster

`servicelog post -i` should support interactive typing of message

Internal servicelog posting would be made easier if all I had to remember was -i (for --internal) and the tool would guide me from there.

What I mean is – instead of telling me ${MESSAGE} is missing, it could ask me to type the message. Or better yet, run $EDITOR like git commit does?

Add custom cobra doc gen

Cobra has a builtin markdown generation feature. Here we are just using doc.GenMarkdownTree, but the problem is that the generated documents have a date part https://github.com/openshift/osd-utils-cli/blob/master/docs/command/osd-utils-cli_set.md#auto-generated-by-spf13cobra-on-17-jun-2020.

This is not very friendly for CI and new PRs. Maybe we can investigate a way to customize the document output using https://github.com/spf13/cobra/blob/master/doc/md_docs.md#customize-the-output

make `go install` work

after running go-get inside a container I get:

$ go install  github.com/openshift/osd-utils-cli
/root/go/src/k8s.io/cli-runtime/pkg/kustomize/builder.go:23:2: cannot find package "sigs.k8s.io/kustomize/pkg/commands/build" in any of:
	/usr/lib/golang/src/sigs.k8s.io/kustomize/pkg/commands/build (from $GOROOT)
	/root/go/src/sigs.k8s.io/kustomize/pkg/commands/build (from $GOPATH)
/root/go/src/k8s.io/cli-runtime/pkg/kustomize/k8sdeps/factory.go:24:2: cannot find package "sigs.k8s.io/kustomize/pkg/factory" in any of:
	/usr/lib/golang/src/sigs.k8s.io/kustomize/pkg/factory (from $GOROOT)
	/root/go/src/sigs.k8s.io/kustomize/pkg/factory (from $GOPATH)
/root/go/src/k8s.io/cli-runtime/pkg/kustomize/builder.go:24:2: cannot find package "sigs.k8s.io/kustomize/pkg/fs" in any of:
	/usr/lib/golang/src/sigs.k8s.io/kustomize/pkg/fs (from $GOROOT)
	/root/go/src/sigs.k8s.io/kustomize/pkg/fs (from $GOPATH)
/root/go/src/k8s.io/cli-runtime/pkg/kustomize/k8sdeps/kunstruct/kunstruct.go:27:2: cannot find package "sigs.k8s.io/kustomize/pkg/gvk" in any of:
	/usr/lib/golang/src/sigs.k8s.io/kustomize/pkg/gvk (from $GOROOT)
	/root/go/src/sigs.k8s.io/kustomize/pkg/gvk (from $GOPATH)
/root/go/src/k8s.io/cli-runtime/pkg/kustomize/k8sdeps/configmapandsecret/configmapfactory.go:29:2: cannot find package "sigs.k8s.io/kustomize/pkg/ifc" in any of:
	/usr/lib/golang/src/sigs.k8s.io/kustomize/pkg/ifc (from $GOROOT)
	/root/go/src/sigs.k8s.io/kustomize/pkg/ifc (from $GOPATH)
/root/go/src/k8s.io/cli-runtime/pkg/kustomize/k8sdeps/transformer/hash/namehash.go:22:2: cannot find package "sigs.k8s.io/kustomize/pkg/resmap" in any of:
	/usr/lib/golang/src/sigs.k8s.io/kustomize/pkg/resmap (from $GOROOT)
	/root/go/src/sigs.k8s.io/kustomize/pkg/resmap (from $GOPATH)
/root/go/src/k8s.io/cli-runtime/pkg/kustomize/k8sdeps/transformer/patch/patch.go:30:2: cannot find package "sigs.k8s.io/kustomize/pkg/resource" in any of:
	/usr/lib/golang/src/sigs.k8s.io/kustomize/pkg/resource (from $GOROOT)
	/root/go/src/sigs.k8s.io/kustomize/pkg/resource (from $GOPATH)
/root/go/src/k8s.io/cli-runtime/pkg/kustomize/k8sdeps/transformer/hash/namehash.go:23:2: cannot find package "sigs.k8s.io/kustomize/pkg/transformers" in any of:
	/usr/lib/golang/src/sigs.k8s.io/kustomize/pkg/transformers (from $GOROOT)
	/root/go/src/sigs.k8s.io/kustomize/pkg/transformers (from $GOPATH)
/root/go/src/k8s.io/cli-runtime/pkg/kustomize/k8sdeps/configmapandsecret/configmapfactory.go:30:2: cannot find package "sigs.k8s.io/kustomize/pkg/types" in any of:
	/usr/lib/golang/src/sigs.k8s.io/kustomize/pkg/types (from $GOROOT)
	/root/go/src/sigs.k8s.io/kustomize/pkg/types (from $GOPATH)

can this be addressed to allow installing the util easily?

also inside the same container running this gave another error:

$ cd /root/go/src/github.com/openshift/osd-utils-cli/
$ make build
go mod tidy
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go mod tidy
go: github.com/openshift/[email protected]+incompatible: invalid pseudo-version: preceding tag (v3.9.0) not found

go version

go version go1.14.6 linux/amd64

and

$ find /root/go/src/ -name .git | sed 's|/.git||'
/root/go/src/golang.org/x/sys
/root/go/src/golang.org/x/crypto
/root/go/src/golang.org/x/oauth2
/root/go/src/golang.org/x/net
/root/go/src/golang.org/x/text
/root/go/src/golang.org/x/time
/root/go/src/google.golang.org/protobuf
/root/go/src/gopkg.in/yaml.v2
/root/go/src/gopkg.in/AlecAivazis/survey.v1
/root/go/src/gopkg.in/inf.v0
/root/go/src/gopkg.in/yaml.v3
/root/go/src/k8s.io/apimachinery
/root/go/src/k8s.io/utils
/root/go/src/k8s.io/kubectl
/root/go/src/k8s.io/api
/root/go/src/k8s.io/component-base
/root/go/src/k8s.io/kube-openapi
/root/go/src/k8s.io/client-go
/root/go/src/k8s.io/klog
/root/go/src/k8s.io/cli-runtime
/root/go/src/gitlab.com/c0b/go-ordered-json
/root/go/src/github.com/json-iterator/go
/root/go/src/github.com/openshift-online/ocm-sdk-go
/root/go/src/github.com/openshift-online/ocm-cli
/root/go/src/github.com/modern-go/reflect2
/root/go/src/github.com/modern-go/concurrent
/root/go/src/github.com/beorn7/perks
/root/go/src/github.com/cpuguy83/go-md2man
/root/go/src/github.com/pkg/browser
/root/go/src/github.com/pkg/errors
/root/go/src/github.com/golang/protobuf
/root/go/src/github.com/golang/glog
/root/go/src/github.com/dgrijalva/jwt-go
/root/go/src/github.com/cenkalti/backoff
/root/go/src/github.com/cespare/xxhash
/root/go/src/github.com/zgalor/weberr
/root/go/src/github.com/prometheus/common
/root/go/src/github.com/prometheus/procfs
/root/go/src/github.com/prometheus/client_golang
/root/go/src/github.com/prometheus/client_model
/root/go/src/github.com/jmespath/go-jmespath
/root/go/src/github.com/aws/aws-sdk-go
/root/go/src/github.com/spf13/cobra
/root/go/src/github.com/spf13/pflag
/root/go/src/github.com/openshift/moactl
/root/go/src/github.com/openshift/api
/root/go/src/github.com/openshift/hive
/root/go/src/github.com/openshift/aws-account-operator
/root/go/src/github.com/openshift/osd-utils-cli
/root/go/src/github.com/AlecAivazis/survey
/root/go/src/github.com/grokify/html-strip-tags-go
/root/go/src/github.com/mitchellh/go-homedir
/root/go/src/github.com/mitchellh/go-wordwrap
/root/go/src/github.com/matttproud/golang_protobuf_extensions
/root/go/src/github.com/sirupsen/logrus
/root/go/src/github.com/dustin/go-humanize
/root/go/src/github.com/PuerkitoBio/purell
/root/go/src/github.com/PuerkitoBio/urlesc
/root/go/src/github.com/gogo/protobuf
/root/go/src/github.com/gregjones/httpcache
/root/go/src/github.com/liggitt/tabwriter
/root/go/src/github.com/peterbourgon/diskv
/root/go/src/github.com/go-logr/logr
/root/go/src/github.com/russross/blackfriday
/root/go/src/github.com/imdario/mergo
/root/go/src/github.com/deckarep/golang-set
/root/go/src/github.com/googleapis/gnostic
/root/go/src/github.com/MakeNowJust/heredoc
/root/go/src/github.com/evanphx/json-patch
/root/go/src/github.com/davecgh/go-spew
/root/go/src/github.com/google/btree
/root/go/src/github.com/google/gofuzz
/root/go/src/github.com/exponent-io/jsonpath
/root/go/src/github.com/josharian/intern
/root/go/src/github.com/moby/term
/root/go/src/github.com/mailru/easyjson
/root/go/src/github.com/docker/spdystream
/root/go/src/github.com/go-openapi/jsonpointer
/root/go/src/github.com/go-openapi/jsonreference
/root/go/src/github.com/go-openapi/spec
/root/go/src/github.com/go-openapi/swag
/root/go/src/sigs.k8s.io/kustomize
/root/go/src/sigs.k8s.io/controller-runtime
/root/go/src/sigs.k8s.io/yaml
/root/go/src/sigs.k8s.io/structured-merge-diff

Replace `master` branch with `main`

We've started to make changes to replace non-inclusive terms in other parts of the infrastructure, including "blacklist" and "whitelist". We should make the same change to the terminology of the "master" branches, and since this is a young repo with little hard-coded references to branch names, the time is perfect to make this change here as well.

Please investigate and replace the master branch with main as the primary/default branch, and remove master completely.

As part of this, please document how you complete this, and any issues that arise so we can share this with others in the team.

osdctl cost list returns $0

version

  $ osdctl version
{
  "commit": "bf7b850211724ee5bee23934bb665819b568bcc3",
  "version": "0.14.0",
  "latest": "0.14.0"
}

cost get working as expected

  $ osdctl cost get -p rhcontrol --ou ou-jtfp-qqvby1mp -t 3M
  OuId: ou-jtfp-qqvby1mp
  OuName: 1OXqyqko0vmxpV9dmXe9oFypJIw
  Cost: 713015.3138919932

cost list not working as expected

  $ osdctl cost list -p rhcontrol --ou ou-jtfp-qqvby1mp -t 3M
  OuId: ou-jtfp-qqvby1mp
  OuName: 1OXqyqko0vmxpV9dmXe9oFypJIw
  Cost: 0

cc @cattias

ServiceLog submission should include clusterID and subscriptionID

When submitting a serviceLog, only the clusterUUID is provided. This results in the possibility of receiving a 403 from OCM for some users when the cluster with the given clusterUUID has not completed installation successfully. Including the clusterID and subscriptionID in the POST request will ensure that the authz mechanism can find the subscription/cluster record for the matching clusterUUID even if metrics have never been sent by the cluster.

See https://github.com/openshift/osdctl/blob/master/cmd/servicelog/post.go#L333

The service log post operation already lists the cluster record and already has access to both the clusterID and the subscriptionID from the cluster record: https://github.com/openshift/osdctl/blob/master/cmd/servicelog/list.go#L38

Have `account console` set up correct region

The url generated looks like this:

The AWS Console URL is:
https://signin.aws.amazon.com/federation?Action=login&Destination=https%3A%2F%2Fconsole.aws.amazon.com%2F&Issuer=Red+Hat+SRE&SigninToken=

My quick testing shows that if you modify the Destination to point to https://$REGION.console.aws.amazon.com that logs directly into the desired region.

If somebody could confirm that's indeed the case, then this should be a 5 lines patch.

Problem with encoding or accented characters

I've always had this problem with osdsh/osdctl:

$ osdctl -s 'test'
test
$ osdctl -s 'sermão'
serm
$ osdctl -s 'fácil'
f
$ osdctl -s 'ótimo'
[empty]

So the output always dies off at the accented character and nothing else after it is printed.

(Obviously, the output is displayed as on screen text, not in terminal output.)

I have a Tcl script sending text to osdctl and I can convert the text to other encodings before sending it to osdctl. But none of the encodings work. The output is exactly the same unless I convert the text to ascii, in which case osdctl displays each accented character as '?' instead of printing incomplete output.

There is no mention of encodings in either manual and a google search didn't help either.

Can you please provide some information on that? Is there any encoding that osdsh/osdctl will understand and comply with?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.