manifest

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertManifestsToObjects

func ConvertManifestsToObjects(
	b []byte,
	namespace string,
) ([]client.Object, error)

ConvertManifestsToObjects は複数の定義が入ったマニフェスト群を解析し、 Kubernetes Clientが扱えるclient.Object型に変換します。

ドキュメント分割は k8s.io/apimachinery の YAMLOrJSONDecoder を用います。 以前は bytes.Split で行頭 `---` を手書き検出していましたが、これは複数行 ブロックスカラー中に出現する `---` や `kind:` という名前のフィールドで誤動作し得たため、 YAML ドキュメントストリームを正しく解釈するデコーダへ置き換えています。

NOTE: schemeとUniversalDeserializerを利用した型安全なUnmarshalを検討しましたが、

Tazunaとしてはリソースがなんであるかに関心を持たず、なんであれapplyするだけなので、
unstructuredを利用します。
これにより、任意のCRDを拡張性を持ってサポートできます。

第二引数のnamespaceは、 helm templateなどでnamespaceが指定されていない場合に、 そのnamespaceを設定するために利用します。

Types

This section is empty.

Jump to

Keyboard shortcuts

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