Code Monkey home page Code Monkey logo

kubecfg's People

Contributors

anguslees avatar beltran-rubo avatar burdiyan avatar camh- avatar falfaro avatar gauntletwizard avatar hausdorff avatar jessicayuen avatar jjo avatar kgaurav2 avatar mkmik avatar ngtuna avatar petr-k avatar ppbaena avatar prydonius avatar q3k avatar sebgoa avatar shric avatar thesuess avatar tomwilkie avatar

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  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  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

kubecfg's Issues

bar_menu.6.jsonnet example fails

Been trying to learn jsonnet via their tutorials. Should the bar_menu.6.jsonnet example from the jsonnet repo work?

$ pwd
/tmp/jsonnet/examples
$ git remote -v
origin	https://github.com/google/jsonnet (fetch)
origin	https://github.com/google/jsonnet (push)
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean
$ kubecfg show -o yaml -f bar_menu.6.jsonnet
ERROR Error reading bar_menu.6.jsonnet: Unexpected object structure: string
$ jsonnet bar_menu.6.jsonnet
{
   "cocktails": {
      "Cosmopolitan": {
         "garnish": "Lime Wheel",
         "ingredients": [
            {
               "kind": "Vodka",
               "qty": 1.5
            },
            {
               "kind": "Cointreau",
               "qty": 1
            },
            {
               "kind": "Cranberry Juice",
               "qty": 2
            },
            {
               "kind": "Lime Juice",
               "qty": 1
            }
         ],
         "served": "Straight Up"
      },
      "Manhattan": {
         "garnish": "Maraschino Cherry",
         "ingredients": [
            {
               "kind": "Rye",
               "qty": 2.5
            },
            {
               "kind": "Sweet Red Vermouth",
               "qty": 1
            },
            {
               "kind": "Angostura",
               "qty": "dash"
            }
         ],
         "served": "Straight Up"
      },
      "Vodka Martini": {
         "garnish": "Olive",
         "ingredients": [
            {
               "kind": "Vodka",
               "qty": 2
            },
            {
               "kind": "Dry White Vermouth",
               "qty": 1
            }
         ],
         "served": "Straight Up"
      }
   }
}
$ kubecfg version
kubecfg version: (dev build)
jsonnet version: v0.9.4
client-go version: v1.6.8-beta.0+$Format:%h$

Namespace option ignored in some cases

Currently the -n --namespace option seems to be ignored in the use-cases which I have.

My main use-case is that I want to be able to:

$ kubecfg diff dev/myproject.jsonnet
$ kubecfg update dev/myproject.jsonnet

to view changes, then update my dev env - which works fine as the jsonnet doesn't define namespace explicitly so it's using my own from the current context. But I'd then like to:

$ kubecfg diff ci/myproject.jsonnet -n ci-namespace

to verify the changes when using the ci jsonnet. But this just diffs against my own namespace (similar if I kubecfg update -n nonexistentnamespace dev/myproject.jsonnet it doesn't error but deploys using my namespace)

Currently the only way I can achieve this is by explicitly including the namespace metadata in the jsonnet, then call with:

$ kubecfg diff ci/myproject.jsonnet -V namespace=ci-namespace

or similar, but this then requires the same ext var for anyone deploying on dev.

Multiple `-J` flags don't seem to work

With the example guestbook in the components/ directory, doing something like:

../kubecfg update dev -J lib -J ../lib

Results in an error that we can't find the example.libsonnet file. Reversing the order of the -J flags seems to cause kubecfg.libsonnet to go missing.

Build kubecfg on osx doesn't work

I wanna build kubecfg locally on osx. By running make I have the binary. However it doesn't work.

$ make
go build -ldflags="-X main.version=dev-2017-07-05T11:19:56+0700 " .
$ ./kubecfg -h
Killed: 9

`kubecfg show` needs better error messages / usefulness at debug-time

kubecfg show (and jsonnet eval) is basically the only tool for exploring evaluation and debugging errors. Currently kubecfg show is awful for this.

  • Allow kubecfg show to work on jsonnet sub-expressions not just whole API objects
  • When walking the jsonnet result, give better (some!) context in Unexpected object structure error message
  • Accept arbitrary jsonnet expressions, not just files on the kubecfg show command line (like jsonnet eval)
  • Consider other debugging UX improvements, like a repl?

Improve `stdout` logs

Right now an update shows:

$ ./kubecfg update examples/guestbook.jsonnet 
I0627 10:08:39.214140    7694 update.go:57] Updating Service/redis-slave
I0627 10:08:39.277885    7694 update.go:70]  Creating non-existent Service/redis-slave
I0627 10:08:39.296423    7694 update.go:57] Updating Service/frontend
...

Probably need to clean up a bit the output and make it more user friendly.

Update documentation

This involves:

  • Updating the kubecfg README.
  • Adding kubecfg to the ksonnet site (possibly move it to ksonnet.io).
  • Adding a "case studies" section.

Implement delete

Should delete the objects created from a naive update --create.

RUNTIME ERROR: Field does not exist: selector

This is probably user error, but...

With the following simple testcase:

local k = import "ksonnet.beta.1/k.libsonnet";

k.core.v1.service.default("frontend") +
  k.core.v1.service.mixin.spec.selector({name: "frontend"})

I get this error:

$ kubecfg -J production/ksonnet-lib show ./test.jsonnet 
Error: Error reading ./test.jsonnet: RUNTIME ERROR: Field does not exist: selector
		object <mixin>
	production/ksonnet-lib/ksonnet.beta.1/core.v1.libsonnet:3379:31-44	object <anonymous>
	During manifestation	

However, it works with plain jsonnet:

$ jsonnet -J production/ksonnet-lib ./test.jsonnet 
{
   "apiVersion": "v1",
   "kind": "Service",
   "metadata": {
      "name": "frontend",
      "namespace": "default"
   },
   "spec": {
      "selector": {
         "name": "frontend"
      }
   },
   "status": { }
}

The problem seems to stem from the fact that service objects created with default have empty spec objects, and the +: operation is expecting it? if I change the input to be:

local k = import "ksonnet.beta.1/k.libsonnet";

k.core.v1.service.default("frontend") +
  {
    spec+: k.core.v1.serviceSpec.default() +
      k.core.v1.serviceSpec.selector({name: "frontend"})
  }

It works. Should the default() function for service be calling the default() function for serviceSpec, instead of initialising it to an empty object?

Implement `ksonnet init`

The ksonnet init command is specified in the ksonnet.next design doc from August 2017.

Implementing this specification implies the following work items:

  • Completed in #88. Update help documentation.
  • Completed in #88. Making ksonnet-lib's ksonnet-gen package ready for consumption as a library.
    1. ksonnet-gen was written to be a command line tool rather than a library, so in several places it calls (e.g.) log.Fatal in places kubecfg might not expect. We should remove these and return errors on failure instead.
    2. ksonnet-gen will add the SHA of the git revision that the Kubernetes codebase was at when we build from a swagger.json file. In this setting, this is not necessary, and most OpenAPI files won't be in a git repository anyway.
  • Completed in #88. govendor'ing a dependency on ksonnet-lib's ksonnet-gen package. (govendor allows you to vendor only the parts of the library you depend on.)
  • Completed in #88. Add init to cmd/. This involves:
    1. Parsing the init flag if present
    2. Retrieving the schema (e.g., from network, from disk, from server)
    3. Generating ksonnet-lib code for the default environment, inside the vendor/ directory.

`diff` should remove/ignore server-side readonly metadata

Running diff often results in a bunch of system fields being reported, like this:

screen shot 2017-08-01 at 10 48 36 am

This is useful sometimes, but often you want to be able to quickly assess the changes to the fields the user has control out of. It seems like it might be sensible to default to not reporting system fields, and also have a flag like --include-system-fields or something to specifically opt into the behavior.

Implement simple environments

  • Transition to new directory structure.
    • Completed in #115. Flatten out vendor/, move the generated ksonnet-lib to environments.
    • Completed in #115. Change the -J flags that are passed into Jsonnet to reflect this new directory structure.
    • Completed in #115. Rename default environment to 'default'.
  • Update commands that expand Jsonnet.
    • Completed in #140 Make each of these commands (e.g., apply) use the environment argument.
    • Completed in #140 Remove mutual exclusion between -f and the <env-name> argument.
    • Completed in #131. Generate spec.json in init and env add.
  • Implement env commands.
    • Completed in #131. env add
    • Completed in #131. env remove
    • Completed in #131. env list
    • Completed in #131. env set
  • Settle on the the schema of the spec.json files.

Future:

  • Completed in #149 The default environment should pre-populate URI in spec.json from KUBECONFIG.

