CHARLOTTE, N.C. — The Knicks’ conversion of Allonzo Trier’s two-way G-League contract into a standard NBA deal for two years and $6.8 million — completed Thursday — could eat into some cap space reserved for Warriors’ free-agent-to-be Kevin Durant.

According to a source, the second year of the deal is a team option, but the Knicks have every intention to exercise it as long as Trier continues being the rookie revelation he’s been as an undrafted scoring guard out of Arizona. The Knicks will use their biannual exception on the new contract.

Meanwhile, the Trier-Durant link could work in the Knicks’ favor.

Trier and “KD” became “close” when Trier was one of the top high school prospects in the country, spending two years playing high school ball in Oklahoma City. The then-Thunder star has served as a mentor and attended several of Trier’s high school games.

“We became close, yes,’’ Trier said after Thursday’s practice here. “Yeah, he’s seen plenty [of my games]. I was one of the top-ranked players in the country out of high school. Just a guy being a genuine person, wanted to look out for me, wanted to get to know me and build a relationship with me. Ever since then our bond has grown and [he] became my brother.”

Trier has heard from Durant this season.

“Yeah, he told me you’re in a blessed position,’’ Trier said. “He told me soon you’ll be secure and you’ll be taken care. Just continue to work hard. He already knows I love the game and how much I dedicate to it. He said enjoy this now. You’re going to play a really long time in this league. So just continue to stay even-keeled, take the ups, take the downs and continue to just be yourself and that will take care of it, especially when you love the game.”

The Trier saga has turned into a major Knicks success story of this 8-21 campaign. Despite playing at high-profile Arizona, he went undrafted and the Knicks scooped him up on a two-way G-League contract that mandates a limit of 45 days on an NBA roster. The Knicks had to open up a spot on the 15-man roster and released gritty cult hero Ron Baker.

A scoring demon, Trier is averaging 11.3 points on 47 percent shooting (39.1 percent on 3-pointers), 3.1 rebounds and 1.9 assists over 23.2 minutes. Among rookies, Trier ranks seventh in scoring, third in 3-point percentage and ninth in field-goal percentage. He’ll likely be back in Charlotte on All-Star Weekend for the Rising Stars Challenge featuring rookies and sophomores.

He does his damage in multiple forms — whether it be slashing, pull-ups, 3-pointers. Hence his nickname “IsoZo.’’

“Put the ball in his hands, he knows how to get a basket,’’ Knicks coach David Fizdale said.

The Knicks coach reflected on draft night.

“There’s always a guy or two who falls through the cracks,’’ Fizdale said. “He fell all the way through the cracks. That’s what was surprising. From the beginning, [general manager] Scott Perry kept telling me [if] this guy falls we might have a chance of having a real good basketball player.’’

The war room was hopping midway through the second round after the Knicks used their 36th pick on rookie Mitchell Robinson. If Robinson wasn’t available, Trier was the guy.

“The whole draft Scott is saying, ‘We almost got him, we almost got him,’’’ Fizdale said. “We got through the draft and we got him on the phone right away. I said, ‘Look, you didn’t get drafted. We know it’s a painful day for you. We want to give you an opportunity to make the team — not just come here to be a two-way player.’ The kid said I really believe I should’ve been drafted. I don’t believe 60 people are better than me. We said why don’t you come here and prove it. And here we are.’’

Here we are indeed. Trier had baggage — two failed PED tests and a rep as a selfish player. Before his sophomore year, he was slated for the lottery.

“I don’t really know what happened with 60 picks,’’ Trier said. “Those are all teams’ decisions. But you know people make mistakes every day. I’m just really glad to know I’m with an organization that really wants me here. I don’t think it changes anything in my mindset. I’m happy just to know I’m going to be part of here long term now.”

Counting Trier’s pact next season and Kristaps Porzingis’ cap hold, the Knicks should have $30 million of cap space, so they have more work to do. Durant’s max starts at $38 million.

The Durant tie is another reason the Knicks want him as a mainstay of this young corps, though he won’t play on this road trip that goes through Sunday, sidelined a strained hamstring. Fizdale said Trier is a natural 2-guard, but has shown point-guard abilities.

“He can handle the ball, get you in the offense and can guard both guard positions,’’ Fizdale said. “He’s a natural scorer. It didn’t take long to figure that out.”