|
// KustomizeDeployForCluster applies a given kustomizeURL to the provided cluster |
|
func KustomizeDeployForCluster(ctx context.Context, cluster Cluster, kustomizeURL string, flags ...string) error { |
|
return kubectlWithArgs(ctx, cluster, append([]string{"-v9", "apply", "-k", kustomizeURL}, flags...)...) |
|
} |
|
|
|
// KustomizeDeleteForCluster deletes the provided kustomize manafests from the cluster |
|
func KustomizeDeleteForCluster(ctx context.Context, cluster Cluster, kustomizeURL string, flags ...string) error { |
|
return kubectlWithArgs(ctx, cluster, append([]string{"-v9", "delete", "-k", kustomizeURL}, flags...)...) |
|
} |
|
|
|
// ApplyManifestByURL applies a given manifest URL to the cluster provided |
|
func ApplyManifestByURL(ctx context.Context, cluster Cluster, url string) error { |
|
return kubectlWithArgs(ctx, cluster, "apply", "-f", url) |
|
} |
|
|
|
// DeleteManifestByURL deletes a given manifest URL on the cluster provided |
|
func DeleteManifestByURL(ctx context.Context, cluster Cluster, url string) error { |
|
return kubectlWithArgs(ctx, cluster, "delete", "-f", url) |
|
} |
|
|
|
// ApplyManifestByYAML applies a given YAML manifest to the cluster provided |
|
func ApplyManifestByYAML(ctx context.Context, cluster Cluster, yaml string) error { |
|
return kubectlSubcommandWithYAML(ctx, cluster, "apply", yaml) |
|
} |
|
|
|
// DeleteManifestByYAML deletes a given YAML manifest on the cluster provided |
|
func DeleteManifestByYAML(ctx context.Context, cluster Cluster, yaml string) error { |
|
return kubectlSubcommandWithYAML(ctx, cluster, "delete", yaml) |
|
} |
Problem statement
KTF provides several functions which allow to interact with kubectl (and kustomize via
kubetl -k) inkubernetes-testing-framework/pkg/clusters/utils.go
Lines 211 to 239 in efb08ea
These functions access
cluster.Clusterwhich is an interface with numerous methods which not all clusters might provideIn several projects like KIC or KGO, envtest is used to create clusters on the fly. These clusters are not yet supported.
This task tracks the effort to:
envtestso that these funcs can be utilized withenvtestclustersAcceptance criteria
envtestclusters