mirror of
https://github.com/thegeeklab/drone-yaml.git
synced 2024-11-21 17:40:39 +00:00
add from_secret with short and long format
This commit is contained in:
parent
fc54b2d17a
commit
5e77906fc4
4
main.go
4
main.go
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package main
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package yaml
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package compiler
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package compiler
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package compiler
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package compiler
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package image
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package compiler
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package compiler
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package compiler
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package transform
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package transform
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package transform
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package transform
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package transform
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package transform
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package transform
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package transform
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package transform
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package transform
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package transform
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package compiler
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package yaml
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package bitbucket
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package bitbucket
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package bitbucket
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package bitbucket
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
// +build !oss
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
// +build !oss
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package gitlab
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package gitlab
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package gitlab
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package internal
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package internal
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package legacy
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package yaml
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package yaml
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package yaml
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package yaml
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package yaml
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package yaml
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package yaml
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package yaml
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package yaml
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package yaml
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package yaml
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package yaml
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package yaml
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package legacy
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package legacy
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package matrix
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package yaml
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
// Copyright 2019 Drone IO, Inc.
|
||||
//
|
||||
//
|
||||
// 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package yaml
|
||||
|
||||
|
50
yaml/from_secret.go
Normal file
50
yaml/from_secret.go
Normal file
@ -0,0 +1,50 @@
|
||||
// Copyright 2019 Drone IO, Inc.
|
||||
//
|
||||
// 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.
|
||||
|
||||
package yaml
|
||||
|
||||
type (
|
||||
// FromSecret defines a secret sources from an external value.
|
||||
// This could be a named secret stored in the Drone database,
|
||||
// or a secret stored at an external path in a key value
|
||||
// system such as Vault.
|
||||
FromSecret struct {
|
||||
Name string `json:"name"`
|
||||
Path string `json:"path"`
|
||||
}
|
||||
|
||||
// fromSecret is a tempoary type used to unmarshal
|
||||
// from_secret which may be short form vs long form.
|
||||
fromSecret struct {
|
||||
Name string `json:"name"`
|
||||
Path string `json:"path"`
|
||||
}
|
||||
)
|
||||
|
||||
// UnmarshalYAML implements yaml unmarshalling.
|
||||
func (v *FromSecret) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
||||
err := unmarshal(&v.Name)
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
s := struct {
|
||||
Name string
|
||||
Path string
|
||||
}{}
|
||||
err = unmarshal(&s)
|
||||
v.Name = s.Name
|
||||
v.Path = s.Path
|
||||
return err
|
||||
}
|
50
yaml/from_secret_test.go
Normal file
50
yaml/from_secret_test.go
Normal file
@ -0,0 +1,50 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package yaml
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
func TestFromSecret(t *testing.T) {
|
||||
tests := []struct {
|
||||
yaml string
|
||||
name string
|
||||
path string
|
||||
}{
|
||||
{
|
||||
yaml: "bar",
|
||||
name: "bar",
|
||||
path: "",
|
||||
},
|
||||
{
|
||||
yaml: "{ name: bar }",
|
||||
name: "bar",
|
||||
path: "",
|
||||
},
|
||||
{
|
||||
yaml: "{ name: bar, path: foo }",
|
||||
name: "bar",
|
||||
path: "foo",
|
||||
},
|
||||
}
|
||||
for _, test := range tests {
|
||||
in := []byte(test.yaml)
|
||||
out := new(FromSecret)
|
||||
err := yaml.Unmarshal(in, out)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
return
|
||||
}
|
||||
if got, want := out.Name, test.name; got != want {
|
||||
t.Errorf("Want from_secret name %q, got %q", want, got)
|
||||
}
|
||||
if got, want := out.Path, test.path; got != want {
|
||||
t.Errorf("Want from_secret path %q, got %q", want, got)
|
||||
}
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package linter
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package linter
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package yaml
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package yaml
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package yaml
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package yaml
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package yaml
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
// +build !oss
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
// +build !oss
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
// +build !oss
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
// +build !oss
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
// +build !oss
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
// +build !oss
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
// +build !oss
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
// +build !oss
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
// +build !oss
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
// +build !oss
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
// +build !oss
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
// +build !oss
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
// +build !oss
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
// +build !oss
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
// +build !oss
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
// +build !oss
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
// +build !oss
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
// +build !oss
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package yaml
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package yaml
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
// Copyright 2019 Drone IO, Inc.
|
||||
//
|
||||
//
|
||||
// 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.
|
||||
@ -16,6 +16,9 @@ package yaml
|
||||
|
||||
import "errors"
|
||||
|
||||
// TODO(bradrydzewski) deprecate Secret
|
||||
// TODO(bradrydzewski) deprecate ExternalData
|
||||
|
||||
type (
|
||||
// Secret is a resource that provides encrypted data
|
||||
// and pointers to external data (i.e. from vault).
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package yaml
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package yaml
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Copyright 2019 Drone.IO Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Drone Community
|
||||
// License that can be found in the LICENSE file.
|
||||
// Use of this source code is governed by the Drone Non-Commercial License
|
||||
// that can be found in the LICENSE file.
|
||||
|
||||
package yaml
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user