kustomize-lint

command module
v1.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

README

kustomize-lint

This tool helps you to validate tag in ci Please post issues if you need more options

In this kind of architecture below, you have to check whether yamls in production directory has sentences related to staging or development by code review.

├── user
│   ├── base
│   │   ├── deployment.yaml
│   │   ├── kustomization.yaml
│   │   └── service.yaml
│   └── overlays
│       ├── development
│       │   ├── deployment.yaml
│       │   ├── kustomization.yaml
│       │   ├── service.yaml
│       ├── production
│       │   ├── deployment.yaml
│       │   ├── kustomization.yaml
│       │   ├── service.yaml
│       └── staging
│           ├── deployment.yaml
│           ├── kustomization.yaml
│           ├── service.yaml

If you use this lint, ci exit with code 1 when production kustomization has wrong tag. for ex)

user/overlays/production/kustomization.yaml

images:
  - name: nginx-production
    # need to be productionXX, but is mistakenly staging
    newTag: staging

note

supported tag in kustomization

  • image
  • newTag

usage

  1. go get -u github.com/0daryo/kustomize-lint or get binary from release page
  2. write kustomize-lint.yaml following the rule in kustomize-lint-ex.yaml
files:
  - file:
    name: "*/production/kustomization.yaml"
    sentences:
    # words tag must have
      - name: newTag
        include:
          - production
          - latest
      - name: name
        include:
          - production
  1. run kustomize-lint run with a directory where target yamls are.

Documentation

Overview

Copyright © 2019 NAME HERE <EMAIL ADDRESS>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL