This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.3.5.6.2.2. --inlined フラグでの odo link の使用
odo link
コマンドで --inlined
フラグを使用すると、これがバインディング情報を挿入するというフラグなしに odo link
コマンドと同じ効果があります。ただし、上記の場合は、kubernetes/
ディレクトリーに 2 つのマニフェストファイルがあります。1 つは Postgres サービス用で、もう 1 つは backend コンポーネントとこのサービス間のリンク用です。ただし、-inlined
フラグを渡すと、odo
は kubernetes/
ディレクトリーの下に YAML マニフェストを保存するファイルを作成せず、devfile.yaml
ファイルにインラインで保存します。
これを確認するには、最初に PostgreSQL サービスからコンポーネントをリンク解除します。
odo unlink PostgresCluster/hippo
$ odo unlink PostgresCluster/hippo
出力例:
✓ Successfully unlinked component "backend" from service "PostgresCluster/hippo" To apply the changes, please use `odo push`
✓ Successfully unlinked component "backend" from service "PostgresCluster/hippo"
To apply the changes, please use `odo push`
クラスターでそれらをリンクするには、odo push
を実行します。kubernetes/
ディレクトリーを検査すると、1 つのファイルのみが表示されます。
ls kubernetes
$ ls kubernetes
odo-service-hippo.yaml
次に、--inlined
フラグを使用してリンクを作成します。
odo link PostgresCluster/hippo --inlined
$ odo link PostgresCluster/hippo --inlined
出力例:
✓ Successfully created link between component "backend" and service "PostgresCluster/hippo" To apply the link, please use `odo push`
✓ Successfully created link between component "backend" and service "PostgresCluster/hippo"
To apply the link, please use `odo push`
--inlined
フラグを省略する手順など、クラスターで作成されるリンクを取得するために odo push
を実行する必要があります。odo
は設定を devfile.yaml
に保存します。このファイルに以下のようなエントリーが表示されます。
odo unlink PostgresCluster/hippo
を実行する場合に、odo
はまず devfile.yaml
からリンク情報を削除し、後続の odo push
はクラスターからリンクを削除するようになりました。