Some of the more speculative questions:

  • When should apply default to using the cluster in kubeconfig? What should we do when we apply <env-name> and env-name doesn't have a URL associated with it? (Seems like we should error out and suggest they run some command to "adopt" the current context in the currently-active kubeconfig file. Also whenever we run apply, we should probably say exactly what we're deploying to and where we got the data.)

Implement `ksonnet prototype`

The ksonnet prototype command is specified in the ksonnet.next design doc from August 2017.

Implementing this specification implies the following work items:

  • (@hausdorff) Update help documentation.
  • Implement ksonnet prototype use. This involves:
    • (@jessicayuen) [If Jsonnet] expand it to the LSP-spec-compliant snippet JSON
      • (PR #109) Implement Jsonnet AST -> string code emission.
      • (PR #109) Implement import param rewriter in kubecfg codebase.
    • (@hausdorff) Expand the snippet (i.e., substitute in the variables from the CLI) and output to stdout.
      • Write snippet parser.
      • Write code to expand snippet templates
    • Wire up to the use command.
  • (@hausdorff) Implement ksonnet prototype describe. This roughly involves:
    • Retrieving the documentation from the prototype file.
    • Render to stdout.

Future work:

  • Implement ksonnet prototype search.

Add homebrew install instructions?

I've published my brew formulae for kubecfg and ksonnetlib; https://github.com/GauntletWizard/homebrew-kubecfg

Install instructions would be:
brew tap GauntletWizard/kubecfg #or ksonnet/kubecfg
brew install kubecfg ksonnetlib
Add the following to your .bash_profile:
export KUBECFG_JPATH="/usr/local/opt/ksonnetlib/share/ksonnet-lib"

Feel free to fork the repo and update it. Updating for a new release should be as simple as updating the tag and revision sha in the appropriate formulae.

Implement garbage collection of objects that no longer appear in config

Desired workflow:

  • create some jsonnet config
  • kubecfg update (should create new objects)
  • remove some of the objects from jsonnet config
  • kubecfg update (should remove "stale" objects)

Suggested implementation:

  • Add some sort of "garbage-collect-me: true" annotation to all objects we create unless it already exists (perhaps with a false value)
  • After regular update:
    • list all objects in all namespaces (!! this requires walking known object types, and will probably take a while)
    • delete all objects that have garbage-collect-me=true and were not in the update we just did

One possible optimisation is to only look in Namespaces that were mentioned in the update, but this is insufficient in the general case (will leak namespaces that are removed from config).

Must have a flag to disable it. Current proposal is to enable it by default.

osx: "Killed: 9" scares me

$ echo $GOPATH
/Users/tuna/workspace/gocode/ksonnet
$ export PATH=$PATH:$GOPATH/bin

$ go get github.com/ksonnet/kubecfg
$ export KUBECFG_JPATH=/Users/tuna/workspace/gocode/ksonnet/src/github.com/ksonnet/ksonnet-lib

$ kubecfg show -o yaml kubeless.jsonnet 
Killed: 9

What did I do wrong ?

Add license Header to Go source code

It is ASL licensed but none of the Go source code has the ASL v2 license header. Bottom line, the license is not properly applied...

Technically we need to add it to every file

Implement `diff`

Implement a diff subcommand that shows the differences between what exists on the server, and what exists in config. Output is intended to be human (not machine) readable.

"Error: Get https://xxx.xxx.xxx.xxx/apis/apps/v1beta1: error executing access token command "/use/local/bin/gcloud ": exit status 2"

I'm using GKE, and as such my k8s credentials are like this:

- name: foo
  user:
    auth-provider:
      config:
        access-token: REDACTED
        cmd-args: config config-helper --format=json
        cmd-path: /usr/local/bin/gcloud
        expiry: 2017-06-29T16:17:45Z
        expiry-key: '{.credential.token_expiry}'
        token-key: '{.credential.access_token}'
      name: gcp

When I run kubecfg update ... I get the error Error: Get https://xxx.xxx.xxx.xxx/apis/apps/v1beta1: error executing access token command "/usr/local/bin/gcloud ": exit status 2. If I run kubectl get pods it works, and subsequent kubecfg update commands work, until the token expires I guess.

Implement `check` subcommand

kubecfg check should perform as many validations as we can without sending the objects to the API server.

Specifically:

  • evaluate the jsonnet (verifying syntax and jsonnet asserts)
  • compare resulting json against swagger spec

Note: Unlike kubectl, swagger spec should (optionally?) be able to be read from static files on disk (ie: with no access to API server at runtime)

kubecfg can't delete clusterrole from jsonnet

With below jsonnet for a simple clusterrole:

$ cat kubecfg-clusterrole-foo.jsonnet
local k = import "ksonnet.beta.1/k.libsonnet";
local objectMeta = k.core.v1.objectMeta;

local controller_roles = [{
  apiGroups: ['core'],
  resources: ['pods'],
  verbs: ['list'],
}];

local clusterRole(name, rules) = {
    apiVersion: "rbac.authorization.k8s.io/v1beta1",
    kind: "ClusterRole",
    metadata: objectMeta.name(name),
    rules: rules,
};

local controllerClusterRole = clusterRole("foo", controller_roles);

{
  controllerClusterRole: controllerClusterRole,
}

, doing update+delete fails with:

$ kubecfg -v=1 update kubecfg-clusterrole-foo.jsonnet 
INFO  Updating ClusterRole/foo
INFO  Creating non-existent ClusterRole/foo
$ kubecfg -v=1 delete kubecfg-clusterrole-foo.jsonnet 
INFO  Deleting ClusterRole/foo
FATAL Error deleting ClusterRole/foo:  "" is invalid: []: Invalid value: v1.DeleteOptions{TypeMeta:v1.TypeMeta{Kind:"", APIVersion:""}, GracePeriodSeconds:(*int64)(nil), Preconditions:(*v1.Preconditions)(nil), OrphanDependents:(*bool)(0xc426cd5aee), PropagationPolicy:(*v1.DeletionPropagation)(0xc426cd5af0)}: OrphanDependents and DeletionPropagation cannot be both set

# while kubectl CLI works ok:
$ kubectl delete clusterrole foo 
clusterrole "foo" deleted

FYI relevant versions (kubecfg built from HEAD as now, 2017-07-25 19:30 UTC):

$ kubecfg version
kubecfg version: (dev build)
jsonnet version: v0.9.4

$ kubectl version 
Client Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.4", GitCommit:"d6f433224538d4f9ca2f7ae19b252e6fcb66a3ae", GitTreeState:"clean", BuildDate:"2017-05-19T18:44:27Z", GoVersion:"go1.7.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.4", GitCommit:"d6f433224538d4f9ca2f7ae19b252e6fcb66a3ae", GitTreeState:"dirty", BuildDate:"2017-06-22T04:31:09Z", GoVersion:"go1.7.5", Compiler:"gc", Platform:"linux/amd64"}

$ kubectl api-versions 
apps/v1beta1
authentication.k8s.io/v1
authentication.k8s.io/v1beta1
authorization.k8s.io/v1
authorization.k8s.io/v1beta1
autoscaling/v1
autoscaling/v2alpha1
batch/v1
batch/v2alpha1
certificates.k8s.io/v1beta1
extensions/v1beta1
k8s.io/v1
policy/v1beta1
rbac.authorization.k8s.io/v1alpha1
rbac.authorization.k8s.io/v1beta1
settings.k8s.io/v1alpha1
storage.k8s.io/v1
storage.k8s.io/v1beta1
v1

FYI -v=3 run:

$ kubecfg -v=3 delete kubecfg-clusterrole-foo.jsonnet 
DEBUG Adding jsonnet search path /home/jjo/work/src/github.com/ksonnet/ksonnet-lib
DEBUG jsonnet result is: {
   "controllerClusterRole": {
      "apiVersion": "rbac.authorization.k8s.io/v1beta1",
      "kind": "ClusterRole",
      "metadata": {
         "name": "foo"
      },
      "rules": [
         {
            "apiGroups": [
               "core"
            ],
            "resources": [
               "pods"
            ],
            "verbs": [
               "list"
            ]
         }
      ]
   }
}
INFO  Deleting ClusterRole/foo
DEBUG Chose API 'clusterroles' for rbac.authorization.k8s.io/v1beta1, Kind=ClusterRole
DEBUG Fetching client for &APIResource{Name:clusterroles,Namespaced:false,Kind:ClusterRole,Verbs:[create delete deletecollection get list patch update watch],ShortNames:[],} namespace=default
FATAL Error deleting ClusterRole/foo:  "" is invalid: []: Invalid value: v1.DeleteOptions{TypeMeta:v1.TypeMeta{Kind:"", APIVersion:""}, GracePeriodSeconds:(*int64)(nil), Preconditions:(*v1.Preconditions)(nil), OrphanDependents:(*bool)(0xc42d1b13ee), PropagationPolicy:(*v1.DeletionPropagation)(0xc42d1b13f0)}: OrphanDependents and DeletionPropagation cannot be both set

`diff` seems to fail when object name is missing

When an object without a metadata.name appears, this branch is evaluated, causing the following error:

DEBUG Fetching %!(EXTRA string=Namespace/)
DEBUG Chose API 'namespaces' for /v1, Kind=Namespace
DEBUG Fetching client for &APIResource{Name:namespaces,Namespaced:false,Kind:Namespace,} namespace=elasticsearch
FATAL Error fetching Namespace/: resource name may not be empty

I'm not entirely sure what object caused this, and it seems like undesirable behavior, but if it wasn't, then it seems like we should consider improving the error message here.

Allow `change-cause` annotation to be set

kubecfg should add the kubernetes.io/change-cause annotation to something meaningful on updated objects, so tools like kubectl rollout history provide useful output.

NB: This might need to be combined with some form of "no-op" detection to prevent spamming the history with updates where the only change is updating the change-cause annotation.

Consider renaming `kubecfg`

The community seems to agree that kubecfg is confusing next to kubeconfig files. It is worth considering what the name should be. The design doc calls the tool ksonnet which does seem to minimize confusion.

Want to build config maps that embed YAML.

I would love to be able to use jsonnet and kubecfg to build config maps that themselves contain YAML, which I would like to be native jsonnet object thats I can manipulate. The concrete examples is embedding Prometheus config in a config map, and manipulating that config based on the environment.

To this end, I wrote a function that serialises an object to YAML (see https://github.com/tomwilkie/kubecfg/tree/unparse-yaml), but I hit the restriction "Native extensions can only take primitives." (https://github.com/google/jsonnet/blob/master/core/vm.cpp#L2157).

Is this something worth pursuing? If so, I guess I'd need to make a PR into jsonnet to add a std.manifestYaml(v) like the existing manifest functions?

show_test.go's TestShow failing intermittently

@hausdorff and I have noticed that this tests fails occasionally.

go test -ldflags="-X main.version=build-270159619 -linkmode external -extldflags=-static"  ./cmd/... ./utils/... ./pkg/... ./metadata/...
--- FAIL: TestShow (0.24s)
	show_test.go:34: Running args [show -J ../testdata/lib -o yaml -f ../testdata/test.jsonnet -V aVar=aVal -V anVar --ext-str-file filevar=../testdata/extvar.file]
	show_test.go:90: output is ---
		apiVersion: v0alpha1
		array:
		- one
		- 2
		- - 3
		bool: true
		filevar: |
		  foo
		kind: TestObject
		nil: null
		notAVal: aVal
		notAnotherVal: aVal2
		number: 42
		object:
		  foo: bar
		string: bar
		
	show_test.go:34: Running args [show -J ../testdata/lib -o json -f ../testdata/test.jsonnet -V aVar=aVal -V anVar --ext-str-file filevar=../testdata/extvar.file]
	show_test.go:90: output is ---
		{
		  "apiVersion": "v0alpha1",
		  "array": [
		    "one",
		    2,
		    [
		      3
		    ]
		  ],
		  "bool": true,
		  "filevar": "foo\n",
		  "kind": "TestObject",
		  "nil": null,
		  "notAVal": "aVal",
		  "notAnotherVal": "aVal2",
		  "number": 42,
		  "object": {
		    "foo": "bar"
		  },
		  "string": "bar"
		}
		---
		{
		  "apiVersion": "v0alpha1",
		  "array": [
		    "one",
		    2,
		    [
		      3
		    ]
		  ],
		  "bool": true,
		  "filevar": "foo\n",
		  "kind": "TestObject",
		  "nil": null,
		  "notAVal": "aVal",
		  "notAnotherVal": "aVal2",
		  "number": 42,
		  "object": {
		    "foo": "bar"
		  },
		  "string": "bar"
		}
		
	show_test.go:93: error parsing output of format json: invalid character '-' in numeric literal
FAIL
FAIL	github.com/ksonnet/kubecfg/cmd	0.350s
ok  	github.com/ksonnet/kubecfg/utils	0.726s
ok  	github.com/ksonnet/kubecfg/pkg/kubecfg	0.115s
ok  	github.com/ksonnet/kubecfg/metadata	0.018s
make: *** [gotest] Error 1

Object comprehensions are not working

Sample file:

local k = import "ksonnet.beta.1/k.libsonnet";

local encode64(data) = {[x]: std.base64(data[x]) for x in std.objectFields(data)};
local secret = k.core.v1.secret {
//  data(data):: {data+: data},
};

encode64({foo: "barbaz"})

Expected output:

$ jsonnet secret.jsonnet
{
   "foo": "YmFyYmF6"
}

Actual output:

$ kubecfg show secret.jsonnet
Error: Error reading secret.jsonnet: Unexpected object structure: string

`--namespace` flag seems to be broken

Following up from PR #100, which shows a failure of the integration tests, I believe that the -n flag is failing to be handled correctly. I was able to reproduce locally. Observe the following example, where I attempt to use update -n to put a configMap with the name testcm into a namespace, but when I run get we see that it shows up in the namespace specified in the current context:

$ ../kubecfg update -vv -n updatewtlhj -f components/kubecfg-cm.yaml
INFO  Updating configmaps testcf
DEBUG Chose API 'configmaps' for /v1, Kind=ConfigMap
DEBUG Fetching client for &APIResource{Name:configmaps,Namespaced:true,Kind:ConfigMap,Verbs:[create delete deletecollection get list patch update watch],ShortNames:[cm],} namespace=kubecfgtest
DEBUG Patch(testcf) returned (&{map[kind:ConfigMap apiVersion:v1 metadata:map[resourceVersion:3471 creationTimestamp:2017-09-02T22:30:41Z name:testcf namespace:kubecfgtest selfLink:/api/v1/namespaces/kubecfgtest/configmaps/testcf uid:5a271989-902e-11e7-875d-06e36f41fda2]]}, <nil>)
DEBUG Updated object: {"apiVersion":"v1","

A: data":{},"kind":"ConfigMap","metadata":{"name":"testcf"}}

B: kind":"ConfigMap","metadata":{"creationTimestamp":"2017-09-02T22:30:41Z","name":"testcf","namespace":"kubecfgtest","resourceVersion":"3471","selfLink":"/api/v1/namespaces/kubecfgtest/configmaps/testcf","uid":"5a271989-902e-11e7-875d-06e36f41fda2"}}
$ k get cm -n updatewtlhj
No resources found.
$ k get cm --all-namespaces
NAMESPACE     NAME                                 DATA      AGE
kube-public   cluster-info                         2         1h
kube-system   calico-config                        3         1h
kube-system   extension-apiserver-authentication   6         1h
kube-system   kube-proxy                           1         1h
kubecfgtest   nons                                 0         44m
kubecfgtest   testcf                               0         1h
kubecfgtest   testcm                               1         44m

Large diff output for missing default values

When I use kubecfg diff I tend to see a wall of red, representing default values missing from my local config but returned by the API server. To work around this in weaveworks/kubediff I only check the local config is a subset of the config returned by the API server - ie we ignore fields which don't exist in the local config.

If this something we can do for kubecfg?

client-go flags show up in every command

Currently we rope in the default client-go flags into RootCmd. This causes every subcommand to always have all the default flags, even if they're not useful or necessary to the command.

We should instead set these flags only on commands that require them.

Bring `ksonnet update` into sync with `ksonnet.next` spec

The behavior of the ksonnet update command is specified in the ksonnet.next design doc from August 2017.

Bringing the command to specification implies the following work items:

  • Completed in #88. Update help documentation.
  • Decide on the name. The community seems to believe apply is clearer, so it seems like this is probably the leading contender.
    • Completed in #105. Change update to apply. Deprecate update. Keep for two release cycles.
  • Completed in #88. Change update to:
    1. Expand and apply everything in the components/ directory, if the --env flag is passed.
    2. Do the same thing it currently does if the --file flag is passed.

Wishlist: native function to map docker image name:tag to name@sha

Add a function that is able to look up docker registries to map name:tag to name:sha at jsonnet-eval time.

Needs to be a jsonnet function so it can still be used in "hidden" places like json-serialised annotations.

Must be able to be disabled (reduced to identity function) via a command line flag, for cases where we don't want to do network lookups.

At this stage I think this should be disabled by default.

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.