Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Address a few pieces of feedback from @ensonic #71

Merged
merged 2 commits into from Nov 28, 2017
Merged

Conversation

mattmoor
Copy link
Contributor

Removes some of the friction from: #68
Fixes: #69

@mattmoor
Copy link
Contributor Author

@ensonic This should enable you to use a much more relaxed set of things as the keys in the images dictionary. It isn't completely free-form because it still becomes a suffix of the image name, but I also disable strictness, so things like tags can be inferred.

If you could take this for a spin, and LMK what you think I'd appreciate it :)

Removes some of the friction from: #68
Fixes: #69
@mattmoor
Copy link
Contributor Author

@ensonic Were you able to make this work?

Copy link
Contributor

@ensonic ensonic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't need to prefix my rule names anymore. Thanks. But we still have a problem.
BUILD:

k8s_object(
    name = "deployment",
    template = ":deployment.yaml",
    images = {
      "web-frontend": "//src/docker/web_frontend:web_frontend",
    },
  )

deployment.yaml

apiVersion: extensions/v1beta1
kind: Deployment
spec:
  replicas: 1
  template:
    spec:
      containers:
      - name: web-frontend
        image: web-frontend 

Since you are using a simple expand_template action and the substitution keys are simple words, this will replace web-frontend in both name and image. What you want is to use the name as the name and not require the images key to be a valid image name.

@mattmoor
Copy link
Contributor Author

@ensonic LOL, yeah this was one of my original motivations for sticking with strict image names. I'm not sure how to avoid it without some level of schema-awareness.

@ensonic
Copy link
Contributor

ensonic commented Nov 28, 2017

Yeah, it is tricky. We should merge this. I've filed a new ticked to discuss the expansion:
#83

@mattmoor mattmoor merged commit 2cf2d16 into master Nov 28, 2017
@nlopezgi nlopezgi deleted the replace-anything branch November 27, 2018 15:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants