Workers connect drill bits and drill collars, used to extract natural petroleum, on Endeavor Energy Resources LP's Big Dog Drilling Rig 22 in the Permian basin outside of Midland, Texas.

The White House is set to levy a 25 percent tariff on $34 billion in Chinese goods, while the Chinese government has said it would retaliate on the same value of U.S. goods. both countries are set to institute those penalties on July 6.

In June, some commodities saw traders concerned about demand weakness in emerging markets, trade war rumblings, and oil producers' to increase production, the bank noted. The most headline-grabbing of those fears was about the tariff threats traded between President Donald Trump's administration and its international trading partners.

Concerns about oil and other commodities have been "oversold," and even those most exposed to the risks of a U.S.-China trade war are worth buying, Goldman Sachs said in a Wednesday research note.

While many have suggested that could be the starting gun for a global trade war that would hit broader economies, Goldman said commodities were not set to be largely hit.

“Only markets that cannot be rerouted globally to other consumers will be impacted by the proposed July 6th tariffs ... We believe that the trade war impact on commodity markets will be very small, with exception of soybeans where complete rerouting of supplies is not possible," the Goldman note said.

Even so, soybean contracts still have “value at current levels,” according to Goldman. On June 19, soybean futures had plunged to a nine-year low, following concerns about a U.S.-China trade war.

“We believe all of these concerns have been oversold. Even soybeans, the most exposed of all assets to trade wars, is now a buy,” Goldman analysts wrote.

The note continued: “The momentum in oil has already turned on news of tighter Iranian sanctions and additional supply disruptions.”

Goldman said its broadly bullish view on commodities was bolstered by strong global growth and depleting inventories in energy and metal markets that would likely result in higher prices.

The bank maintained its "Overweight" assessment of the commodities space, and said it has a 12-month expected return of 10 percent for the S&P Goldman Sachs Commodity Index.