forked from yannh/kubeconform
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
302 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: some-values | ||
annotations: | ||
cert(manager.io/cluster-issuer": issue #275 | ||
data: | ||
file.name: "a value" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: some-values | ||
annotations: | ||
some.domain/some-key: | ||
data: | ||
file.name: "a value" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: some-values | ||
annotations: | ||
some.domain/some-key: null | ||
data: | ||
file.name: "a value" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: some-values | ||
labels: | ||
abcdefghijklmnopqrstuvwxyz-01234567890-ABCDEFGHIJKLMNOPQRSTUVWXYZ: "123456789_123456789_123456789_123456789_123456789_123456789_123" | ||
data: | ||
file.name: "a value" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: some-values | ||
labels: | ||
abcdefghijklmnopqrstuvwxyz-01234567890-ABCDEFGHIJKLMNOPQRSTUVWXYZ.example.com/ABCDEFGHIJKLMNOPQRSTUVWXYZ: "123456789_123456789_123456789_123456789_123456789_123456789_123" | ||
data: | ||
file.name: "a value" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: some-values | ||
labels: | ||
some.domain/some-key: 123456789_123456789_123456789_123456789_123456789_123456789_1234 | ||
data: | ||
file.name: "a value" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
data: | ||
file.name: "a value" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
|
||
data: | ||
file.name: "a value" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: abcdefghijklmnopqrstuvwxyz-01234567890-ABCDEFGHIJKLMNOPQRSTUVWXYZ | ||
data: | ||
file.name: "a value" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package registry | ||
|
||
import ( | ||
"embed" | ||
) | ||
|
||
//go:embed *.json | ||
var content embed.FS | ||
|
||
type EmbeddedRegistry struct { | ||
debug bool | ||
} | ||
|
||
// newEmbeddedRegistry creates a new "registry", that will serve schemas from embedded resource | ||
func newEmbeddedRegistry(debug bool) (*EmbeddedRegistry, error) { | ||
return &EmbeddedRegistry{ | ||
debug, | ||
}, nil | ||
} | ||
|
||
// DownloadSchema retrieves the schema from a file for the resource | ||
func (r EmbeddedRegistry) DownloadSchema(resourceKind, resourceAPIVersion, k8sVersion string) (string, []byte, error) { | ||
bytes, err := content.ReadFile(resourceKind + ".json") | ||
if err != nil { | ||
return resourceKind, nil, nil | ||
} | ||
return resourceKind, bytes, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"type": "object", | ||
"properties": { | ||
"apiVersion": { | ||
"$ref": "#/$defs/NAMESPACED" | ||
}, | ||
"kind": { | ||
"$ref": "#/$defs/NAME" | ||
}, | ||
"metadata": { | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"$ref": "#/$defs/RFC-1123" | ||
}, | ||
"generateName": { | ||
"$ref": "#/$defs/RFC-1123-prefix" | ||
}, | ||
"annotations": { | ||
"type": "object", | ||
"propertyNames": { | ||
"$ref": "#/$defs/NAMESPACED" | ||
}, | ||
"patternProperties": { | ||
"^.+$": { | ||
"type": "string", | ||
"minLength": 1 | ||
} | ||
} | ||
}, | ||
"labels": { | ||
"type": "object", | ||
"propertyNames": { | ||
"$ref": "#/$defs/NAMESPACED" | ||
}, | ||
"patternProperties": { | ||
"^.+$": { | ||
"$ref": "#/$defs/NAME" | ||
} | ||
} | ||
} | ||
}, | ||
"oneOf": [ | ||
{ | ||
"required": [ | ||
"name" | ||
] | ||
}, | ||
{ | ||
"required": [ | ||
"generateName" | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
"required": [ | ||
"apiVersion", | ||
"kind", | ||
"metadata" | ||
], | ||
"$defs": { | ||
"NAMESPACED": { | ||
"allOf": [ | ||
{ | ||
"pattern": "^(.{0,253}/)?.{1,63}$", | ||
"type": "string" | ||
}, | ||
{ | ||
"pattern": "^([a-z0-9-]{1,63}(\\.[a-z0-9-]{1,63})*/)?[a-z0-9A-Z]+([_.-][a-z0-9A-Z]+)*$" | ||
} | ||
] | ||
}, | ||
"NAME": { | ||
"type": "string", | ||
"minLength": 1, | ||
"maxLength": 63, | ||
"pattern": "^[a-z0-9A-Z]+([_.-][a-z0-9A-Z]+)*$" | ||
}, | ||
"RFC-1123": { | ||
"type": "string", | ||
"minLength": 1, | ||
"maxLength": 63, | ||
"pattern": "^[a-z0-9]+(-+[a-z0-9]+)*$" | ||
}, | ||
"RFC-1123-prefix": { | ||
"type": "string", | ||
"minLength": 1, | ||
"maxLength": 58, | ||
"pattern": "^[a-z0-9]+[a-z0-9-]*$" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.