@@ -8909,6 +8909,76 @@ To get status: "tanzu apps workload get my-workload"
8909
8909
}
8910
8910
},
8911
8911
},
8912
+ {
8913
+ Name : "update from local source using lsp changing subpath" ,
8914
+ Skip : runtm .GOOS == "windows" ,
8915
+ Args : []string {workloadName , flags .LocalPathFlagName , localSource , flags .FilePathFlagName , "./testdata/workload-LSP-subPath.yaml" , flags .YesFlagName },
8916
+ GivenObjects : []client.Object {
8917
+ parent .
8918
+ MetadataDie (func (d * diemetav1.ObjectMetaDie ) {
8919
+ d .Annotations (map [string ]string {apis .LocalSourceProxyAnnotationName : ":default-my-workload@sha256:978be33a7f0cbe89bf48fbb438846047a28e1298d6d10d0de2d64bdc102a9e69" })
8920
+ d .Labels (map [string ]string {apis .WorkloadTypeLabelName : "web" })
8921
+ }).SpecDie (func (d * diecartov1alpha1.WorkloadSpecDie ) {
8922
+ d .Source (& cartov1alpha1.Source {
8923
+ Image : ":default-my-workload@sha256:978be33a7f0cbe89bf48fbb438846047a28e1298d6d10d0de2d64bdc102a9e69" ,
8924
+ Subpath : "old-subpath" ,
8925
+ })
8926
+ }),
8927
+ },
8928
+ KubeConfigTransport : clitesting .NewFakeTransportFromResponse (respCreator (http .StatusOK , `{"statuscode": "200", "message": "any ignored message"}` , myWorkloadHeader )),
8929
+ ExpectUpdates : []client.Object {
8930
+ & cartov1alpha1.Workload {
8931
+ ObjectMeta : metav1.ObjectMeta {
8932
+ Namespace : defaultNamespace ,
8933
+ Name : workloadName ,
8934
+ Labels : map [string ]string {
8935
+ apis .WorkloadTypeLabelName : "web" ,
8936
+ },
8937
+ Annotations : map [string ]string {
8938
+ "local-source-proxy.apps.tanzu.vmware.com" : ":default-my-workload@sha256:978be33a7f0cbe89bf48fbb438846047a28e1298d6d10d0de2d64bdc102a9e69" ,
8939
+ },
8940
+ },
8941
+ Spec : cartov1alpha1.WorkloadSpec {
8942
+ Source : & cartov1alpha1.Source {
8943
+ Image : ":default-my-workload@sha256:978be33a7f0cbe89bf48fbb438846047a28e1298d6d10d0de2d64bdc102a9e69" ,
8944
+ Subpath : "new-subpath" ,
8945
+ },
8946
+ Params : []cartov1alpha1.Param {
8947
+ {
8948
+ Name : "annotations" ,
8949
+ Value : apiextensionsv1.JSON {Raw : []byte (`{"autoscaling.knative.dev/minScale":"2"}` )},
8950
+ },
8951
+ },
8952
+ },
8953
+ },
8954
+ },
8955
+ ExpectOutput : fmt .Sprintf (`
8956
+ ❗ WARNING: Configuration file update strategy is changing. By default, provided configuration files will replace rather than merge existing configuration. The change will take place in the January 2024 TAP release (use "--update-strategy" to control strategy explicitly).
8957
+
8958
+ Publishing source in "%s" to "local-source-proxy.tap-local-source-system.svc.cluster.local/source:default-my-workload"...
8959
+ No source code is changed
8960
+
8961
+ 🔎 Update workload:
8962
+ ...
8963
+ 8, 8 | apps.tanzu.vmware.com/workload-type: web
8964
+ 9, 9 | name: my-workload
8965
+ 10, 10 | namespace: default
8966
+ 11, 11 |spec:
8967
+ 12 + | params:
8968
+ 13 + | - name: annotations
8969
+ 14 + | value:
8970
+ 15 + | autoscaling.knative.dev/minScale: "2"
8971
+ 12, 16 | source:
8972
+ 13, 17 | image: :default-my-workload@sha256:978be33a7f0cbe89bf48fbb438846047a28e1298d6d10d0de2d64bdc102a9e69
8973
+ 14 - | subPath: old-subpath
8974
+ 18 + | subPath: new-subpath
8975
+ 👍 Updated workload "my-workload"
8976
+
8977
+ To see logs: "tanzu apps workload tail my-workload --timestamp --since 1h"
8978
+ To get status: "tanzu apps workload get my-workload"
8979
+
8980
+ ` , localSource ),
8981
+ },
8912
8982
}
8913
8983
8914
8984
table .Run (t , scheme , func (ctx context.Context , c * cli.Config ) * cobra.Command {
0 commit comments